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

Allow using variables in enum fields #2199

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

ilyakuz-db
Copy link
Contributor

Changes

It is possible to pass variable to enum fields but json-schema doesn't accept it. This PR adds oneOf for enum types that includes ${var-*} pattern

Tests

Manually checked in VSCode

@ilyakuz-db ilyakuz-db changed the title feat (json-schema): Allow using variables in enum fields Allow using variables in enum fields Jan 21, 2025
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.

Nice!

Could you add a testcase for this in bundle/internal/schema/testdata/pass as well? The example configuration in that directory is verified to pass our JSON schema, so we'd catch it if this ever regresses.

@ilyakuz-db ilyakuz-db added this pull request to the merge queue Jan 22, 2025
Merged via the queue into main with commit c224be5 Jan 22, 2025
9 checks passed
@ilyakuz-db ilyakuz-db deleted the feat/json-schema-variables-in-enum branch January 22, 2025 10:36
andrewnester added a commit that referenced this pull request Jan 23, 2025
CLI:
 * Added text output templates for apps list and list-deployments ([#2175](#2175)).
 * Fix duplicate "apps" entry in help output ([#2191](#2191)).

Bundles:
 * Allow yaml-anchors in schema ([#2200](#2200)).
 * Show an error when non-yaml files used in include section ([#2201](#2201)).
 * Set WorktreeRoot to sync root outside git repo ([#2197](#2197)).
 * fix: Detailed message for using source-linked deployment with file_path specified ([#2119](#2119)).
 * Allow using variables in enum fields ([#2199](#2199)).
 * Add experimental-jobs-as-code template ([#2177](#2177)).
 * Reading variables from file ([#2171](#2171)).
 * Fixed an apps message order and added output test ([#2174](#2174)).
 * Default to forward slash-separated paths for path translation ([#2145](#2145)).
 * Include a materialized copy of built-in templates ([#2146](#2146)).
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2025
CLI:
* Added text output templates for apps list and list-deployments
([#2175](#2175)).
* Fix duplicate "apps" entry in help output
([#2191](#2191)).

Bundles:
* Allow yaml-anchors in schema
([#2200](#2200)).
* Show an error when non-yaml files used in include section
([#2201](#2201)).
* Set WorktreeRoot to sync root outside git repo
([#2197](#2197)).
* fix: Detailed message for using source-linked deployment with
file_path specified
([#2119](#2119)).
* Allow using variables in enum fields
([#2199](#2199)).
* Add experimental-jobs-as-code template
([#2177](#2177)).
* Reading variables from file
([#2171](#2171)).
* Fixed an apps message order and added output test
([#2174](#2174)).
* Default to forward slash-separated paths for path translation
([#2145](#2145)).
* Include a materialized copy of built-in templates
([#2146](#2146)).
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.

2 participants