-
Notifications
You must be signed in to change notification settings - Fork 245
apps: route deploy to API mode on request flags and reject incompatible flags #6776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
atilafassina
wants to merge
3
commits into
main
Choose a base branch
from
deploy-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
dd7a186
apps: route deploy to API mode on request flags and reject incompatib…
atilafassina 7fa9510
acceptance: fix Windows path conversion in bundle-with-appname test
atilafassina 88eb391
apps: simplify deploy routing and scope Windows path conversion
atilafassina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,31 @@ | ||
| # Test: apps deploy with APP_NAME in a bundle directory | ||
| # Expected: Falls back to API deploy (ignores bundle, no validation) | ||
| # Test: apps deploy API routing in a bundle directory | ||
| # Expected: explicit names use direct deploy; incompatible flags fail | ||
| title "API deploy with an explicit app name" | ||
| trace $CLI apps deploy test-app --no-wait | ||
|
|
||
| title "API deploy with a workspace source path" | ||
| # Scope path conversion suppression to the CLI; Python helpers need it on Windows. | ||
| MSYS_NO_PATHCONV=1 trace $CLI apps deploy test-app --source-code-path /Workspace/apps/test-app --no-wait | ||
|
|
||
| title "API deploy with a Git source" | ||
| trace $CLI apps deploy test-app --git-branch release --no-wait | ||
|
|
||
| title "API and bundle deploy flags cannot be mixed" | ||
| MSYS_NO_PATHCONV=1 trace musterr $CLI apps deploy --source-code-path /Workspace/apps/test-app --force | ||
| trace musterr $CLI apps deploy --git-branch release --skip-validation | ||
| trace musterr $CLI apps deploy test-app --no-wait --target prod | ||
| trace musterr $CLI apps deploy --no-wait --var app_name=my-app | ||
|
|
||
| title "Every API deploy flag requires APP_NAME" | ||
| for flag in --no-wait --timeout=1m --source-code-path=/Workspace/apps/test-app --git-branch=release --git-tag=v1 --git-commit=abc --git-source-code-path=app --deployment-id=dep-123 --mode=SNAPSHOT --json='{}'; do | ||
| MSYS_NO_PATHCONV=1 trace musterr $CLI apps deploy "$flag" | ||
| done | ||
|
|
||
| title "Bundle flags cannot be used with APP_NAME" | ||
| trace musterr $CLI apps deploy test-app --force | ||
| trace musterr $CLI apps deploy test-app --target prod | ||
| trace musterr $CLI apps deploy test-app -t prod | ||
| trace musterr $CLI apps deploy test-app --environment prod | ||
| trace musterr $CLI apps deploy test-app --var app_name=my-app | ||
|
|
||
| trace print_requests.py //apps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| # Test: apps deploy without databricks.yml and no APP_NAME | ||
| # Expected: Error about missing argument | ||
| musterr $CLI apps deploy | ||
|
|
||
| title "API deploy flags require APP_NAME outside a bundle too" | ||
| MSYS_NO_PATHCONV=1 trace musterr $CLI apps deploy --source-code-path /Workspace/apps/test-app | ||
| trace musterr $CLI apps deploy --no-wait |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High-level comment: Can we make the logic a bit simpler?
What that removes: the requestFlagNames map, the control-flag special-casing, the double validateFlags call, and the app-name inference. What it keeps: the two genuinely useful errors ("can't combine bundle + API flags", "provide APP_NAME") — which are the part that satisfies the repo's "never silently ignore a flag" rule. Result: one mental model, no hardcoded flag lists, --target and the init-order trap fixed as a side effect.