Skip to content

APP-4230 - Add --skip-unassigned flag to version-create command#87

Open
danielreJfrog wants to merge 4 commits into
jfrog:mainfrom
danielreJfrog:feature/APP-4230-skip-unassigned-flag
Open

APP-4230 - Add --skip-unassigned flag to version-create command#87
danielreJfrog wants to merge 4 commits into
jfrog:mainfrom
danielreJfrog:feature/APP-4230-skip-unassigned-flag

Conversation

@danielreJfrog

Copy link
Copy Markdown

Summary

  • Adds the --skip-unassigned boolean flag to the version-create CLI command
  • When set, the version is automatically promoted to the first lifecycle stage if all source artifacts reside in repositories mapped to that stage; otherwise the version is left unassigned with a message explaining why
  • Adds the message key to the ordered output keys for version creation response

Test plan

  • Unit test: dedicated skip-unassigned flag test case added
  • Unit test: all flags test case updated to include --skip-unassigned

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from 931d57d to 6d86597 Compare June 11, 2026 11:49
@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from 6d86597 to 85862c3 Compare June 11, 2026 11:53
@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from 85862c3 to e095614 Compare June 11, 2026 11:54
@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from e095614 to b7bb980 Compare June 11, 2026 11:58
@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from b7bb980 to 4495de1 Compare June 11, 2026 12:22
@danielreJfrog

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from 4495de1 to 61e226f Compare June 11, 2026 12:27
@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Jun 11, 2026
@github-actions github-actions Bot removed the safe to test Approve running end-to-end tests on a pull request label Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Test Results

55 tests  +3   51 ✅ ±0   4m 46s ⏱️ - 2m 11s
 2 suites ±0    1 💤 ±0 
 1 files   ±0    3 ❌ +3 

For more details on these failures, see this check.

Results for commit c1a920d. ± Comparison against base commit 55a0ab5.

♻️ This comment has been updated with latest results.

Comment thread e2e/version_test.go Outdated
Comment on lines +218 to +223
var response struct {
ApplicationKey string `json:"application_key"`
Version string `json:"version"`
Status string `json:"status"`
CurrentStage string `json:"current_stage"`
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's very similar to the struct used in the next test case below. Consider merging them and use a shared struct in both test cases.

Comment thread e2e/version_test.go Outdated
require.NoError(t, err, "failed to parse CLI output as JSON: %s", output)
assert.Equal(t, appKey, response.ApplicationKey)
assert.Equal(t, version, response.Version)
assert.NotEmpty(t, response.Message, "A message should explain why auto-promotion did not occur")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To make sure the returned message is the error we expect, let's also validate the message content.

Comment thread e2e/version_test.go Outdated
t.Run("stays unassigned with message when artifact not in first stage", func(t *testing.T) {
version := utils.GenerateUniqueKey("skip-ua-fail")

baseURL := os.Getenv("JFROG_APPTRUST_CLI_TESTS_JFROG_URL")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of creating a repo using the REST API directly, refer to artifactory_utils.go where we already have functions that do that.
There's also a function for uploading artifacts.

@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from 61e226f to 1c59070 Compare June 14, 2026 07:39
@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from 1c59070 to d9559c4 Compare June 14, 2026 07:41
@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from d9559c4 to 2a90a3b Compare June 14, 2026 08:13
@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
@github-actions github-actions Bot removed the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from 2a90a3b to 062415a Compare June 14, 2026 08:30
@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
@github-actions github-actions Bot removed the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
Two subtests covering auto-promotion behavior:
- Success: source repo mapped to DEV -> version promoted to DEV
- Mismatch: source repo mapped only to PROD -> version stays unassigned
  with message explaining the repo_mismatch

Co-authored-by: Cursor <cursoragent@cursor.com>
@danielreJfrog danielreJfrog force-pushed the feature/APP-4230-skip-unassigned-flag branch from 062415a to 5dd584c Compare June 14, 2026 09:45
@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
@github-actions github-actions Bot removed the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
…gned tests

Co-authored-by: Cursor <cursoragent@cursor.com>
@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
@github-actions github-actions Bot removed the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
Use the same pre-indexed NPM package as TestPromoteVersion to avoid
timing issues with newly created repos in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
@github-actions github-actions Bot removed the safe to test Approve running end-to-end tests on a pull request label Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants