This is an automated email from the ASF dual-hosted git repository.

hello-stephen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new b5148780cf7 [fix](ci) Accept a hyphen in the PR title, and stop 
ignoring .github (#67491)
b5148780cf7 is described below

commit b5148780cf7619f7b17eff5bf3b24c10cd071d1d
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Thu Sep 3 19:39:38 2026 +0800

    [fix](ci) Accept a hyphen in the PR title, and stop ignoring .github 
(#67491)
    
    ### 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 `.github` tooling, 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
    
    ```
    [fix](arrow-flight) ...
    [feature](inverted-index) ...
    [improvement](github-actions) ...
    ```
    
    **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-title`
    action with an inline `grep -qE` and 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. So
    
    ```
    [a-zA-Z0-9 \-_]
    ```
    
    does 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 to `grep`
    silently changed its meaning.
    
    The fix puts the literal hyphen last in the bracket expression, which is
    how POSIX spells it:
    
    ```diff
    -if ! grep -qE '\[([a-zA-Z0-9 \-_])+\]\(([a-zA-Z0-9 \-_])+\)(.*)' <<< 
"${TITLE}"; then
    +if ! grep -qE '\[([a-zA-Z0-9 _-])+\]\(([a-zA-Z0-9 _-])+\)(.*)' <<< 
"${TITLE}"; then
    ```
    
    A comment now records why the JS form cannot be restored verbatim, so
    the pattern is not "fixed back" later.
    
    #### 2. `.gitignore` ignores `.github`
    
    `.gitignore` has had a bare `.github` entry under its `# other` section
    since 9b5a4645b32 (`[Feature][external catalog/lakesoul] support
    lakesoul catalog`, #32164) — a change that otherwise has nothing to do
    with CI and touched only those two `.gitignore` lines, so 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. This happened while preparing this very PR.
    
    ```
    $ git check-ignore -v --no-index .github/workflows/new-thing.yml
    .gitignore:155:.github    .github/workflows/new-thing.yml
    ```
---
 .github/workflows/title-checker.yml | 8 ++++++--
 .gitignore                          | 1 -
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/title-checker.yml 
b/.github/workflows/title-checker.yml
index f8d7b9d2965..b430250d2bf 100644
--- a/.github/workflows/title-checker.yml
+++ b/.github/workflows/title-checker.yml
@@ -42,8 +42,12 @@ jobs:
             echo "::error::Unable to read the pull request title from the 
event payload."
             exit 1
           fi
-          # Same regex as the previously used deepakputhraya/action-pr-title 
submodule.
-          if ! grep -qE '\[([a-zA-Z0-9 \-_])+\]\(([a-zA-Z0-9 \-_])+\)(.*)' <<< 
"${TITLE}"; then
+          # Same character set as the previously used 
deepakputhraya/action-pr-title submodule,
+          # rewritten for POSIX ERE: that action was JavaScript, where '\-' 
inside a bracket
+          # expression escapes a literal hyphen. POSIX has no such escape -- a 
backslash there is
+          # just a backslash -- so '[a-zA-Z0-9 \-_]' made '\' a member and 
'-_' a range, dropping
+          # the hyphen itself. A literal hyphen has to be last in the bracket 
expression instead.
+          if ! grep -qE '\[([a-zA-Z0-9 _-])+\]\(([a-zA-Z0-9 _-])+\)(.*)' <<< 
"${TITLE}"; then
             echo "::error::PR title \"${TITLE}\" does not match the required 
pattern: [type](scope) description"
             gh pr comment "${PR_NUM}" --body "PR title \`${TITLE}\` does not 
match the required pattern: \`[type](scope) description\`"
             exit 1
diff --git a/.gitignore b/.gitignore
index 414f79421df..7ea2d6c0f66 100644
--- a/.gitignore
+++ b/.gitignore
@@ -152,7 +152,6 @@ docker/runtime/be/resource/apache-doris/
 
 # other
 compile_commands.json
-.github
 
 # generated kuromoji dictionary binaries
 /be/dict/kuromoji/*.bin


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to