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

Add internal tag for bundle fields to be skipped from schema #636

Merged
merged 5 commits into from
Aug 10, 2023

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Aug 4, 2023

Changes

This PR:

  1. Introduces the "internal" tag to bundle configs that should not be visible to customers.
  2. Annotates "metadata_service_url" as an internal field.

Tests

Unit tests.

@shreyas-goenka shreyas-goenka removed the request for review from lennartkats-db August 4, 2023 12:42
@shreyas-goenka shreyas-goenka changed the title Add preview tag for fields that are in development Add internal tag for bundle fields to be skipped from schema Aug 7, 2023

// Annotation for internal bundle fields that should not be exposed to customers.
// Fields can be tagged as "internal" to remove them from the generated schema.
const internalTag = "internal"
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't practically readonly and internal are the same fields? Both of them sounds like private fields which are only used by internals of CLI, what the difference between 2 of them?

Copy link
Contributor Author

@shreyas-goenka shreyas-goenka Aug 7, 2023

Choose a reason for hiding this comment

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

The actual functionality is the same today.

The intentions conveyed by the annotations are different. Readonly fields can be used by customers only during interpolation / reading. These fields will be documented in our public documentation.

The internal fields are only meant to be used by us ie internal users. Or they are not ready to be used by customers yet.

Down the line, we could have different functionality for these fields. For example, if we have autocomplete for field interpolation, then we would like to suggest readonly fields to the user, but not internal.

Copy link
Contributor

Choose a reason for hiding this comment

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

@shreyas-goenka does it include making sure that internal fields can't be used in interpolation? otherwise the behaviour is identical

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's fine if we allow interpolation for internal fields. The problem this solves is to avoid customers seeing these fields, and then wondering what internal fields do. Yes, the behavior is identical, but the benefit we get is that the intention behind why the field is hidden is clear.

Copy link
Contributor

Choose a reason for hiding this comment

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

As we implement customer unmarshaling/config loading, we can use the readonly tag as well to prevent users from setting it. +1 that that the different intent warrants a different tag.


// Annotation for internal bundle fields that should not be exposed to customers.
// Fields can be tagged as "internal" to remove them from the generated schema.
const internalTag = "internal"
Copy link
Contributor

Choose a reason for hiding this comment

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

As we implement customer unmarshaling/config loading, we can use the readonly tag as well to prevent users from setting it. +1 that that the different intent warrants a different tag.

@shreyas-goenka shreyas-goenka added this pull request to the merge queue Aug 10, 2023
Merged via the queue into main with commit 6b615cc Aug 10, 2023
4 checks passed
@shreyas-goenka shreyas-goenka deleted the add-preview-tag branch August 10, 2023 10:11
pietern added a commit that referenced this pull request Aug 16, 2023
CLI:
 * Always resolve .databrickscfg file ([#659](#659)).

Bundles:
 * Add internal tag for bundle fields to be skipped from schema ([#636](#636)).
 * Log the bundle root configuration file if applicable ([#657](#657)).
 * Execute paths without the .tmpl extension as templates ([#654](#654)).
 * Enable environment overrides for job clusters ([#658](#658)).
 * Merge artifacts and resources block with overrides enabled ([#660](#660)).
 * Locked terraform binary version to <= 1.5.5 ([#666](#666)).
 * Return better error messages for invalid JSON schema types in templates ([#661](#661)).
 * Use custom prompter for bundle template inputs ([#663](#663)).
 * Add map and pair helper functions for bundle templates ([#665](#665)).
 * Correct name for force acquire deploy flag ([#656](#656)).
 * Confirm that override with a zero value doesn't work ([#669](#669)).

Internal:
 * Consolidate functions in libs/git ([#652](#652)).
 * Upgraded Go version to 1.21 ([#664](#664)).
@pietern pietern mentioned this pull request Aug 16, 2023
github-merge-queue bot pushed a commit that referenced this pull request Aug 16, 2023
CLI:
* Always resolve .databrickscfg file
([#659](#659)).

Bundles:
* Add internal tag for bundle fields to be skipped from schema
([#636](#636)).
* Log the bundle root configuration file if applicable
([#657](#657)).
* Execute paths without the .tmpl extension as templates
([#654](#654)).
* Enable environment overrides for job clusters
([#658](#658)).
* Merge artifacts and resources block with overrides enabled
([#660](#660)).
* Locked terraform binary version to <= 1.5.5
([#666](#666)).
* Return better error messages for invalid JSON schema types in
templates ([#661](#661)).
* Use custom prompter for bundle template inputs
([#663](#663)).
* Add map and pair helper functions for bundle templates
([#665](#665)).
* Correct name for force acquire deploy flag
([#656](#656)).
* Confirm that override with a zero value doesn't work
([#669](#669)).

Internal:
* Consolidate functions in libs/git
([#652](#652)).
* Upgraded Go version to 1.21
([#664](#664)).
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.

3 participants