Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Support shared_runners_setting in Group response #1805

Merged

Conversation

takp
Copy link
Contributor

@takp takp commented Sep 28, 2023

Add shared_runners_setting in Group response, and removed shared_runners_enabled because it was not included in the response. (shared_runners_enabled is returned in the Project resources, not Group.)

I confirmed with the curl response and had a look at the gitlab source code as well. In addition, I created a MR to add shared_runners_setting to the API doc: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132831

Ref:

@@ -607,7 +607,7 @@ type SharedRunnersSettingValue string
// https://docs.gitlab.com/ee/api/groups.html#options-for-shared_runners_setting
const (
EnabledSharedRunnersSettingValue SharedRunnersSettingValue = "enabled"
DisabledWithOverrideSharedRunnersSettingValue SharedRunnersSettingValue = "disabled_with_override"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it makes sense to leave the deprecated setting in here just to be more graceful and be backwards compatible. You could mark the setting as deprecated:

// Deprecated: DisabledWithOverrideSharedRunnersSettingValue is deprecated in favor of DisabledAndOverridableSharedRunnersSettingValue  
DisabledWithOverrideSharedRunnersSettingValue       SharedRunnersSettingValue = "disabled_with_override"
DisabledAndOverridableSharedRunnersSettingValue   SharedRunnersSettingValue = "disabled_and_overridable"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point! I added it as deprecated 👍

Add `shared_runners_setting` in Group response and removed
`shared_runners_enabled` because it was not included in the
response.

Ref: https://docs.gitlab.com/ee/api/groups.html
@takp takp force-pushed the fix-shared_runners_setting-for-group-resource branch from ce1d943 to 79f8c53 Compare September 29, 2023 00:32
@@ -68,7 +68,7 @@ type Group struct {
MentionsDisabled bool `json:"mentions_disabled"`
RunnersToken string `json:"runners_token"`
SharedProjects []*Project `json:"shared_projects"`
SharedRunnersEnabled bool `json:"shared_runners_enabled"`
SharedRunnersSetting SharedRunnersSettingValue `json:"shared_runners_setting"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess SharedRunnersEnabledshould also be deprecated instead of removed right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @svanharmelen, in my understanding, SharedRunnersEnabled is not an attribute of Group resource in the first place. SharedRunnersEnabled is an output of Project resource. So, I think we should remove SharedRunnersEnabled here. cc: @timofurrer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@svanharmelen @takp it seems like I've introduced this field a while back (#1429) - wrongly 😰

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check 👍🏻

Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍🏻

@svanharmelen svanharmelen merged commit 2692fa8 into xanzy:master Sep 29, 2023
@timofurrer
Copy link
Contributor

@svanharmelen once again, it would be awesome to get a release of this asap to unblock provider development 😇

@svanharmelen
Copy link
Member

Done...

@takp takp deleted the fix-shared_runners_setting-for-group-resource branch September 29, 2023 11:09
@takp
Copy link
Contributor Author

takp commented Sep 29, 2023

Thanks! 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants