Skip to content

APP-1673 - Add draft and sync flags to create application version com…#61

Merged
asafgabai merged 1 commit intojfrog:mainfrom
yurinovo18:feature/APP-1673-add-async-and-draft-params-to-create-application-version
Feb 9, 2026
Merged

APP-1673 - Add draft and sync flags to create application version com…#61
asafgabai merged 1 commit intojfrog:mainfrom
yurinovo18:feature/APP-1673-add-async-and-draft-params-to-create-application-version

Conversation

@yurinovo18
Copy link
Copy Markdown
Contributor

Summary

  • Add --draft and --sync flags to the version-create CLI command, allowing users to create application versions as drafts and control synchronous/asynchronous execution
  • Wire both flags through the full stack: CLI flags, request model, command handler, service interface, and HTTP layer

Changes

CLI Flags (apptrust/commands/flags.go)

  • Added DraftFlag constant and boolean flag definition with help text: "Create the application version as a draft."
  • Registered DraftFlag and existing SyncFlag for the VersionCreate command

Request Model (apptrust/model/create_app_version_request.go)

  • Added Draft bool field with json:"draft,omitempty" to CreateAppVersionRequest

Command Handler (apptrust/commands/version/create_app_version_cmd.go)

  • Added sync field to createAppVersionCommand struct
  • Read --draft flag into the request payload via buildRequestPayload
  • Read --sync flag and pass it through to the service layer

Service Layer (apptrust/service/versions/version_service.go)

  • Updated CreateAppVersion interface and implementation to accept a sync bool parameter
  • Changed hardcoded async: "false" to dynamic async: strconv.FormatBool(!sync)

Mock (apptrust/service/versions/mocks/version_service_mock.go)

  • Updated mock to match new CreateAppVersion(ctx, request, sync) signature

Unit Tests (create_app_version_cmd_test.go, version_service_test.go)

  • Updated all existing test payloads to include Draft: false
  • Added test case for --draft=true in the flags suite
  • Added sync field to service-level test cases with sync=true, sync=false, and draft scenarios

E2E Tests (e2e/version_test.go)

  • Added TestCreateVersion_Draft to verify creating a draft version via CLI and asserting DRAFT status

Test Plan

  • Unit tests updated for draft flag in command handler (FlagsSuite, SpecFileSuite)
  • Unit tests added for draft and sync in version service layer
  • E2E test added for draft version creation
  • All existing tests updated to match new service signature
  • Code compiles successfully (go build ./...)

@yurinovo18 yurinovo18 force-pushed the feature/APP-1673-add-async-and-draft-params-to-create-application-version branch from 86c9752 to 85c41a6 Compare February 8, 2026 10:32
@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Feb 8, 2026
@github-actions github-actions bot removed the safe to test Approve running end-to-end tests on a pull request label Feb 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 8, 2026

Test Results

18 tests  +2   17 ✅ +1   1m 26s ⏱️ +8s
 2 suites ±0    1 💤 +1 
 1 files   ±0    0 ❌ ±0 

Results for commit cebe0f5. ± Comparison against base commit 3657239.

♻️ This comment has been updated with latest results.

@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Feb 8, 2026
@github-actions github-actions bot removed the safe to test Approve running end-to-end tests on a pull request label Feb 8, 2026
@yurinovo18 yurinovo18 force-pushed the feature/APP-1673-add-async-and-draft-params-to-create-application-version branch from 85c41a6 to b828d27 Compare February 8, 2026 20:44
@yurinovo18 yurinovo18 force-pushed the feature/APP-1673-add-async-and-draft-params-to-create-application-version branch from b828d27 to 4b3e0fc Compare February 8, 2026 20:56
@yurinovo18 yurinovo18 force-pushed the feature/APP-1673-add-async-and-draft-params-to-create-application-version branch from 4b3e0fc to 91779b3 Compare February 8, 2026 20:59
}

func TestCreateVersion_Draft(t *testing.T) {
t.Skip("Skipping draft version creation test")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

waiting for artifactory version to be updated in the env (opened a task on it)

@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Feb 9, 2026
@github-actions github-actions bot removed the safe to test Approve running end-to-end tests on a pull request label Feb 9, 2026
@yurinovo18 yurinovo18 force-pushed the feature/APP-1673-add-async-and-draft-params-to-create-application-version branch from 91779b3 to c05cc64 Compare February 9, 2026 08:01
@yurinovo18 yurinovo18 force-pushed the feature/APP-1673-add-async-and-draft-params-to-create-application-version branch from c05cc64 to cebe0f5 Compare February 9, 2026 08:05
@asafgabai asafgabai added the safe to test Approve running end-to-end tests on a pull request label Feb 9, 2026
@github-actions github-actions bot removed the safe to test Approve running end-to-end tests on a pull request label Feb 9, 2026
@yurinovo18 yurinovo18 force-pushed the feature/APP-1673-add-async-and-draft-params-to-create-application-version branch from cebe0f5 to 6fa4956 Compare February 9, 2026 09:32
…mand

Co-authored-by: Cursor <cursoragent@cursor.com>
@yurinovo18 yurinovo18 force-pushed the feature/APP-1673-add-async-and-draft-params-to-create-application-version branch from 6fa4956 to c3b3a72 Compare February 9, 2026 09:36
@asafgabai asafgabai merged commit de92ba6 into jfrog:main Feb 9, 2026
3 of 4 checks passed
@yurinovo18 yurinovo18 deleted the feature/APP-1673-add-async-and-draft-params-to-create-application-version branch February 9, 2026 09:49
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