Skip to content

Improve Rust analysis PR check #3023

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Improve Rust analysis PR check #3023

wants to merge 5 commits into from

Conversation

redsun82
Copy link
Contributor

@redsun82 redsun82 commented Aug 11, 2025

Also run the rust checks on "milestone" CLI releases, to ensure we remain backward compatible with those versions. This was prompted by #2960 (review)

Running this on current main and then on that PR should improve our confidence we remain backward compatible.

It also turns out a probable ruamel.yaml update was changing a lot of generated workflows locally. It turns out the version was fixed in a couple of places but not in the sync.sh script I used. I've opted for writing the version exclusively in there and use it all over, which did mean updating the headers in all generated workflows to reflect the new instructions not specifying ruamel.yaml's version.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Also run the `rust` checks on "milestone" CLI releases, to ensure we
remain backward compatible with those versions. This was prompted by
#2960 (review)

Running this on current `main` and then on that PR should improve our
confidence we remain backward compatible.

It also turns out a probable `ruamel.yaml` update was changing a lot of
generated workflows, so I've:
* fixed the `ruamel.yaml` version to the latest in `sync.sh`
* added `yaml.width = 120` in `sync.py` to minimize (but not entirely
  remove) the number of changes
* checked in the workflows whose formatting was changed by the new
  `ruamel.yaml` version
@redsun82 redsun82 requested a review from a team as a code owner August 11, 2025 13:03
@Copilot Copilot AI review requested due to automatic review settings August 11, 2025 13:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the Rust analysis PR check by expanding test coverage to include milestone CLI releases and fixes workflow generation formatting issues. The changes ensure backward compatibility testing with historical CodeQL versions while stabilizing the workflow generation process.

Key changes:

  • Adds testing for milestone Rust support versions (v2.19.3 and v2.22.1) alongside existing versions
  • Fixes ruamel.yaml version and formatting configuration to prevent unwanted workflow changes
  • Updates generated workflows with improved formatting consistency

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pr-checks/sync.sh Pins ruamel.yaml to version 0.18.14 for consistent behavior
pr-checks/sync.py Adds yaml.width = 120 configuration for better line formatting
pr-checks/checks/rust.yml Expands test matrix to include milestone Rust support versions and removes deprecated environment variable
.github/workflows/__start-proxy.yml Reformats registry_secrets and conditional statements for better readability
.github/workflows/__rust.yml Adds new test matrix entries for milestone versions and removes deprecated environment variable
.github/workflows/__resolve-environment-action.yml Simplifies conditional statement formatting
.github/workflows/__packaging-inputs-js.yml Improves line wrapping for long packs parameter
.github/workflows/__multi-language-autodetect.yml Simplifies conditional expression formatting
Comments suppressed due to low confidence (1)

pr-checks/checks/rust.yml:5

  • The CodeQL versions stable-v2.19.3 and stable-v2.22.1 may not exist or be valid. Please verify these are actual released versions of CodeQL CLI that support Rust analysis.
  - stable-v2.19.3  # experimental rust support introduced, requires action to set `CODEQL_ENABLE_EXPERIMENTAL_FEATURES`
  - stable-v2.22.1  # first public preview version

Comment on lines 4 to 5
- stable-v2.19.3 # experimental rust support introduced, requires action to set `CODEQL_ENABLE_EXPERIMENTAL_FEATURES`
- stable-v2.22.1 # first public preview version
Copy link
Member

Choose a reason for hiding this comment

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

Assuming this is what primarily motived the the yaml.width change, I think you could just move the comments above the relevant list entries to avoid the problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, the yaml.width changes the output workflows, does not take the inputs.

What I noticed is that there were a lot of new line-breaks all over the generated workflows. I thought that if I entered the "right" width I would get no changes, but couldn't find any such value. In the end I settled for a reasonable value that limited changes to only a couple of workflows.

Copy link
Member

Choose a reason for hiding this comment

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

I think it would still be nicer to move the comments above the list elements. That's what we do elsewhere and it means you don't need such a wide code view / scrolling.

Do you have an example of what you mean by "a lot of new line-breaks all over the generated workflows"? Looking over a random sample didn't show anything odd.

Copy link
Member

Choose a reason for hiding this comment

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

Or is that a result of updating ruamel.yaml? I had assumed that the update was to have yaml.width, but maybe I made the wrong assumption.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, updating ruamel.yaml without specifying the width was breaking up lines more often than the previous version. In the end though I opted for using the version that was specified (elsewhere than sync.sh, which is what I was using), but also fix up that so that now the version is only written once. I will move the comments now.

Copy link
Member

Choose a reason for hiding this comment

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

Possibly a result of https://sourceforge.net/p/ruamel-yaml/tickets/529/. That's the only width-related change I saw in the changelog after 0.17.31

@redsun82 redsun82 requested a review from mbg August 11, 2025 15:01
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