rust-lang / rust-lang/reference
Support feature-gated tests during PR review
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- PR merge metrics
- PR metrics pending
Description
@traviscross and I were discussing how to improve the workflow with PRs that have examples for new features that are being stabilized, but have not yet stabilized in nightly.
The problem is that the CI checks forbid #![feature(...)], because we want to ensure that the reference only documents stable features. But without #![feature()] the examples will fail because it is missing.
One idea we had to partially smooth over this is to allow #![feature(...)] in the pull_request CI trigger, but emit a warning which should show up fairly clearly in the "files" view. Then, in the merge_group CI trigger, it can make that an error to ensure we don't accidentally merge it.
So the workflow would be roughly:
- Open reference PR with
#![feature()]as needed in examples - After review approval, wait for the stabilization to hit nightly
- Remove
#![feature()]from the reference PR - Merge the reference PR
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the GitHub Actions workflow checks for #![feature(...)] and the pull_request and merge_group triggers. Verify that pull-request runs warn when feature gates are present, while merge-group runs reject them; the workflow should support gated examples during review without allowing them to merge.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, rust
- Domain
- ci-cd, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100