rust-lang / rust-lang/reference

Support feature-gated tests during PR review

Open
#1,864 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Meta
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:

  1. Open reference PR with #![feature()] as needed in examples
  2. After review approval, wait for the stabilization to hit nightly
  3. Remove #![feature()] from the reference PR
  4. Merge the reference PR

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.