Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 👍🏻

SharedWithGroups []struct {
GroupID int `json:"group_id"`
GroupName string `json:"group_name"`
Expand Down
5 changes: 4 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,11 @@ 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 👍

DisabledAndOverridableSharedRunnersSettingValue SharedRunnersSettingValue = "disabled_and_overridable"
DisabledAndUnoverridableSharedRunnersSettingValue SharedRunnersSettingValue = "disabled_and_unoverridable"

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

// SharedRunnersSetting is a helper routine that allocates a new SharedRunnersSettingValue
Expand Down