Skip to content

feat(cli): flag to allow option shape changes - #212

Open
bmckerry wants to merge 1 commit into
mainfrom
ben/validation-allow-shapechanged
Open

bmckerry wants to merge 1 commit into
mainfrom
ben/validation-allow-shapechanged

Conversation

@bmckerry

Copy link
Copy Markdown
Member

This PR adds a --allow-shape-change flag to the sentry-options-cli which, when set, will not raise a validation error if the shape of a repo's option changes.
Streaming team would like this feature as the Arroyo config blob (which will contain the configuration of all Arroyo producers/consumers we run) will be a single object option registered in the ops repo, meaning that any changes to the config blob schema would fail the schema validation workflow without this flag.

Comment on lines +190 to +191
#[arg(long, default_value_t = false, help = "allow changes to option shape")]
allow_shape_change: bool,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bare --allow-shape-change is rejected because the argument requires a value

With default_value_t = false, clap treats this bool as a value-taking argument, so the workflow’s bare --allow-shape-change fails to parse and cannot enable shape changes. Remove the explicit default or set the action to SetTrue.

Evidence
  • allow_shape_change is a bool with default_value_t = false; with an explicit default, clap derive uses a value-taking Set action rather than the value-less SetTrue action.
  • When the workflow input is enabled, validate-schema.yml passes only the bare --allow-shape-change, with no value, so clap rejects the command before schema validation runs.
  • The parsed value is passed to detect_changes, where it controls whether shape changes produce validation errors; the intended opt-in is therefore blocked.

Identified by Warden · code-review · WCK-32T

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.

1 participant