Uh oh!
There was an error while loading. Please reload this page.
[fix](ci) Accept a hyphen in the PR title, and stop ignoring .github - #67491
Merged
Conversation
The PR title checker rejects every title whose type or scope contains a hyphen, for example: [fix](arrow-flight) ... [feature](inverted-index) ... [improvement](github-actions) ... 88 of the last 1500 commits on master use such a title, including apache#66957, the change that introduced the current check -- its own title `[improvement](github-actions) Reduce redundant GitHub Actions runs and checkouts` would not pass the checker it added. apache#66957 replaced the deepakputhraya/action-pr-title action with an inline `grep -qE` and kept the action's regex verbatim. That action is JavaScript, where `\-` inside a character class is a valid escape for a literal hyphen. POSIX ERE has no such escape: a backslash inside a bracket expression is just a backslash. So `[a-zA-Z0-9 \-_]` does not mean "... space, hyphen, underscore" -- it makes `\` a member and reads `-_` as a range endpoint, leaving the hyphen itself out of the set. The port silently changed the meaning. Put the literal hyphen last in the bracket expression instead, which is how POSIX spells it. Verified: the old expression is not merely permissive-but-wrong, BSD grep rejects it outright with `invalid character range`. With the new expression both grep implementations available locally accept every valid title above and still reject `no brackets` and `[fix] no scope`, so the check is not weakened. GNU grep rejecting the old expression is what the failing run on apache#67487 shows. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017omcvWDsxEc9AyU83aBZ2g
hello-stephen
commented
Sep 3, 2026
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
`.gitignore` has had a bare `.github` entry under its "# other" section since 9b5a464 ("[Feature][external catalog/lakesoul] support lakesoul catalog", apache#32164), a change that otherwise has nothing to do with CI and touched only those two .gitignore lines -- it looks accidental. The existing files under .github survived only because they were already tracked when the entry was added; .gitignore does not affect tracked files. The entry therefore has no useful effect today, and two harmful ones: * Any NEW file under .github -- a workflow, an action, CODEOWNERS, an issue template -- is silently ignored. `git status` does not list it and `git add` refuses it without -f, so it is easy to open a PR that is missing it. * Even for a tracked file, `git add .github/workflows/foo.yml` prints "The following paths are ignored by one of your .gitignore files" and exits non-zero, which breaks `git add ... && git commit ...` in scripts. Removing the entry exposes no untracked files: `git status --untracked-files=all .github/` is empty afterwards. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017omcvWDsxEc9AyU83aBZ2g
morningman
commented
Sep 3, 2026
ContributorAuthor
skip buildall |
hello-stephen
approved these changes
Sep 3, 2026
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #66957 (introduced the title-checker regression), #67487 (a PR currently blocked by it)
Problem Summary:
Two independent bugs in the repository's
.githubtooling, both of which make it easy to get a PR wrong for reasons unrelated to its content.1. The PR title checker rejects any hyphen in the type or scope
88 of the last 1500 commits on master use such a title, including #66957 itself — the change that introduced the current check. Its own title,
[improvement](github-actions) Reduce redundant GitHub Actions runs and checkouts, would not pass the checker it added.Root cause.#66957 replaced the
deepakputhraya/action-pr-titleaction with an inlinegrep -qEand kept the action's regex verbatim, with the comment "Same regex as the previously used ... submodule". But that action is JavaScript, where\-inside a character class is a valid escape for a literal hyphen. POSIX ERE has no such escape — a backslash inside a bracket expression is just a backslash. Sodoes not mean "letters, digits, space, hyphen, underscore". It makes
\a member and then reads-_as a range endpoint, which leaves the hyphen itself out of the set. Porting the pattern from JS togrepsilently changed its meaning.The fix puts the literal hyphen last in the bracket expression, which is how POSIX spells it:
A comment now records why the JS form cannot be restored verbatim, so the pattern is not "fixed back" later.
2.
.gitignoreignores.github.gitignorehas had a bare.githubentry under its# othersection since 9b5a464 ([Feature][external catalog/lakesoul] support lakesoul catalog, #32164) — a change that otherwise has nothing to do with CI and touched only those two.gitignorelines, so it looks accidental.The existing files under
.githubsurvived only because they were already tracked when the entry was added;.gitignoredoes not affect tracked files. The entry therefore has no useful effect today, and two harmful ones:.github— a workflow, an action,CODEOWNERS, an issue template — is silently ignored.git statusdoes not list it andgit addrefuses it without-f, so it is easy to open a PR that is missing it.git add .github/workflows/foo.ymlprintsThe following paths are ignored by one of your .gitignore filesand exits non-zero, which breaksgit add ... && git commit ...in scripts. This happened while preparing this very PR.Release note
None
Check List (For Author)
.gitignoreline; both are exercised directly, see the evidence below.Title checker. The old expression is not merely permissive-but-wrong — BSD grep rejects it outright:
Old vs new, on the two grep implementations available to me locally:
[fix](arrow-flight) point query[fix](arrow-flight-sql) x[improvement](github-actions) Reduce redundant runs[fix](arrow_flight) underscore[fix](nereids) plain[opt](build) Decouple status.hno brackets[fix] no scopeThe last two rows are the point: the check is not weakened, malformed titles are still rejected.
I do not have GNU grep on this machine, so I did not run the new expression under it. GNU grep rejecting the old expression is directly observed — it is what the failing
Check PR titlerun on #67487 shows. That the new expression works there follows from the POSIX rule the fix relies on: a hyphen last in a bracket expression is a literal hyphen on any conforming engine, and GNU grep documents this explicitly.Note this PR's own title deliberately uses
(ci)rather than a hyphenated scope, because a fork PR is checked by the workflow on the base branch — that is, the broken one this PR fixes..gitignore. Removing the entry exposes no untracked files;
git status --untracked-files=all .github/is empty afterwards. The 33 tracked entries under.githubare unchanged (the 5 that have no file on disk are uninitialised submodule gitlinks, unrelated to this change).Behavior changed:
.githubare no longer silently ignored by git.Does this need documentation?
🤖 Generated with Claude Code
https://claude.ai/code/session_017omcvWDsxEc9AyU83aBZ2g