Repository navigation
ci: port shared engineer bot learnings - #1793
Conversation
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
35a7e92 to
7e004e1
Compare
There was a problem hiding this comment.
Verdict: 1 Medium
Mostly solid, with one medium concern: the sync workflow's App token may be refused when a merge brings in changes to .github/workflows/. If so, the sync fails without posting the maintainer comment. The changelog parser matches the current NEXT_CHANGELOG.md layout. I couldn't check that the engine accepts the new --bot flag in engineer-bot-followup.yml, because the engine source isn't available here.
| with: | ||
| app-id: ${{ secrets.ENGINEER_BOT_APP_ID }} | ||
| private-key: ${{ secrets.ENGINEER_BOT_APP_PRIVATE_KEY }} | ||
| permission-contents: write |
There was a problem hiding this comment.
🟡 Medium — The minted App token has only contents: write and pull-requests: write. A sync merge commit brings in everything main changed since the PR branched. GitHub rejects a GitHub App push that creates or updates files under .github/workflows/ unless the token has the workflows permission ("refusing to allow a GitHub App to create or update workflow … without workflows permission"). This PR itself adds and edits several workflows, so that situation will come up.
When it does, the push in sync_pr raises CalledProcessError. main() catches it, logs a warning and fails the job. It never calls comment_once, so the PR stays conflicted and nothing on the PR tells a maintainer why. That is the exact silent stall this workflow is meant to remove.
Possible fixes, depending on what the App is allowed:
- If the engineer-bot App can be granted the
workflowspermission, requestpermission-workflows: writehere. - Otherwise, detect a failed push (or a merge that touches
.github/workflows/) and post the maintainer comment instead of only warning.
Caveat: I couldn't check the App's installed permissions from here, so this rejection is inferred from GitHub's documented push rule, not observed in a run.
Description
Port the shared engineer/reviewer bot lessons from databricks/databricks-sql-nodejs#571 and #572: keep changes within maintainer scope, ground findings in evidence, select unit or live tests by behavior, and handle stale reviews. Follow-ups load trusted default-branch config; agents cannot edit their own
.bot/settings.Sync conflicting bot PRs only when
NEXT_CHANGELOG.mdchanges are additive Unreleased entries, preserving its Added/Updated/Fixed groups. Other conflicts receive a maintainer comment. Sync is limited to PRs targeting the default branch.NO_CHANGELOG=true
Testing
Passed 20 local changelog/branch-sync cases, YAML parsing, shell syntax checks, and
git diff --check. Added a CI workflow to run the sync tests.Telemetry Errors
This PR was created with GitHub MCP.