diff --git a/.github/workflows/engineer-bot-followup.yml b/.github/workflows/engineer-bot-followup.yml index 230f8d0ef..bf4be5117 100644 --- a/.github/workflows/engineer-bot-followup.yml +++ b/.github/workflows/engineer-bot-followup.yml @@ -94,6 +94,20 @@ jobs: with: python-version: '3.11' + # setup-poetry runs `poetry lock` (to reconcile the lock with the internal + # JFrog source it injects), which REWRITES tracked poetry.lock / pyproject.toml + # in the working tree. The venv is already built, so the tree no longer needs + # that churn — revert it, else the followup's fixup commit (or its leftover + # check) would sweep up these bot-untouched dirty files. Keep ONLY the + # agent's edits in the tree. + - name: Revert poetry lock/pyproject churn (keep only the agent's edits) + # No `|| true`: `git checkout -- ` exits 0 for both the + # clean and the reverted-churn cases, so a non-zero exit means the revert + # genuinely failed (e.g. the files went untracked/missing) and the dirty + # tree would otherwise be swept into the followup's fixup commit. Fail + # loudly here instead of masking it. + run: git checkout -- poetry.lock pyproject.toml + # Shared prelude: mint the engineer-bot token (pushes fixup commits, posts # replies) + the engine-scoped token, set up Node, install the engine. - name: Bot prelude (tokens + Node + engine install) diff --git a/.github/workflows/engineer-bot.yml b/.github/workflows/engineer-bot.yml index eee9d7784..03ba0f307 100644 --- a/.github/workflows/engineer-bot.yml +++ b/.github/workflows/engineer-bot.yml @@ -81,6 +81,20 @@ jobs: with: python-version: '3.11' + # setup-poetry runs `poetry lock` (to reconcile the lock with the internal + # JFrog source it injects), which REWRITES tracked poetry.lock / pyproject.toml + # in the working tree. The venv is already built, so the tree no longer needs + # that churn — revert it, else publish's leftover safety-net sees these + # bot-untouched dirty files and refuses to open the PR (they aren't in the + # agent's touched_files). Keep ONLY the agent's edits in the tree. + - name: Revert poetry lock/pyproject churn (keep only the agent's edits) + # No `|| true`: `git checkout -- ` exits 0 for both the + # clean and the reverted-churn cases, so a non-zero exit means the revert + # genuinely failed (e.g. the files went untracked/missing) and the dirty + # tree would otherwise resurface as a confusing publish-time error. Fail + # loudly here instead of masking it. + run: git checkout -- poetry.lock pyproject.toml + # Shared prelude: mint the engineer-bot token (pushes the fix branch, # comments) + the engine-scoped token, set up Node, install the pinned # engine (PAT-free). `token` output is used by the steps below.