APP-4230 - Add --skip-unassigned flag to version-create command#87
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
| 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
25890b3 to
bd12ad0
Compare
bd12ad0 to
e37b366
Compare
b34b1b2 to
c1a920d
Compare
| return repoKey | ||
| } | ||
|
|
||
| func UploadTestArtifact(t *testing.T, repoKey, fileName string) string { |
There was a problem hiding this comment.
Why creating this function instead of just making uploadSimpleFileToArtifactory public?
…ifact Remove the thin wrapper and rename the private function directly, as suggested in code review. 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