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

Parse Rust toolchain file with a real script #266

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

lopopolo
Copy link
Member

@lopopolo lopopolo commented Sep 9, 2024

Migrate the code which parses the rust-toolchain.toml file from inline YAML in the nightly GitHub Actions workflow to a standalone Python script.

  • Converted the command previously defined in inline YAML with python shell to a dedicated Python script.
  • Added an Args dataclass and OutputFormat enum for structured argument parsing.
  • Implemented read_toolchain_version function with robust error handling for malformed TOML files.
  • Integrated GitHub Actions helpers for environment-specific logging and output formatting.
  • Added --format flag to support plaintext and GitHub Actions-specific outputs, improving flexibility.
  • Modified log_group helper to output only when running within GitHub Actions.
  • Ensured error messages are printed to stderr for better debugging visibility.

Migrate the code which parses the rust-toolchain.toml file from inline
YAML in the nightly GitHub Actions workflow to a standalone Python
script.

- Converted the command previously defined in inline YAML with `python`
  shell to a dedicated Python script.
- Added an `Args` dataclass and `OutputFormat` enum for structured
  argument parsing.
- Implemented `read_toolchain_version` function with robust error
  handling for malformed TOML files.
- Integrated GitHub Actions helpers for environment-specific logging and
  output formatting.
- Added `--format` flag to support plaintext and GitHub Actions-specific
  outputs, improving flexibility.
- Modified `log_group` helper to output only when running within GitHub
  Actions.
- Ensured error messages are printed to stderr for better debugging
  visibility.
@lopopolo lopopolo added A-build Area: CI build infrastructure. C-quality Category: Refactoring, cleanup, and quality improvements. labels Sep 9, 2024
@lopopolo lopopolo merged commit c7f5020 into trunk Sep 9, 2024
9 checks passed
@lopopolo lopopolo deleted the lopopolo/toml-parsing-to-script branch September 9, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build Area: CI build infrastructure. C-quality Category: Refactoring, cleanup, and quality improvements.
Development

Successfully merging this pull request may close these issues.

1 participant