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

feat(transform): Add ID Settings Field #181

Merged
merged 4 commits into from
Jun 10, 2024
Merged

feat(transform): Add ID Settings Field #181

merged 4 commits into from
Jun 10, 2024

Conversation

jshlbrd
Copy link
Contributor

@jshlbrd jshlbrd commented Jun 10, 2024

Description

  • Adds an ID field to all transform settings and updates error messages to use auto-generated IDs

Motivation and Context

Identifying the location of errors in large config files is a challenge due to the high reuse of transform functions and existing error message format (transform: foo: err goes here), but this is easier when there is a way to uniquely identify each transform.

This PR makes these types of error message possible (where foo is the transform function):

  • transform foo: err goes here (this happens if the transform is not configurable or if the ID field value is missing)
  • transform my-unique-foo: err goes here (this is an ID configured by the user)
  • transform 5f4ae672-6b9cc21d: err goes here (this is an ID auto-generated by the app)

Users who do nothing will start to see auto-gen IDs in places where they used to see transform function names. In the future a pseudo-random default ID would be preferred, but Jsonnet doesn't have any functions to support that.

How Has This Been Tested?

Tested locally (this can be seen by building any existing configs).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@jshlbrd jshlbrd marked this pull request as ready for review June 10, 2024 15:50
@jshlbrd jshlbrd requested a review from a team as a code owner June 10, 2024 15:50
@jshlbrd jshlbrd merged commit ab1a4ff into main Jun 10, 2024
4 checks passed
@jshlbrd jshlbrd deleted the jshlbrd/feat/tf-id branch June 10, 2024 16:04
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

1 participant