APP-4230 - Add --skip-unassigned flag to version-create command#87
APP-4230 - Add --skip-unassigned flag to version-create command#87danielreJfrog wants to merge 4 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
All contributors have signed the CLA ✍️ ✅ |
931d57d to
6d86597
Compare
6d86597 to
85862c3
Compare
85862c3 to
e095614
Compare
e095614 to
b7bb980
Compare
b7bb980 to
4495de1
Compare
|
I have read the CLA Document and I hereby sign the CLA |
4495de1 to
61e226f
Compare
Test Results55 tests +3 51 ✅ ±0 4m 46s ⏱️ - 2m 11s 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. |
| var response struct { | ||
| ApplicationKey string `json:"application_key"` | ||
| Version string `json:"version"` | ||
| Status string `json:"status"` | ||
| CurrentStage string `json:"current_stage"` | ||
| } |
There was a problem hiding this comment.
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.
| 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") |
There was a problem hiding this comment.
To make sure the returned message is the error we expect, let's also validate the message content.
| 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") |
There was a problem hiding this comment.
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.
61e226f to
1c59070
Compare
1c59070 to
d9559c4
Compare
d9559c4 to
2a90a3b
Compare
2a90a3b to
062415a
Compare
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>
062415a to
5dd584c
Compare
…gned tests Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Summary
--skip-unassignedboolean flag to theversion-createCLI commandmessagekey to the ordered output keys for version creation responseTest plan
skip-unassigned flagtest case addedall flagstest case updated to include--skip-unassignedMade with Cursor