-
Notifications
You must be signed in to change notification settings - Fork 121
Preserve allow_duplicate_names field in the pipeline resource
#3274
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aa5268a
create an acceptance test for provisioning a pipeline with a duplicat…
anton-107 5f6c2cc
do not drop `allow_duplicate_names` field from the pipeline resource
anton-107 1aef527
fix unit test
anton-107 db0175a
make schema
anton-107 9205302
make codegen
anton-107 645f2bb
capture create-pipeline requests in the acceptance test
anton-107 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
11 changes: 11 additions & 0 deletions
11
acceptance/bundle/deploy/pipeline/allow-duplicate-names/databricks.yml.tmpl
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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| bundle: | ||
| name: acc-bundle-deploy-pipeline-duplicate-names-$UNIQUE_NAME | ||
|
|
||
| resources: | ||
| pipelines: | ||
| pipeline_one: | ||
| name: test-pipeline-same-name-$UNIQUE_NAME | ||
| allow_duplicate_names: true | ||
| libraries: | ||
| - file: | ||
| path: "./foo.py" |
5 changes: 5 additions & 0 deletions
5
acceptance/bundle/deploy/pipeline/allow-duplicate-names/out.test.toml
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Local = true | ||
| Cloud = true | ||
|
|
||
| [EnvMatrix] | ||
| DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"] |
54 changes: 54 additions & 0 deletions
54
acceptance/bundle/deploy/pipeline/allow-duplicate-names/output.txt
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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/acc-bundle-deploy-pipeline-duplicate-names-[UNIQUE_NAME]/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> print_requests | ||
| { | ||
| "body": { | ||
| "libraries": [ | ||
| { | ||
| "file": { | ||
| "path": "/some-script.py" | ||
| } | ||
| } | ||
| ], | ||
| "name": "test-pipeline-same-name-[UNIQUE_NAME]" | ||
| }, | ||
| "method": "POST", | ||
| "path": "/api/2.0/pipelines" | ||
| } | ||
| { | ||
| "body": { | ||
| "allow_duplicate_names": true, | ||
| "channel": "CURRENT", | ||
| "deployment": { | ||
| "kind": "BUNDLE", | ||
| "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/acc-bundle-deploy-pipeline-duplicate-names-[UNIQUE_NAME]/default/state/metadata.json" | ||
| }, | ||
| "edition": "ADVANCED", | ||
| "libraries": [ | ||
| { | ||
| "file": { | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/acc-bundle-deploy-pipeline-duplicate-names-[UNIQUE_NAME]/default/files/foo.py" | ||
| } | ||
| } | ||
| ], | ||
| "name": "test-pipeline-same-name-[UNIQUE_NAME]" | ||
| }, | ||
| "method": "POST", | ||
| "path": "/api/2.0/pipelines" | ||
| } | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete pipeline pipeline_one | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/acc-bundle-deploy-pipeline-duplicate-names-[UNIQUE_NAME]/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! | ||
|
|
||
| >>> [CLI] pipelines delete [UUID] |
10 changes: 10 additions & 0 deletions
10
acceptance/bundle/deploy/pipeline/allow-duplicate-names/pipeline.json.tmpl
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "name": "test-pipeline-same-name-$UNIQUE_NAME", | ||
| "libraries": [ | ||
| { | ||
| "file": { | ||
| "path": "/some-script.py" | ||
| } | ||
| } | ||
| ] | ||
| } |
22 changes: 22 additions & 0 deletions
22
acceptance/bundle/deploy/pipeline/allow-duplicate-names/script
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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| envsubst < databricks.yml.tmpl > databricks.yml | ||
| envsubst < pipeline.json.tmpl > pipeline.json | ||
| touch foo.py | ||
|
|
||
| cleanup() { | ||
| trace $CLI bundle destroy --auto-approve | ||
| trace $CLI pipelines delete ${PIPELINE_ID} | ||
| rm out.requests.txt | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| # Create a pre-existing pipeline: | ||
| PIPELINE_ID=$($CLI pipelines create --json @pipeline.json | jq -r .pipeline_id) | ||
| export PIPELINE_ID | ||
|
|
||
| # Deploy the bundle that has a pipeline with the same name: | ||
| trace $CLI bundle deploy | ||
|
|
||
| print_requests() { | ||
| jq --sort-keys 'select(.method != "GET" and (.path | contains("/pipelines")))' < out.requests.txt | ||
| } | ||
| trace print_requests | ||
3 changes: 3 additions & 0 deletions
3
acceptance/bundle/deploy/pipeline/allow-duplicate-names/test.toml
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Cloud = true | ||
| Ignore = ["foo.py","pipeline.json"] | ||
| RecordRequests = true |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
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.
Uh oh!
There was an error while loading. Please reload this page.