Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 26 additions & 30 deletions .ci/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ This directory contains scripts for measuring and analyzing CI performance metri

### measure-ci-baseline.sh

Collects workflow run data from GitHub Actions and calculates baseline metrics.
Collects workflow run data from GitHub Actions and calculates baseline metrics via
`cargo xtask ci-baseline` (the underlying implementation), with this wrapper
script retained as a convenience entrypoint.

**Features:**
- Fetches workflow runs from specified branch
Expand All @@ -19,41 +21,49 @@ Collects workflow run data from GitHub Actions and calculates baseline metrics.

**Prerequisites:**
- [GitHub CLI (gh)](https://cli.github.com/) - installed and authenticated
- [jq](https://stedolan.github.io/jq/) - for JSON processing
- Rust toolchain - for the workspace xtask binary
- `cargo` - comes with Rust, used to run `cargo xtask`

**Installation of prerequisites:**

```bash
# macOS
brew install gh jq
brew install gh

# Ubuntu/Debian
sudo apt install gh jq
sudo apt install gh

# Then authenticate
# Authenticate once for CLI queries
gh auth login
```
Comment on lines 22 to 38
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Document how to install Rust now that it is required.

The prerequisites now include Rust/cargo, but the installation section still only shows how to install gh. Add a rustup link or a short Rust install step so this page stays runnable end to end for first-time contributors.

🧰 Tools
🪛 LanguageTool

[typographical] ~23-~23: To join two clauses or introduce examples, consider using an em dash.
Context: ...itHub CLI (gh)](https://cli.github.com/) - installed and authenticated - Rust toolc...

(DASH_RULE)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.ci/scripts/README.md around lines 22 - 38, The "Prerequisites" and
"Installation of prerequisites" sections currently list "Rust toolchain - for
the workspace xtask binary" and "`cargo`" but provide no install steps; update
those sections to add a short Rust install instruction and link to rustup (e.g.,
mention "Install Rust via rustup: https://rustup.rs" and include
platform-specific commands such as running the rustup installer and setting the
default toolchain), and note that `cargo` is installed with rustup so first-time
contributors can run `cargo xtask` without extra setup — update the text near
the "Rust toolchain - for the workspace xtask binary" and the "Installation of
prerequisites" block to reflect this.


**Usage:**
**Usage (canonical):**

```bash
# Basic usage (analyzes master branch, last 30 days)
./measure-ci-baseline.sh
cargo xtask ci-baseline

# Analyze a different branch
./measure-ci-baseline.sh --branch main
cargo xtask ci-baseline --branch main

# Analyze last 7 days only
./measure-ci-baseline.sh --days 7
cargo xtask ci-baseline --days 7

# Fetch more runs for higher accuracy
./measure-ci-baseline.sh --limit 500
cargo xtask ci-baseline --limit 500

# Custom output directory
./measure-ci-baseline.sh --output ./reports
cargo xtask ci-baseline --output ./reports

# All options
./measure-ci-baseline.sh --branch master --days 30 --limit 200 --output .ci
cargo xtask ci-baseline --branch master --days 30 --limit 200 --output .ci
```

**Usage (wrapper shim):**

```bash
# Run the shim script (delegates to `cargo xtask ci-baseline`)
./measure-ci-baseline.sh
```
Comment on lines +62 to 67
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Make the shim invocation explicit from the repo root.

./measure-ci-baseline.sh only works after cd .ci/scripts, while the surrounding examples read like repo-root commands. Use ./.ci/scripts/measure-ci-baseline.sh or state the required working directory explicitly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.ci/scripts/README.md around lines 62 - 67, Update the README usage example
so the shim is invoked explicitly from the repository root: replace the
ambiguous "./measure-ci-baseline.sh" with "./.ci/scripts/measure-ci-baseline.sh"
(or alternatively add a short note stating "run from .ci/scripts" before the
example). Ensure the example in the "Usage (wrapper shim)" section shows the
explicit path "./.ci/scripts/measure-ci-baseline.sh" so readers can run the
command from the repo root.


**Options:**
Expand Down Expand Up @@ -111,10 +121,10 @@ gh auth login

```bash
# Run before making CI changes
./measure-ci-baseline.sh --output .ci/before
cargo xtask ci-baseline --output .ci/before

# After changes
./measure-ci-baseline.sh --output .ci/after
cargo xtask ci-baseline --output .ci/after

# Compare the JSON files to measure improvement
```
Expand All @@ -130,8 +140,8 @@ gh auth login

```bash
# Compare feature branch to main
./measure-ci-baseline.sh --branch main --output .ci/main-baseline
./measure-ci-baseline.sh --branch feature-x --output .ci/feature-baseline
cargo xtask ci-baseline --branch main --output .ci/main-baseline
cargo xtask ci-baseline --branch feature-x --output .ci/feature-baseline
```

## Interpreting Results
Expand Down Expand Up @@ -168,20 +178,6 @@ gh auth login
# Follow the prompts to authenticate
```

### "jq: command not found"

Install jq for your platform:
```bash
# macOS
brew install jq

# Ubuntu/Debian
sudo apt install jq

# RHEL/CentOS
sudo yum install jq
```

### No workflow runs found

- Verify the branch name exists
Expand Down
Loading