Skip to content

[improvement](github-actions) Reduce redundant GitHub Actions runs and checkouts - #66957

Merged
hello-stephen merged 1 commit into
apache:masterfrom
hello-stephen:ci-gha-thin
Aug 20, 2026
Merged

[improvement](github-actions) Reduce redundant GitHub Actions runs and checkouts#66957
hello-stephen merged 1 commit into
apache:masterfrom
hello-stephen:ci-gha-thin

Conversation

@hello-stephen

Copy link
Copy Markdown
Contributor

Background

The GitHub Actions queue for apache/doris has been heavily congested (recent 48h sample: 11180+ runs, ~53 concurrent slots demanded vs 25 available, median queue wait 73 min, max 41.7h). Most of the load comes from runs that do no useful work. This PR removes the redundant triggers and the expensive checkouts behind them, without changing what any check verifies.

Changes

1. Drop the unused issue_comment triggers (5 workflows)

license-eyes.yml, checkstyle.yaml, clang-format.yml, build-extension.yml, build-thirdparty.yml all listen to every issue comment, then exit at a job-level if unless the comment matches a three-way handshake (a doris-robot comment on a github-actions[bot]-created issue). That handshake has never happened (0 matching runs in 30 days, 0 matching issues in search history), yet ~3600 runs per 48h were created and immediately exited. The workflow_dispatch trigger remains for manual re-runs.

2. Check PR title: validate inline, no checkout

title-checker.yml checked out the whole repository (with recursive submodules, ~15 min/run) just to test github.event.pull_request.title against a regex. The check now reads the title from the event payload and posts the same failure comment, ~40s per run.

3. Dependency License Review: only run when manifests change

third_party_review.yml adds on.pull_request.paths covering the dependency manifests scanned by dependency-review-action (thirdparty/**, env.sh, build.sh, **/pom.xml, **/go.mod, **/go.sum, **/Gemfile, **/requirements*.txt, **/package.json, lock files, etc.). PRs that don't touch dependencies no longer run this check.

4. Check Large File: GitHub API instead of double checkout

lfs-warning.yml checked out the repository (recursive submodules) and then cloned the external ppremk/lfs-warning action, ~17 min/run for a 1MB file-size check. It now fetches the added files via the pulls/commits API and measures sizes via raw_url Content-Length, ~30s per run. The push trigger is narrowed to master (PRs are already covered by pull_request_target, which also removed the double-checking of in-repo branch PRs). One intentional behavior change: a direct master push with an oversized file now fails the check instead of being ignored.

5. Label when approved workflow run: inline the submodule actions, no checkout

approve-label.yml checked out the repository (recursive submodules) to load the get-workflow-origin and label-when-approved-action submodules. Both are thin API wrappers and are now inlined as gh api calls with identical semantics (latest review per reviewer wins; reviewed = any approval, add-only; approved = committer approval, added/removed; CHANGES_REQUESTED vetoes). ~14 min/run → ~30s/run.

Expected effect

  • ~2500 fewer runs/day, wall-clock ~1275h → ~670h per day (-48%)
  • Queue noise from instant-exit runs is largely gone

🤖 Generated with Claude Code

…d full checkouts in lightweight checks
- Drop the issue_comment trigger from license-eyes, checkstyle, clang-format,
build-extension and build-thirdparty. Their comment handler required a
doris-robot comment on a github-actions[bot] issue, which has never
happened, yet every issue comment created a run that exited immediately
(~3600 wasted runs per 48h).
- Check PR title: validate github.event.pull_request.title inline instead of
checking out the repository with recursive submodules.
- Dependency License Review: only run when dependency manifests change.
- Check Large File: get added files and their sizes via the GitHub API
instead of checking out the repository and cloning the lfs-warning action;
restrict the push trigger to master.
- Label when approved workflow run: inline the get-workflow-origin and
label-when-approved-action submodules as gh api calls and drop the
repository checkout entirely.
Co-Authored-By: Claude <noreply@anthropic.com>
@hello-stephen

Copy link
Copy Markdown
ContributorAuthor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen

Copy link
Copy Markdown
ContributorAuthor

skip buildall

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@hello-stephen
hello-stephen merged commit 7ff151a into apache:masterAug 20, 2026
33 of 34 checks passed
@hello-stephen
hello-stephen deleted the ci-gha-thin branch August 20, 2026 03:27
hello-stephen pushed a commit that referenced this pull request Sep 3, 2026
…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 9b5a464 (`[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
```
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@hello-stephen@morningman