Skip to content

Fix: Relax title match for Dependabot group bumps - #60

Merged
tykeal merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:fix/dependabot-group-suffix-relax
Oct 2, 2026
Merged

tykeal merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:fix/dependabot-group-suffix-relax

Conversation

@ModeSevenIndustrialSolutions

@ModeSevenIndustrialSolutions ModeSevenIndustrialSolutions commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Dependabot pull requests that bump one dependency in a group now fail the org-wide Semantic Pull Request check, for example:

The org ruleset already runs the migrated workflow (lfreleng-actions/.github → generic-workflows@v0.3.1), and the relax logic is the same on main. The failure comes from a change in Dependabot itself.

Cause

dependabot-core d0bf3df (merged 2026-09-30) changed how commit_subject shortens a subject over 72 characters:

Regex
Before / from [^\s]*? to [^\s]*/
After %r{ from .+? to .+?(?= \(via audit fix\)| in /|\z)}

The new match runs on to in /<dir>, (via audit fix) or the end of the title instead of stopping at the next space. Three things follow:

  1. A group suffix doesn't stop the match, so it goes along with the versions. If the subject is still too long, Dependabot then cuts it at its first in:

    Text
    PR title Chore: Bump virtualenv from 20.36.1 to 21.7.13 in the uv group across 1 directory
    Commit subject (before d0bf3df) Chore: Bump virtualenv in the uv group across 1 directory
    Commit subject (now) Chore: Bump virtualenv
  2. A library requirement containing spaces is dropped whole: Update JSON requirement from ^0.20, ^0.21 to ^0.20, ^0.21, 1.5 in /BasicPackage.jl becomes Update JSON requirement in /BasicPackage.jl. This is dependabot-core's own fixture for the change.

  3. A (via audit fix) marker stays in the subject, so the in cut can leave a deletion on each side of it: … from 0.48b0 to 0.49b0 (via audit fix) in the uv group becomes … (via audit fix).

relax_matches accepted a removed span reading exactly from <old> to <new> with single-token values, so it kept the strict match for all three forms.

Change

  • relax_matches:
    • Audit marker. When both strings carry (via audit fix), the marker must sit where Dependabot writes it: straight after the version fragment in the title, with the subject keeping the title's post-marker text whole or not at all. In that case the marker is removed from each string before the single-span test, so the deletion reads as one span. Anywhere else, someone moved the marker and the match stays strict.
    • Requirement values. Each value is one token of any shape, followed by any number of requirement tokens: a token carrying a digit, a token of symbols alone (>=, ~>, ||, ,, ≥, …), or one of and/or (Hex), v (Elm, 1.0.0 <= v < 2.0.0) and as (Composer, dev-main as 1.0.x-dev). Words such as to, in and prose never extend a value, so neither value can swallow the other or the trailing context.
    • Trailing context. After the values, the span may carry the context Dependabot appends to a title, in Dependabot's order and wording: in /<dir>, then in the <group> group, then across <N> directory (or directories). The directory may contain spaces, up to the in that starts a group suffix. Any other trailing text keeps the strict match.
    • Guards and compatibility. The single-span, whitespace-boundary, author and single-commit guards are unchanged. The rule widens the previous one with a single exception: an audit marker placed ahead of the version fragment, such as Bump foo (via audit fix) from 1 to 2. The old rule passed that as a trailing fragment, but Dependabot never writes it, so it now stays strict. Nothing Dependabot writes that passed before starts failing.
  • Fixtures (tests/test-relax-matches.sh). Every new relax subject was generated by running Dependabot's current commit_subject on its title:
    • 18 new relax cases:
      • grouped updates with and without directories, directory plus group, the directory-only 72-character cut, a directory that survives the first pass, and spaced directories with and without a group
      • multi-token requirements: Julia upstream fixture, pip, Hex, npm, Elm, Composer alias, and Julia Unicode operators
      • audit-fix titles: the one-span form plus two two-span forms
    • 17 new strict cases:
      • version drift with group context, and group context removed without a version fragment
      • a non-group in the … span, text after the group suffix (with and without a directory), directory and group in reverse order, a non-numeric directory count, and a directory without its leading slash
      • prose inside or after a requirement value, or after as
      • the audit marker in only one string, a different package on each side of the marker, a marker moved ahead of the fragment (with and without a differing directory), and a subject keeping only part of the post-marker text
    • The pre-d0bf3df fixture stays, because older Dependabot output is still valid.
  • Docs: README.md and docs/semantic-pull-request.md now describe the new behaviour, with new table rows.

Validation

  • tests/test-relax-matches.sh: 52/52 pass under bash 5.3 and bash 3.2, in C and C.UTF-8 locales. Against upstream/main the same fixtures fail 17 cases: 16 new relax cases for formats upstream/main rejects, plus the intentional moved-marker narrowing.
  • prek run --files on all changed files: pass.
  • zizmor --persona=auditor, offline and online: no findings.
  • aislop gate (scripts/agents/aislop-gate.sh upstream/main): clean.

