Skip to content
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

Remove resolution of repo names against the Databricks Github account #940

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Oct 31, 2023

Changes

This functionality is not exercised (and will not be anytime soon). Instead we use a map to have first party aliases for supported templates.

var aliasedTemplates = map[string]string{

Tests

Existing tests and manually, bundle init still works.

Copy link
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

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

When you say it isn't exercised, how can you be sure of that? This is a public method, right? Or at least it isn't exercised in any part of the CLI? It seems like bundle init does use this now?

Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

The only repository with a bundle template is mlops-stacks and for that one we have a direct mapping (i.e. turn that string into the fully qualified URL). Because the logic being removed here a always resolves to the databricks organization, and we have no other repositories with bundle templates, we can safely remove it.

@shreyas-goenka
Copy link
Contributor Author

shreyas-goenka commented Nov 1, 2023

More broadly, we have a check that short circuits any template paths that were not full git URLs. So even if there are multiple bundle templates in the wild, this code is not being exercised

cli/cmd/bundle/init.go

Lines 90 to 97 in 1e46b9f

if !isRepoUrl(templatePath) {
if templateDir != "" {
return errors.New("--template-dir can only be used with a Git repository URL")
}
// skip downloading the repo because input arg is not a URL. We assume
// it's a path on the local file system in that case
return template.Materialize(ctx, configFile, templatePath, outputDir)
}

@shreyas-goenka shreyas-goenka added this pull request to the merge queue Nov 1, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 1, 2023
@shreyas-goenka shreyas-goenka added this pull request to the merge queue Nov 1, 2023
Merged via the queue into main with commit d70d744 Nov 1, 2023
4 checks passed
@shreyas-goenka shreyas-goenka deleted the remove-dead-code branch November 1, 2023 13:08
@shreyas-goenka shreyas-goenka mentioned this pull request Nov 2, 2023
shreyas-goenka added a commit that referenced this pull request Nov 2, 2023
CLI:
 * Fix URL for bundle template documentation ([#903](#903)).
 * Library to convert config.Value to Go struct ([#904](#904)).
 * Loading an empty file yields a nil ([#906](#906)).
 * Fix pattern validation for input properties ([#912](#912)).
 * Simplified code generation logic for handling path and request body parameters and JSON input ([#905](#905)).
 * Add support for multiline descriptions when using template enums ([#916](#916)).
 * Move bundle configuration filename code ([#917](#917)).
 * Add configuration normalization code ([#915](#915)).
 * Add welcome message to bundle templates ([#907](#907)).
 * Consolidate bundle configuration loader function ([#918](#918)).
 * Upload terraform state even if apply fails ([#923](#923)).
 * Use UserName instead of Id to check if identity used is a service principal ([#924](#924)).
 * `make snapshot` to build file in `.databricks/databricks` ([#927](#927)).
 * Persist deployment metadata in WSFS ([#845](#845)).
 * Run make fmt from fmt job ([#929](#929)).
 * Add override to support YAML inputs for apps ([#921](#921)).
 * Add GitHub issue templates ([#925](#925)).
 * Remove resolution of repo names against the Databricks Github account ([#940](#940)).
 * Fix metadata computation for empty bundle ([#939](#939)).

Bundles:
 * **FILL THIS IN MANUALLY BY MOVING RELEVANT ITEMS FROM ABOVE LIST**

Internal:
 * **FILL THIS IN MANUALLY BY MOVING RELEVANT ITEMS FROM ABOVE LIST**

API Changes:
 * Added `databricks apps` command group.
 * Added `databricks account network-policy` command group.

OpenAPI commit 5903bb39137fd76ac384b2044e425f9c56840e00 (2023-10-23)
Dependency updates:
 * Bump google.golang.org/grpc from 1.58.2 to 1.58.3 ([#920](#920)).
 * Bump the Go SDK in the CLI ([#919](#919)).
 * Bump Terraform provider to v1.29.0 ([#926](#926)).
 * Bump github.com/google/uuid from 1.3.1 to 1.4.0 ([#932](#932)).
github-merge-queue bot pushed a commit that referenced this pull request Nov 2, 2023
CLI:
* Added GitHub issue templates for CLI and DABs issues
([#925](#925)).
* Added override to support YAML inputs for apps
([#921](#921)).
* Simplified code generation logic for handling path and request body
parameters and JSON input
([#905](#905)).


Bundles:
* Fixed URL for bundle template documentation in init command help docs
([#903](#903)).
* Fixed pattern validation for input parameters in a bundle template
([#912](#912)).
* Fixed multiline description rendering for enum input parameters in
bundle templates ([#916](#916)).
* Changed production mode check for whether identity used is a service
principal to use UserName
([#924](#924)).
* Changed bundle deploy to upload partial terraform state even if
deployment fails ([#923](#923)).
* Added support for welcome messages to bundle templates
([#907](#907)).
* Added support for uploading bundle deployment metadata to WSFS
([#845](#845)).


Internal:
* Loading an empty yaml file yields a nil
([#906](#906)).
* Library to convert config.Value to Go struct
([#904](#904)).
* Remove default resolution of repo names against the Databricks Github
account([#940](#940)).
* Run make fmt from fmt job
([#929](#929)).
* `make snapshot` to build file in `.databricks/databricks`
([#927](#927)).
* Add configuration normalization code
([#915](#915)).

API Changes:
 * Added `databricks apps` command group.
 * Added `databricks account network-policy` command group.

Dependency updates:
* Bump Terraform provider from v1.28.0 to v1.29.0
([#926](#926)).
* Bump the Go SDK in the CLI from v0.23 to v0.24
([#919](#919)).
* Bump google.golang.org/grpc from 1.58.2 to 1.58.3
([#920](#920)).
* Bump github.com/google/uuid from 1.3.1 to 1.4.0
([#932](#932)).

OpenAPI commit 5903bb39137fd76ac384b2044e425f9c56840e00 (2023-10-23)
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.

None yet

3 participants