Skip to content

chore(ci): add regen-push bot script and update commenter message - #26093

Merged
gnodet merged 3 commits into
apache:mainfrom
gnodet:regen-push-bot
Sep 3, 2026
Merged

chore(ci): add regen-push bot script and update commenter message#26093
gnodet merged 3 commits into
apache:mainfrom
gnodet:regen-push-bot

Conversation

@gnodet

@gnodet gnodet commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What

Add etc/scripts/regen-push.sh — a standalone script that automatically pushes "Regen" commits to PR branches when CI detects uncommitted generated file changes.

Update pr-test-commenter.yml to inform contributors that a bot will auto-push the regen fix when maintainer edits are allowed, with manual instructions as fallback.

How it works

  1. ETag-polls the GitHub Events API (free on 304 — no API quota consumed when idle)
  2. When activity is detected, queries the Artifacts API for regen-patch artifacts
  3. For each artifact: verifies the PR is still open, SHA matches (not stale), and maintainerCanModify=true
  4. Downloads the patch, shallow-clones the PR branch (works for both same-repo and fork PRs), applies the patch, commits "Regen", pushes
  5. Tracks pushed run IDs in a state file to avoid re-pushing

Requirements

  • gh CLI authenticated with a maintainer PAT (repo scope)
  • python3 (for JSON parsing)
  • curl (for ETag polling)

Usage

# One-shot check
./etc/scripts/regen-push.sh

# Dry run (shows what would be pushed)
./etc/scripts/regen-push.sh --dry-run --verbose

# As a cron job (every 5 minutes)
*/5 * * * * /path/to/regen-push.sh --repo apache/camel

Commenter update

The PR comment posted by pr-test-commenter.yml now mentions that a bot will auto-push the fix when Allow edits from maintainers is enabled, with manual instructions as fallback.

Add etc/scripts/regen-push.sh — a standalone script that automatically
pushes "Regen" commits to PR branches when CI detects uncommitted
generated file changes. It downloads the regen-patch artifact produced
by the CI build and pushes the fix directly.

Works for both same-repo and fork PRs (requires maintainer access and
"Allow edits from maintainers" enabled). Uses ETag-based polling on
the Events API for efficient cron usage.

Update pr-test-commenter.yml to inform contributors that a bot will
auto-push the regen fix when maintainer edits are allowed, with manual
instructions as fallback.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet
gnodet marked this pull request as draft September 3, 2026 14:52
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ Generated files are up to date

An earlier CI run reported uncommitted generated changes; the latest run no longer does.

Add a blank line between the ASF license block and the script documentation
to prevent the regen formatter from treating them as a single license block
and stripping the documentation.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • etc

🔬 Scalpel shadow comparison — Scalpel: 1 tested, 0 compile-only — current: 0 all tested

Maveniverse Scalpel detected 1 affected modules (current approach: 0).

⚠️ Modules only in Scalpel (1)
  • camel-etc

Skip-tests mode would test 1 modules (1 direct + 0 downstream), skip tests for 0 (generated code, meta-modules)

Modules Scalpel would test (1)
  • camel-etc

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more


⚙️ View full build and test results

@gnodet
gnodet marked this pull request as ready for review September 3, 2026 22:18
@gnodet gnodet added this to the 4.23.0 milestone Sep 3, 2026
@gnodet
gnodet merged commit bd1f374 into apache:main Sep 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants