-
Notifications
You must be signed in to change notification settings - Fork 52
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
Conversation
|
||
// 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" |
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.
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?
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.
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
.
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.
@shreyas-goenka does it include making sure that internal fields can't be used in interpolation? otherwise the behaviour is identical
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.
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.
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.
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" |
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.
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.
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)).
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)).
Changes
This PR:
Tests
Unit tests.