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

Added missing fields for flexibleRollout feature flag strategy #1844

Merged
merged 1 commit into from
Dec 9, 2023
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
6 changes: 6 additions & 0 deletions project_feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ type ProjectFeatureFlagStrategyParameter struct {
GroupID string `json:"groupId,omitempty"`
UserIDs string `json:"userIds,omitempty"`
Percentage string `json:"percentage,omitempty"`

// Following fields aren't documented in Gitlab API docs,
// but are present in Gitlab API since 13.5.
// Docs: https://docs.getunleash.io/reference/activation-strategies#gradual-rollout
Rollout string `json:"rollout,omitempty"`
Stickiness string `json:"stickiness,omitempty"`
}

func (i ProjectFeatureFlag) String() string {
Expand Down
15 changes: 15 additions & 0 deletions project_feature_flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ func TestGetProjectFeatureFlag(t *testing.T) {
},
},
},
{
ID: 24,
Name: "flexibleRollout",
Parameters: &ProjectFeatureFlagStrategyParameter{
GroupID: "default",
Rollout: "50",
Stickiness: "default",
},
Scopes: []*ProjectFeatureFlagScope{
{
ID: 52,
EnvironmentScope: "*",
},
},
},
},
}

Expand Down
15 changes: 15 additions & 0 deletions testdata/get_project_feature_flag.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
"environment_scope": "production"
}
]
},
{
"id": 24,
"name": "flexibleRollout",
"parameters": {
"groupId": "default",
"rollout": "50",
"stickiness": "default"
},
"scopes": [
{
"id": 52,
"environment_scope": "*"
}
]
}
]
}
Loading