FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Rust: remove shipped feature flag by redsun82 · Pull Request #2960 · github/codeql-action · GitHub

Rust: remove shipped feature flag - #2960

Merged
redsun82 merged 14 commits into
mainfrom
redsun82/rust
Aug 12, 2025
Merged

Rust: remove shipped feature flag#2960
redsun82 merged 14 commits into
mainfrom
redsun82/rust

Conversation

redsun82 commented Jul 3, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

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.

redsun82 marked this pull request as ready for review July 4, 2025 14:41
Copilot AI review requested due to automatic review settings July 4, 2025 14:41
redsun82 requested a review from a team as a code owner July 4, 2025 14:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread src/init-action.ts Outdated
Comment thread src/init-action.ts Outdated
mbg previously approved these changes Aug 5, 2025

mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this is OK to merge if you are happy to break Rust analyses for those older versions of the CLI. See my thoughts in the comment I added. There's also one typo in the comment.

Comment thread src/init-action.ts Outdated
Comment thread src/init-action.ts Outdated
Comment on lines +637 to +638
// this point, if they want rust support they should chose a version which supports it
// publicly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This might break Rust analysis for users who have pinned v3 (or similar) of the Action as well as a CodeQL CLI >= 2.19.3 && < 2.22.1 and who used CODEQL_ENABLE_EXPERIMENTAL_FEATURES. I agree that it's not unreasonable to ask users to upgrade to a newer CLI version in that case, but perhaps we should give them some warning first before breaking their workflows over night when the next Action release happens? That said, it's not clear to me that a warning in the output would necessarily be noticed. I don't know if we have any data to know how many people would be affected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

in that situation (version 2.19.3..2.22.1 and CODEQL_ENABLE_EXPERIMENTAL_FEATURES=true) codeql resolve languages does give rust, which means that (await codeql.resolveLanguages()).rust is not undefined. The only change then is that users lose the Experimental Rust analysis enabled log line, but no functional change happens.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

uh, actually, now I see that that log line was dead code anyway!

Clarify comments regarding rust support in codeql versions
redsun82 requested a review from mbg August 6, 2025 04:36
mbg previously approved these changes Aug 6, 2025

Copy link
Copy Markdown
Contributor

#3014 should ease the merge conflict in compiled code pain here.

Copy link
Copy Markdown
Contributor

(Though we'll have to do the merge first, to get the updated workflow in the branch)

redsun82 commented Aug 8, 2025

Copy link
Copy Markdown
Contributor Author

I've noticed that #2914 duplicated the rust specific bock before initConfig. That got me thinking, that actually since the feature flag has been rolled out, the effective version from which we must support Rust to be backward compatible is 2.19.3, which means that we must set the env variable in versions between 2.19.3 and 2.22.1. I've changed the code accordingly in the if block before initConfig, and removed the later if block which becomes unneeded.

redsun82 requested a review from mbg August 8, 2025 10:14

mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

As I wrote elsewhere, I am a bit concerned that we have gone through a few iterations of the logic here, approved it, and then changed our minds about how this should work.

That signals to me that we:

  • Don't necessarily know what this should do and, while these changes make sense in isolation, we could still be missing something. It might be good to outline internally in an issue what different scenarios we need to consider for this (e.g. permutations of: Advanced/Default Setup, GH-hosted runner vs self-hosted, different CLI versions, Rust with and without other languages, ...). I think having a matrix of scenarios to consider like that might be more broadly useful a well.
  • Don't have any test coverage that would tell us if the logic here doesn't do the right thing. I believe that we can pin specific CLI versions in the PR checks. So perhaps it would make sense to have a PR check that tests this with different permutations of relevant CLI versions (< 2.19.3, >= 2.19.3 && < 2.22.1, and >= 2.22.1)? Or perhaps a combination of unit tests (to check the general logic of this) and PR check (to check that the analysis for Rust works when it should).

Comment thread src/init-action.ts Outdated
// Set CODEQL_ENABLE_EXPERIMENTAL_FEATURES for Rust. We need to set this environment
// variable before initializing the config, otherwise Rust analysis will not be
// enabled.
// Set CODEQL_ENABLE_EXPERIMENTAL_FEATURES for Rust if between 2.19.3 and 2.22.1 (excluded)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is slightly ambiguous: does the "(excluded)" refer to both 2.19.3 and 2.22.1 or only the latter?

Comment thread src/init-action.ts Outdated
Comment on lines +362 to +363
// We need to set this environment variable before initializing the config, otherwise Rust
// analysis will not be enabled.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could you add a small bit to this comment to remind us why it will not be enabled otherwise? I.e. is the logic for that elsewhere in the Action, the CLI, the extractor, ...?

Comment thread src/init-action.ts Outdated
// Set CODEQL_ENABLE_EXPERIMENTAL_FEATURES for Rust if between 2.19.3 and 2.22.1 (excluded)
// We need to set this environment variable before initializing the config, otherwise Rust
// analysis will not be enabled.
// Initially this was driven by a feature flag which has been rolled out already.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Minor: This can probably be removed. I don't see much value in documenting what used to be the case here.

redsun82 added a commit that referenced this pull request 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, 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 mentioned this pull request Aug 11, 2025
3 tasks
Comment thread src/environment.ts Outdated
/**
* Whether to enable experimental extractors for CodeQL.
*/
EXPERIMENTAL_FEATURES = "CODEQL_ACTION_EXPERIMENTAL_FEATURES",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

ha, well, I should have double checked what copilot was writing here. Good thing someone suggested to put in more testing 😉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

(this was causing a failure in the 2.19.3 case, which is now fixed)

redsun82 requested a review from mbg August 12, 2025 10:33
mbg previously approved these changes Aug 12, 2025

mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM with the extra test cases added in #3023. One minor point, but it's not blocking this PR.

Comment thread src/init-action.ts Outdated
logger.info("Experimental rust analysis enabled");
if (semver.lt(actualVer, publicPreview)) {
core.exportVariable(EnvVar.EXPERIMENTAL_FEATURES, "true");
logger.info("Experimental rust analysis enabled");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Minor: Should "rust" be capitalised here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Makes sense

redsun82 requested a review from mbg August 12, 2025 11:34
redsun82 enabled auto-merge August 12, 2025 11:39
redsun82 merged commit 60aa58a into main Aug 12, 2025
284 checks passed
redsun82 deleted the redsun82/rust branch August 12, 2025 11:47
github-actions Bot mentioned this pull request Aug 18, 2025
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL