Skip to content

HYPERFLEET-1762 - feat: validate the PR title only in --pr mode - #17

Merged
ciaranRoche merged 2 commits into
openshift-hyperfleet:mainfrom
ciaranRoche:HYPERFLEET-1200-commitlint-title-only
Oct 13, 2026
Merged

ciaranRoche merged 2 commits into
openshift-hyperfleet:mainfrom
ciaranRoche:HYPERFLEET-1200-commitlint-title-only

Conversation

@ciaranRoche

@ciaranRoche ciaranRoche commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • commitlint --pr validates the PR title only. The title is read from the JOB_SPEC environment variable Prow sets on every job (refs.pulls[0].title), falling back to the GitHub API, and the run fails when neither yields a title. Today a failed title lookup warns and passes.
  • Per-commit validation moves behind --pr --commits. The bot skip list is unchanged.
  • New pkg/prow package with the job spec parser and tests. New command tests for the title-only path, the --commits path, the no-title failure and the title rules.
  • README, docs/commitlint.md and AGENTS.md say what CI checks: the PR title, which becomes the squashed commit on main. Commits inside a PR need only the <type>: <subject> shape enforced locally.
  • make validate-commits now runs --pr --commits and needs the PR environment.

Why

HyperFleet is switching Tide to squash on merge, where only the PR title reaches main, and the review rule is now "push fixes as new commits, do not force-push during review". Validating every commit in a PR pushes authors straight back to amending. Reading the title from JOB_SPEC also removes the unauthenticated GitHub API call that could silently skip the title check.

How to test

go build ./... && go test ./... && go vet ./... && make lint

126 tests pass. Smoke-tested the binary with a valid title via JOB_SPEC (exit 0), a title without the JIRA key (exit 1), and no title source (exit 1 with could not get PR title).

Tracked in https://redhat.atlassian.net/browse/HYPERFLEET-1762

Merge order

This is step 2 of the HyperFleet repository ownership rollout. After it merges, tag v0.3.0; the openshift/release commitlint step pins that tag.

  1. HYPERFLEET-1762 - docs: repository ownership document, OWNERS generator and review rules architecture#232, ownership document and generator.
  2. This PR. HYPERFLEET-1762 - feat: validate the PR title only in --pr mode #17, commitlint validates the PR title only, then the v0.3.0 tag.
  3. openshift-hyperfleet: onboard five repositories to Prow and require the tide context on repositories without jobs openshift/release#86872, Prow onboarding and the tide context. Independent of 1 and 2.
  4. Team session. Done, held with the team the week of 5 October.
  5. The nineteen per-repository OWNERS PRs, after 1 and 3, when the hold is lifted:
  6. HYPERFLEET-1762 - ci: squash on merge for openshift-hyperfleet, hooks v0.3.0 openshift/release#86873, squash on merge and the commitlint pin bump, after 2.
  7. HYPERFLEET-1762 - feat: group the open PRs digest by area and show requested reviewers hyperfleet-claude-plugins#101, open-PRs digest by area, any time after 5.

This was referenced Oct 12, 2026
Prow now reads the PR title from JOB_SPEC before falling back to the GitHub
API, and fails when no title can be obtained instead of warning and passing.
Per-commit validation moves behind --commits. With squash on merge only the
PR title reaches main, so authors can push fixes as new commits during review.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ciaranRoche
ciaranRoche force-pushed the HYPERFLEET-1200-commitlint-title-only branch from e48e07b to 9a30bac Compare October 12, 2026 11:42
@ciaranRoche ciaranRoche changed the title HYPERFLEET-1200 - feat: validate the PR title only in --pr mode HYPERFLEET-1762 - feat: validate the PR title only in --pr mode Oct 12, 2026
Comment thread cmd/hyperfleet-hooks/commitlint/commitlint_test.go Outdated
…s a bad commit

The base and head SHAs were identical, so the range was empty and the
previous --pr behaviour would have passed too. Both validatePR tests now
share a repo with a valid base commit and one invalid commit on top, so
they differ only in the flag.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rafabene

Copy link
Copy Markdown
Member

/lgtm

@ciaranRoche
ciaranRoche merged commit 5182aaf into openshift-hyperfleet:main Oct 13, 2026
openshift-merge-bot Bot added a commit to openshift-hyperfleet/hyperfleet-adapter that referenced this pull request Oct 13, 2026
## What changed

Replaces the flat list of approvers and reviewers with area owners from
the
ownership document:
https://github.com/openshift-hyperfleet/architecture/blob/main/hyperfleet/docs/owners.md
(in review in openshift-hyperfleet/architecture#232 until it merges).

- OWNERS_ALIASES holds the names, OWNERS files reference aliases and
carry area labels
- a merge now needs an approver for every touched path
- Blunderbuss requests reviewers from the area's pool

## Why

Today every repository lists the same seventeen people as approvers and
reviewers, so review requests route at random and any one of them can
merge
anything alone. Named areas put the request in front of the people who
know the
code and make an approver accountable for what merges.

**The same criteria were applied to everyone at launch, using the last
three
sprints. Reviewer and approver status follows the criteria in the
ownership
document and nothing else.** The path to reviewer and approver is
written there.

Generated from hyperfleet/docs/owners.yaml in the architecture
repository.
Changes to ownership are a PR to that file, then a regenerated OWNERS
here.

Tracked in https://redhat.atlassian.net/browse/HYPERFLEET-1762

## Merge order

This is one of the nineteen per-repository OWNERS PRs, step 5 of the
repository ownership rollout. It merges after the ownership document and
the Prow onboarding PR, and only
when the hold is lifted. The team session that announces the model has
already
happened.

1. openshift-hyperfleet/architecture#232, ownership document and
generator.
2. openshift-hyperfleet/hyperfleet-hooks#17, commitlint validates the PR
title only, then the `v0.3.0` tag.
3. openshift/release#86872, Prow onboarding and the `tide` context.
Independent of 1 and 2.
4. Team session. Done, held with the team the week of 5 October.
5. **This PR.** The nineteen per-repository OWNERS PRs, after 1 and 3,
when the hold is lifted:
   - openshift-hyperfleet/architecture#233
   - openshift-hyperfleet/coderabbit#5
   - **#331 (this PR)**
   - openshift-hyperfleet/hyperfleet-api#398
   - openshift-hyperfleet/hyperfleet-api-spec#68
   - openshift-hyperfleet/hyperfleet-api-spec-template#14
   - openshift-hyperfleet/hyperfleet-applier#58
   - openshift-hyperfleet/hyperfleet-broker#29
   - openshift-hyperfleet/hyperfleet-claude-plugins#100
   - openshift-hyperfleet/hyperfleet-credential-provider#15
   - openshift-hyperfleet/hyperfleet-e2e#164
   - openshift-hyperfleet/hyperfleet-hooks#18
   - openshift-hyperfleet/hyperfleet-infra#108
   - openshift-hyperfleet/hyperfleet-logger#6
   - openshift-hyperfleet/hyperfleet-operator#129
   - openshift-hyperfleet/hyperfleet-release#13
   - openshift-hyperfleet/renovate-config#5
   - openshift-hyperfleet/hyperfleet-sentinel#280
   - openshift-hyperfleet/.github#1
6. openshift/release#86873, squash on merge and the commitlint pin bump,
after 2.
7. openshift-hyperfleet/hyperfleet-claude-plugins#101, open-PRs digest
by area, any time after 5.

/hold
openshift-merge-bot Bot pushed a commit to openshift-hyperfleet/hyperfleet-claude-plugins that referenced this pull request Oct 14, 2026
…quested reviewers (#101)

## What changed

- The open-PRs digest groups PRs by their `area/*` label (first area as
the group, others inline, "No area" last) and shows, per PR, the
requested reviewers and business days since the request. A pending
request older than one business day on a non-draft PR is flagged. Risk
scoring, tiers and the Slack message shape are unchanged.
- `collect-data.sh` reads `review_requested` events from the issue
timeline so the request time is real, with PR `createdAt` as the
fallback.
- `prioritization-algorithm.md` and `output-format.md` replace "review
requests are ignored because reviewers are auto-assigned" with the new
rule: requests come from the area's OWNERS pool and are the reviewer of
record.
- `references/github-repos.md` is the current nineteen repositories
(archived and out-of-scope ones removed, `hyperfleet-api-spec-template`
added).
- `bugs-triage/references/owners.csv` aligned with the ownership areas.
- `CONTRIBUTING.md` and `AGENTS.md`: plugin OWNERS files reference
aliases from the root `OWNERS_ALIASES` and are generated from the
ownership document in the architecture repository.
- `hyperfleet-work-triage` bumped to 0.4.0.

## Why

Prow now labels PRs by area and requests reviewers from the area's
OWNERS pool. The digest is what tells an approver every morning that a
PR is waiting on them, so it has to show the area and the reviewer of
record rather than ignoring requests.

## How to test

```text
bash hyperfleet-work-triage/skills/open-prs/scripts/tests/run-tests.sh
```

96 tests pass. A live run of `collect-data.sh --repo hyperfleet-adapter`
returned real request timestamps from the timeline for adapter#330.

Tracked in https://redhat.atlassian.net/browse/HYPERFLEET-1762

## Merge order

This is step 7 of the HyperFleet repository ownership rollout. It can
merge any time after the area labels exist (they do), and is most useful
once the OWNERS PRs (step 5) have merged.

1. openshift-hyperfleet/architecture#232, ownership document and
generator.
2. openshift-hyperfleet/hyperfleet-hooks#17, commitlint validates the PR
title only, then the `v0.3.0` tag.
3. openshift/release#86872, Prow onboarding and the `tide` context.
Independent of 1 and 2.
4. Team session. Done, held with the team the week of 5 October.
5. The nineteen per-repository OWNERS PRs, after 1 and 3, when the hold
is lifted:
   - openshift-hyperfleet/architecture#233
   - openshift-hyperfleet/coderabbit#5
   - openshift-hyperfleet/hyperfleet-adapter#331
   - openshift-hyperfleet/hyperfleet-api#398
   - openshift-hyperfleet/hyperfleet-api-spec#68
   - openshift-hyperfleet/hyperfleet-api-spec-template#14
   - openshift-hyperfleet/hyperfleet-applier#58
   - openshift-hyperfleet/hyperfleet-broker#29
   - #100
   - openshift-hyperfleet/hyperfleet-credential-provider#15
   - openshift-hyperfleet/hyperfleet-e2e#164
   - openshift-hyperfleet/hyperfleet-hooks#18
   - openshift-hyperfleet/hyperfleet-infra#108
   - openshift-hyperfleet/hyperfleet-logger#6
   - openshift-hyperfleet/hyperfleet-operator#129
   - openshift-hyperfleet/hyperfleet-release#13
   - openshift-hyperfleet/renovate-config#5
   - openshift-hyperfleet/hyperfleet-sentinel#280
   - openshift-hyperfleet/.github#1
6. openshift/release#86873, squash on merge and the commitlint pin bump,
after 2.
7. **This PR.** #101,
open-PRs digest by area, any time after 5.

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.

2 participants