Skip to content

Commit 1b6249d

Browse files
authored
Merge pull request #199 from acgetchell/ci/198-dependabot-auto-merge
ci(dependabot): gate auto-merge on CodeRabbit approval
2 parents 03a6dc7 + 2a37961 commit 1b6249d

11 files changed

Lines changed: 376 additions & 265 deletions

File tree

.coderabbit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ reviews:
99
# The review-progress path creates a second GitHub check run for the same review.
1010
review_progress: false
1111
commit_status: true
12-
fail_commit_status: false
12+
fail_commit_status: true
1313
tools:
1414
github-checks:
1515
enabled: true

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ updates:
1111
labels:
1212
- "dependencies"
1313
- "github-actions"
14+
groups:
15+
github-actions:
16+
patterns:
17+
- "*"
1418

1519
# Enable version updates for Rust dependencies
1620
- package-ecosystem: "cargo"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Dependabot review and auto-merge
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- ready_for_review
9+
- synchronize
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
jobs:
20+
review-and-enable-auto-merge:
21+
if: >-
22+
github.event.pull_request.user.login == 'dependabot[bot]' &&
23+
github.repository == 'acgetchell/la-stack'
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Request CodeRabbit review
27+
env:
28+
# Dependabot-triggered workflows receive Dependabot secrets.
29+
GH_TOKEN: ${{ secrets.CODERABBIT_REVIEW_TOKEN }}
30+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
31+
PR_NUMBER: ${{ github.event.pull_request.number }}
32+
REPOSITORY: ${{ github.repository }}
33+
run: |
34+
if [[ -z "$GH_TOKEN" ]]; then
35+
echo "::error::CODERABBIT_REVIEW_TOKEN is not configured."
36+
exit 1
37+
fi
38+
39+
token_owner="$(gh api user --jq '.login')"
40+
if [[ "$token_owner" != "acgetchell" ]]; then
41+
echo "::error::CODERABBIT_REVIEW_TOKEN must belong to acgetchell."
42+
exit 1
43+
fi
44+
45+
marker="<!-- coderabbit-review-request:${PR_HEAD_SHA} -->"
46+
comments="$(
47+
gh api --paginate \
48+
"repos/${REPOSITORY}/issues/${PR_NUMBER}/comments" \
49+
--jq '.[] | select(.user.login == "acgetchell") | .body'
50+
)"
51+
if grep -Fxq -- "$marker" <<< "$comments"; then
52+
echo "CodeRabbit review already requested for ${PR_HEAD_SHA}."
53+
exit 0
54+
fi
55+
body="$(printf '@coderabbitai review\n\n%s' "$marker")"
56+
gh api \
57+
--method POST \
58+
"repos/${REPOSITORY}/issues/${PR_NUMBER}/comments" \
59+
--raw-field body="$body"
60+
61+
- name: Enable auto-merge
62+
env:
63+
GH_TOKEN: ${{ github.token }}
64+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
65+
PR_URL: ${{ github.event.pull_request.html_url }}
66+
run: gh pr merge --auto --squash --match-head-commit "$PR_HEAD_SHA" "$PR_URL"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ clarity, and the fixed-dimension stack-allocation model.
77
## Getting Started
88

99
Install Rust 1.97.0 through [rustup](https://rustup.rs/), Git, Python 3.14,
10-
[`uv` 0.11.28](https://docs.astral.sh/uv/), and `jq`. Install the repository's
10+
[`uv` 0.12.0](https://docs.astral.sh/uv/), and `jq`. Install the repository's
1111
pinned `just` version from its locked dependency graph:
1212

1313
```bash

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ cargo run --features exact --example exact_solve_3x3
571571
A short contributor workflow:
572572

573573
Install Rust 1.97.0 through [rustup](https://rustup.rs/), Git, Python 3.14,
574-
[`uv` 0.11.28](https://docs.astral.sh/uv/), and `jq`. Then install the pinned
574+
[`uv` 0.12.0](https://docs.astral.sh/uv/), and `jq`. Then install the pinned
575575
`just` release from its locked dependency graph:
576576

577577
```bash

justfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ export PATH := cargo_home + "/bin" + path_separator + env_var("PATH")
1414
cargo_machete_version := "0.9.2"
1515
cargo_nextest_version := "0.9.140"
1616
cargo_llvm_cov_version := "0.8.7"
17-
dprint_version := "0.55.1"
17+
dprint_version := "0.55.2"
1818
git_cliff_version := "2.13.1"
1919
just_version := "1.56.0"
20-
rumdl_version := "0.2.31"
20+
rumdl_version := "0.2.47"
2121
taplo_version := "0.10.0"
2222
typos_version := "1.48.0"
23-
uv_version := "0.11.28"
24-
zizmor_version := "1.26.1"
23+
uv_version := "0.12.0"
24+
zizmor_version := "1.28.0"
2525

2626
# Internal helpers: ensure external tooling is installed
2727
_ensure-actionlint:

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ package = true
145145
dev = [
146146
"actionlint-py==1.7.12.24",
147147
"pytest==9.1.1",
148-
"ruff==0.15.21",
149-
"semgrep==1.169.0",
148+
"ruff==0.16.1",
149+
"semgrep==1.172.0",
150150
"shellcheck-py==0.11.0.1",
151151
"shfmt-py==4.0.0",
152-
"ty==0.0.58",
152+
"ty==0.0.65",
153153
"yamllint==1.38.0",
154154
]

scripts/bench_compare.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ def _parse_criterion_metadata(
627627
return CriterionProvenance(
628628
suite=cast("BenchmarkSuite", suite),
629629
scope=cast("ComparisonScope", scope),
630-
statistic=cast("Statistic", statistic),
630+
statistic=statistic,
631631
sample=sample,
632632
criterion_version=criterion_version,
633633
baseline_command=commands["baseline_command"],
@@ -1437,9 +1437,11 @@ def _provenance_markdown(provenance: HarnessProvenance) -> list[str]:
14371437
"""Render validated provenance without implying facts absent from metadata."""
14381438
if provenance.schema == 1:
14391439
return [
1440-
"**Harness provenance**: legacy shared current harness metadata from "
1441-
f"`.la-stack-benchmark-harness.json` (baseline source `{provenance.baseline}`, SHA-256 `{provenance.sha256}`). "
1442-
"CPU, OS, rustc, commits, Criterion configuration, and fixture-gate results were not recorded."
1440+
(
1441+
"**Harness provenance**: legacy shared current harness metadata from "
1442+
f"`.la-stack-benchmark-harness.json` (baseline source `{provenance.baseline}`, SHA-256 `{provenance.sha256}`). "
1443+
"CPU, OS, rustc, commits, Criterion configuration, and fixture-gate results were not recorded."
1444+
)
14431445
]
14441446

14451447
if provenance.measurement is None or provenance.publication is None or provenance.criterion is None or provenance.validation is None:

scripts/tag_release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def create_tag(tag_version: str, *, force: bool = False) -> None:
361361
print(f" 1. Force-push the tag: {_BLUE}git push --force origin {tag_version}{_RESET}")
362362
else:
363363
print(f" 1. Push the tag: {_BLUE}git push origin {tag_version}{_RESET}")
364-
print(f" 2. Create GitHub release: {_BLUE}gh release create {tag_version} --notes-from-tag{_RESET}")
364+
print(f" 2. Create GitHub release: {_BLUE}gh release create {tag_version} --title {tag_version} --notes-from-tag{_RESET}")
365365
if is_truncated:
366366
print(f"\n{_YELLOW}Note: Tag annotation references CHANGELOG.md due to size (>125KB).{_RESET}")
367367

scripts/tests/test_tag_release.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,25 @@ def test_oversized_section_detected(self, tmp_path: Path) -> None:
227227

228228

229229
class TestCreateTag:
230+
def test_next_step_sets_release_title(
231+
self,
232+
tmp_path: Path,
233+
capsys: pytest.CaptureFixture[str],
234+
) -> None:
235+
changelog = tmp_path / "CHANGELOG.md"
236+
with (
237+
patch("tag_release._tag_exists", return_value=False),
238+
patch("tag_release.find_changelog", return_value=changelog),
239+
patch(
240+
"tag_release.extract_changelog_section",
241+
return_value=("### Added\n\n- Something new", changelog),
242+
),
243+
patch("tag_release.run_git_command_with_input"),
244+
):
245+
tag_release.create_tag("v1.0.0")
246+
247+
assert "gh release create v1.0.0 --title v1.0.0 --notes-from-tag" in capsys.readouterr().out
248+
230249
@patch("tag_release.run_git_command_with_input")
231250
@patch("tag_release._tag_exists", return_value=False)
232251
@patch("tag_release.find_changelog")

0 commit comments

Comments
 (0)