apps: add git flags to create/update/deploy - #6182
Conversation
The apps create/update/deploy commands accept a git repository and git deployment source, but the code generator emits these nested objects as `// TODO: complex arg` so they were only reachable via --json. Add ergonomic top-level flags for the GA git fields: - create/update: --git-url, --git-provider (App.GitRepository) - deploy: --git-branch, --git-tag, --git-commit, --git-source-code-path (AppDeployment.GitSource) The nested SDK pointers stay nil unless a git flag is set, so non-git requests are unchanged. Validation matches the API contract: url and provider must be set together; branch/tag/commit are mutually exclusive; source-code-path requires a ref. Co-authored-by: Isaac
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
golangci-lint's perfsprint linter flags fmt.Errorf with a static string and no format verbs. Both git flag validation errors are constant strings, so switch them to errors.New. Co-authored-by: Isaac
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
atilafassina
left a comment
There was a problem hiding this comment.
just one little extra-check pending, let me know your thoughts
| if !refSet && !pathSet { | ||
| return nil | ||
| } | ||
| // A source-code path without a reference has no repository to resolve | ||
| // against — the reference is what selects the code to deploy. | ||
| if pathSet && !refSet { | ||
| return errors.New("--git-source-code-path requires one of --git-branch, --git-tag, or --git-commit") | ||
| } |
There was a problem hiding this comment.
We probably should also reject --source-code-path before assigning git source, these params are mutually exclusive.
Otherwise the request can contain both workspace and Git source modes, which existing bundle validation treats as mutually exclusive.
|
Superseding this with #6371, opened as a same-repo (non-fork) branch so CI can run. It includes the same change plus @atilafassina's review feedback (rejecting the workspace |
The apps create/update/deploy commands accept a git repository and git deployment source, but the code generator emits these nested objects as
// TODO: complex argso they were only reachable via --json. Add ergonomic top-level flags for the GA git fields:The nested SDK pointers stay nil unless a git flag is set, so non-git requests are unchanged. Validation matches the API contract: url and provider must be set together; branch/tag/commit are mutually exclusive; source-code-path requires a ref.
Co-authored-by: Isaac
Changes
Why
Tests