Rollout

Once this is merged and released, the pin in lfreleng-actions/.github .github/workflows/semantic-pull-request.yaml (currently 4bff3c4d, v0.3.1) needs bumping. The Mandatory workflows org ruleset runs that file. The blocked Dependabot PRs then need their check re-run.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions requested review from a team and a balanced review from Copilot October 2, 2026 10:37
@github-actions github-actions Bot added the bug Something isn't working label Oct 2, 2026

This comment was marked as outdated.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 11:00
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions force-pushed the fix/dependabot-group-suffix-relax branch from 5e09d5a to 2df8edc Compare October 2, 2026 11:00

This comment was marked as outdated.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions force-pushed the fix/dependabot-group-suffix-relax branch from 2df8edc to e4f76d1 Compare October 2, 2026 11:06
Copilot AI balanced review requested due to automatic review settings October 2, 2026 11:06

This comment was marked as outdated.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions force-pushed the fix/dependabot-group-suffix-relax branch from e4f76d1 to 6401ea4 Compare October 2, 2026 11:17
Copilot AI balanced review requested due to automatic review settings October 2, 2026 11:17

This comment was marked as outdated.

Dependabot pull requests that bump one dependency in a group now fail
the Semantic Pull Request check, as on gha-workflow-linter#387 and
github2gerrit-action#464.

dependabot-core d0bf3df (2026-09-30) changed how a commit subject over
72 characters is shortened. Its version fragment match now runs on to
' in /<dir>', ' (via audit fix)' or the end of the title instead of
stopping at the next space. A grouped title therefore loses its
' in the <group> group across N directory' suffix with the versions,
and a subject still too long is then cut at its first ' in ':

  title:   Chore: Bump virtualenv from 20.36.1 to 21.7.13 in the uv
           group across 1 directory
  subject: Chore: Bump virtualenv

The same change drops a library requirement containing spaces, such
as '^0.20, ^0.21', as a whole. A ' (via audit fix)' marker stays in
the subject, so the cut can leave a deletion either side of it.

relax_matches accepted a removed span reading exactly 'from <old> to
<new>' with single-token values, so it kept the strict match for these
subjects. Now:

- Where both strings carry the audit fix marker, it must sit where
  Dependabot writes it: after the version fragment in the title, with
  the subject keeping the text after it whole or not at all. There,
  remove it from each so the deletion reads as one span; anywhere
  else the match stays strict.
- Let each value continue with requirement tokens: a token carrying a
  digit, a token of symbols alone, or one of 'and', 'or' (Hex), 'v'
  (Elm) and 'as' (Composer). Words such as 'to', 'in' and prose never
  extend a value, so neither value can swallow the other or the
  context after it.
- Let the span carry the context Dependabot appends to a title, in
  its order and wording: ' in /<dir>', then ' in the <group> group',
  then ' across <N> directory'. The directory may contain spaces, up
  to the 'in' that starts a group suffix.

The single-span, whitespace-boundary and author guards are unchanged,
and any other trailing text keeps the strict match. A marker placed
ahead of the version fragment, which Dependabot never writes, now
keeps the strict match where it used to pass as a trailing fragment.

Each new relax fixture is the output of Dependabot's current
commit_subject for its title, including dependabot-core's own
multi-token requirement fixture; new strict fixtures pin the guards on
the added context, requirement tokens and audit marker. The bash
fixture harness has no expected-fail marker, so the tests ship in the
same commit as the fix.

Copilot review:
- Multi-token requirements were still rejected; now accepted, with
  the upstream fixture added.
- Elm ranges such as '1.0.0 <= v < 2.0.0' were rejected; 'v' is now a
  requirement token, with an Elm fixture added.
- An audit fix title cut at ' in ' left two deleted spans either side
  of the retained marker; the marker is now removed from both first.
- The review overview noted Composer aliases ('dev-main as 1.0.x-dev')
  were rejected; 'as' is now a requirement token. Operator tokens are
  generalised to any symbol-only token, which also covers Julia's
  Unicode comparison operators.
- Removing the marker unconditionally hid a moved marker; it is now
  removed only where Dependabot writes it.
- A directory containing spaces was rejected; it may now run over
  several words, up to the 'in' of a group suffix.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 11:25
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions force-pushed the fix/dependabot-group-suffix-relax branch from 6401ea4 to 34947a2 Compare October 2, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation matches Dependabot’s updated behavior and is thoroughly guarded by focused fixtures.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@tykeal
tykeal merged commit 6b8fde5 into lfreleng-actions:main Oct 2, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants