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

Rust: make the cli flags override automatic #17441

Merged
merged 8 commits into from
Sep 16, 2024
Merged

Conversation

redsun82
Copy link
Contributor

This makes the clap flags overlay over Config entirely derived via an attribute macro. Also, the --intputs-file option is replaced by a more standard and versatile @ parameter file mechanism.

This makes the clap flags overlay over `Config` entirely derived via an
attribute macro. Also, the `--intputs-file` option is replaced by a more
standard and versatile `@` parameter file mechanism.
@github-actions github-actions bot added the Rust Pull requests that update Rust code label Sep 11, 2024
Base automatically changed from rust-experiment to main September 11, 2024 15:31
@redsun82 redsun82 marked this pull request as ready for review September 11, 2024 15:57
@redsun82 redsun82 closed this Sep 11, 2024
@redsun82 redsun82 reopened this Sep 11, 2024
@redsun82 redsun82 marked this pull request as draft September 11, 2024 16:22
@github-actions github-actions bot added the Ruby label Sep 12, 2024
@redsun82 redsun82 marked this pull request as ready for review September 12, 2024 07:21
@redsun82 redsun82 requested review from a team as code owners September 12, 2024 07:21
@aibaars
Copy link
Contributor

aibaars commented Sep 13, 2024

This looks great. Have you checked that the CODEQL_EXTRACTOR_RUST_OPTION prefix overrides ``CODEQL_EXTRACTOR_RUST_? We may also want to addCODEQL_` as a lower priority prefix, so that things like `CODEQL_VERBOSITY` is picked up, but can be overridden by setting `CODEQL_EXTRACTOR_VERBOSITY`.

@redsun82
Copy link
Contributor Author

This looks great. Have you checked that the CODEQL_EXTRACTOR_RUST_OPTION prefix overrides ``CODEQL_EXTRACTOR_RUST_? We may also want to add CODEQL_` as a lower priority prefix, so that things like `CODEQL_VERBOSITY` is picked up, but can be overridden by setting `CODEQL_EXTRACTOR_VERBOSITY`.

Yes, Figment merge gives an ordering of source priority, which means that CODEQL_EXTRACTOR_RUST_OPTION_* has precedence over CODEQL_EXTRACTOR_RUST_* (and now over CODEQL_* as you suggested). And CLI flags (when passed) have priority over all else. The tricky part solved by the macro is to not have CLI flag defaults override env variables (which is what the skip_serializing_if are for).

aibaars
aibaars previously approved these changes Sep 13, 2024
Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

Looks good to me. Any idea why Python tests would be failing for this pull request?

@redsun82
Copy link
Contributor Author

Looks good to me. Any idea why Python tests would be failing for this pull request?

Discussing it on slack, but in the meantime a rerun worked 🤷

@redsun82 redsun82 merged commit e280e1e into main Sep 16, 2024
49 checks passed
@redsun82 redsun82 deleted the redsun82/rust-cli-flags branch September 16, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ruby Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants