APP-6884 - Add-auto-promote-stages - #103
Merged
asafgabai merged 4 commits intoSep 17, 2026
Merged
Conversation
danielreJfrog
requested a deployment
to
frogbot
September 16, 2026 06:57 — with
GitHub Actions
Waiting
danielreJfrog
requested a deployment
to
frogbot
September 16, 2026 08:10 — with
GitHub Actions
Waiting
Contributor
asafgabai
reviewed
Sep 17, 2026
| - If --application-name is omitted, the application-key is used as the display name. | ||
| - --labels uses semicolon separators (not commas) and key=value pairs. | ||
| - --monitor-policy takes 'type=<type>[, value=<n>]'. 'value' is required (positive integer) when type is "time_frame_in_months" or "version_count", and must be omitted when type is "none". | ||
| - --auto-promote-stages uses semicolon separators and preserves the supplied stage order. |
Collaborator
There was a problem hiding this comment.
It doesn't matter that the flag preserves the supplied stage order. I think this whole line can be removed.
asafgabai
reviewed
Sep 17, 2026
| - --labels replaces the full label set; --add-labels and --remove-labels modify incrementally. | ||
| - --user-owners / --group-owners take a semicolon-separated list and send exactly the owners you specify; there are no incremental add/remove-owner flags (unlike --add-labels / --remove-labels for labels). | ||
| - --monitor-policy takes 'type=<type>[, value=<n>]'. 'value' is required (positive integer) when type is "time_frame_in_months" or "version_count", and must be omitted when type is "none". When --monitor-policy is not provided, the current policy is left unchanged. | ||
| - --auto-promote-stages uses semicolon separators and preserves the supplied stage order. Pass an empty value to disable auto-promotion; omit the flag to leave the current stages unchanged. |
Collaborator
There was a problem hiding this comment.
The order of values doesn't matter:
and preserves the supplied stage order
asafgabai
reviewed
Sep 17, 2026
| UserOwnersFlag: components.NewStringFlag(UserOwnersFlag, "semicolon-separated (;) list of user owners in the form of \"user1;user2;...\" (wrapped by quotes).", func(f *components.StringFlag) { f.Mandatory = false }), | ||
| GroupOwnersFlag: components.NewStringFlag(GroupOwnersFlag, "semicolon-separated (;) list of group owners in the form of \"group1;group2;...\" (wrapped by quotes).", func(f *components.StringFlag) { f.Mandatory = false }), | ||
| MonitorPolicyFlag: components.NewStringFlag(MonitorPolicyFlag, "Defines how long application versions remain monitored, in the form of 'type=<type>[, value=<n>]'. Supported types: "+coreutils.ListToText(model.MonitorPolicyTypeValues)+". For '"+model.MonitorPolicyTypeTimeframe+"' or '"+model.MonitorPolicyTypeVersionCount+"', 'value' is the number of months or versions to keep monitoring (a positive integer). For '"+model.MonitorPolicyTypeNone+"', monitoring is disabled and 'value' must be omitted.", func(f *components.StringFlag) { f.Mandatory = false }), | ||
| AutoPromoteStagesFlag: components.NewStringFlag(AutoPromoteStagesFlag, "Semicolon-separated (;) lifecycle stages through which new application versions are automatically promoted. Pass an empty value to disable auto-promotion.", func(f *components.StringFlag) { f.Mandatory = false }), |
Collaborator
There was a problem hiding this comment.
To keep it consistent with existing flags, I suggest deleting this part:
Pass an empty value to disable auto-promotion.
asafgabai
reviewed
Sep 17, 2026
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestApplicationCommandsIncludeAutoPromoteStagesFlag(t *testing.T) { |
Collaborator
There was a problem hiding this comment.
I think it's a weak test and it's inconsistent. I suggest removing it.
asafgabai
reviewed
Sep 17, 2026
| @@ -7,6 +7,7 @@ import ( | |||
|
|
|||
Collaborator
There was a problem hiding this comment.
In the PR description you says the PR includes E2E but I can't find it. Is it planned to be added separately?
asafgabai
reviewed
Sep 17, 2026
| assert.NotContains(t, string(payload), "auto_promote_stages") | ||
| }) | ||
|
|
||
| t.Run("preserves configured order", func(t *testing.T) { |
Collaborator
There was a problem hiding this comment.
This test case can be removed
asafgabai
approved these changes
Sep 17, 2026
danielreJfrog
requested a deployment
to
frogbot
September 17, 2026 10:09 — with
GitHub Actions
Waiting
danielreJfrog
requested a deployment
to
frogbot
September 17, 2026 11:04 — with
GitHub Actions
Waiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--auto-promote-stagestoapp-createandapp-updateso CLI can set ordered lifecycle stages on create/update.--auto-promote-stageson update sends[]to turn auto-promotion off; omitting the flag leaves current stages unchanged.Test plan
go test ./...andgo vet ./...jf apptrust app-create my-app --project=default --auto-promote-stages="DEV;PROD"jf apptrust app-update my-app --auto-promote-stages="DEV;PROD"then--auto-promote-stages=""--specwithauto_promote_stages--speccannot be combined with--auto-promote-stagesMade with Cursor