Skip to content

Commit 31077e5

Browse files
fix(bots): use repo's setup-poetry for connector deps (JFrog mirror, egress-safe)
The hand-rolled 'poetry install' failed on the protected runner: it hard-failed on the repo's pre-existing stale poetry.lock, and the relock fallback couldn't reach pypi.org (runner is egress-blocked). The repo already ships a setup-poetry composite that configures poetry against the internal JFrog mirror, runs 'poetry lock', and installs the connector — the maintained, egress-safe path. Swap all three engineer workflows to './.github/actions/setup-poetry' (also provides Python), replacing the bespoke pip/poetry steps. Co-authored-by: Isaac
1 parent c261209 commit 31077e5

3 files changed

Lines changed: 15 additions & 50 deletions

File tree

.github/workflows/engineer-bot-e2e.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
app-id: ${{ secrets.ENGINEER_BOT_APP_ID }}
4040
private-key: ${{ secrets.ENGINEER_BOT_APP_PRIVATE_KEY }}
4141

42-
- name: Setup Python
43-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
42+
- name: Setup Poetry + connector deps (for pytest self-verify)
43+
uses: ./.github/actions/setup-poetry
4444
with:
4545
python-version: '3.11'
4646

@@ -65,15 +65,6 @@ jobs:
6565
engine-ref: b6205fb502566d617a456ccf3c37f3e4e3072ccd
6666
engine-token: ${{ steps.engine-token.outputs.token }}
6767

68-
- name: Install connector deps (for pytest self-verify)
69-
run: |
70-
python -m pip install --upgrade poetry
71-
poetry install --no-interaction || {
72-
echo "::warning::poetry install failed (likely a stale lock); relocking on the runner and retrying."
73-
poetry lock --no-interaction
74-
poetry install --no-interaction
75-
}
76-
7768
- name: Resolve test issue #864 + gather context
7869
id: ctx
7970
env:

.github/workflows/engineer-bot-followup.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ jobs:
9393
app-id: ${{ secrets.ENGINEER_BOT_APP_ID }}
9494
private-key: ${{ secrets.ENGINEER_BOT_APP_PRIVATE_KEY }}
9595

96-
- name: Setup Python
97-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
96+
# Python + connector deps via the repo's OWN setup-poetry action (JFrog
97+
# mirror + poetry lock + install) — egress-safe, tolerates a stale lock.
98+
# The agent runs `poetry run python -m pytest tests/unit` to verify fixups.
99+
- name: Setup Poetry + connector deps (for pytest self-verify)
100+
uses: ./.github/actions/setup-poetry
98101
with:
99102
python-version: '3.11'
100103

@@ -122,21 +125,6 @@ jobs:
122125
engine-ref: b6205fb502566d617a456ccf3c37f3e4e3072ccd
123126
engine-token: ${{ steps.engine-token.outputs.token }}
124127

125-
# Product env-prep: install the connector's own deps so a fixup can be
126-
# verified with `poetry run python -m pytest`. Analog of a driver repo's
127-
# build/restore step.
128-
- name: Install connector deps (for pytest self-verify)
129-
# Resilient to a stale poetry.lock (see engineer-bot.yml): try the locked
130-
# install, and if pyproject/lock have drifted, relock on the runner and
131-
# retry so the agent still gets a working test env.
132-
run: |
133-
python -m pip install --upgrade poetry
134-
poetry install --no-interaction || {
135-
echo "::warning::poetry install failed (likely a stale lock); relocking on the runner and retrying."
136-
poetry lock --no-interaction
137-
poetry install --no-interaction
138-
}
139-
140128
# Run the follow-up. Inlines the engine's bot-run env contract for
141129
# engineer:followup, plus the authenticated push remote bot-run would set
142130
# up (followup pushes fixup commits via a plain `git push`, which doesn't

.github/workflows/engineer-bot.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,14 @@ jobs:
6868
app-id: ${{ secrets.ENGINEER_BOT_APP_ID }}
6969
private-key: ${{ secrets.ENGINEER_BOT_APP_PRIVATE_KEY }}
7070

71-
- name: Setup Python
72-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
71+
# Python + connector deps via the repo's OWN setup-poetry action: it
72+
# configures poetry against the internal JFrog mirror (the protected runner
73+
# is egress-blocked from pypi.org), runs `poetry lock` (tolerating a stale
74+
# lock), and installs the connector + its deps. This is the maintained,
75+
# egress-safe way this repo installs itself — the agent then runs
76+
# `poetry run python -m pytest tests/unit` to self-verify its red→green fix.
77+
- name: Setup Poetry + connector deps (for pytest self-verify)
78+
uses: ./.github/actions/setup-poetry
7379
with:
7480
python-version: '3.11'
7581

@@ -134,26 +140,6 @@ jobs:
134140
engine-ref: b6205fb502566d617a456ccf3c37f3e4e3072ccd
135141
engine-token: ${{ steps.engine-token.outputs.token }}
136142

137-
# Product env-prep: REF-mode install brings ONLY the engine, not this repo's
138-
# own deps. Install them so the agent can run `poetry run python -m pytest`
139-
# to SELF-VERIFY its red→green fix (without this: "No module named pytest"
140-
# → static reasoning). This is the Python analog of a driver repo's
141-
# `dotnet restore` / build step.
142-
- name: Install connector deps (for pytest self-verify)
143-
# Resilient to a stale poetry.lock: modern poetry refuses `install` when
144-
# pyproject.toml has drifted from the lock. That's a repo-maintenance
145-
# state the bot must not hard-fail on — it just needs a working env to
146-
# run tests. So try the locked install first, and if it fails, relock and
147-
# retry. (A relock only affects this ephemeral runner; nothing is
148-
# committed unless the agent's fix itself touches deps.)
149-
run: |
150-
python -m pip install --upgrade poetry
151-
poetry install --no-interaction || {
152-
echo "::warning::poetry install failed (likely a stale lock); relocking on the runner and retrying."
153-
poetry lock --no-interaction
154-
poetry install --no-interaction
155-
}
156-
157143
- name: Run author (bug-fix)
158144
id: author
159145
# Run from RUNNER_TEMP so the engine-rendered prompt's context file

0 commit comments

Comments
 (0)