Skip to content

Commit 2edf629

Browse files
authored
Work around pixi lockfile oscillation in lockfile refresh as well. (#3062)
refs #2850, pr 3059 Add the oscillation check to the refresh path so refresh still works.
1 parent a3cca81 commit 2edf629

2 files changed

Lines changed: 64 additions & 10 deletions

File tree

‎.github/workflows/ci-pixi-lockfile-refresh.yml‎

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ jobs:
5050

5151
# Pixi 0.73.0's update and lock-read paths can serialize the same solve
5252
# differently (#2804). Canonicalize with the same operation used by the
53-
# freshness workflow before opening the PR.
53+
# freshness workflow before opening the PR. If cuda_core hits the exact
54+
# samples-source pruning defect guarded there, retain its committed lock
55+
# and continue refreshing the other workspaces.
5456
- name: Update and canonicalize all lockfiles
5557
id: update
5658
env:
@@ -90,14 +92,49 @@ jobs:
9092
lockfile="$2"
9193
pixi_version="$3"
9294
95+
committed_blob="$(git hash-object "${lockfile}")"
9396
pixi update --no-install --manifest-path "${manifest}"
94-
pixi lock --check --manifest-path "${manifest}"
97+
# The detector reads this uncommitted post-update state through
98+
# git cat-file, so explicitly persist the blob in the runner-local
99+
# temporary object database.
100+
updated_blob="$(git hash-object -w "${lockfile}")"
101+
102+
check_status=0
103+
pixi lock --check --manifest-path "${manifest}" \
104+
|| check_status=$?
105+
if ((check_status != 0)); then
106+
defect_status=1
107+
if [[ "${manifest}" == "cuda_core" ]]; then
108+
defect_status=0
109+
python3 ci/tools/check_pixi_samples_source_pruning.py \
110+
--original-blob "${updated_blob}" \
111+
--lockfile "${lockfile}" \
112+
--manifest-path "${manifest}/pixi.toml" \
113+
--pixi-version "${pixi_version}" \
114+
--check-status "${check_status}" \
115+
|| defect_status=$?
116+
fi
117+
118+
if ((defect_status == 0)); then
119+
echo "::warning title=Known Pixi samples lockfile bug::Pixi ${pixi_version} removed only the nine samples local-source references after updating ${lockfile}. Keeping the committed cuda_core lockfile and continuing with the other workspaces; all other refresh failures remain strict."
120+
git cat-file blob "${committed_blob}" > "${lockfile}"
121+
echo "known-defect-skipped=true" >> "${GITHUB_OUTPUT}"
122+
exit 0
123+
elif [[ "${manifest}" == "cuda_core" ]] && ((defect_status != 1)); then
124+
echo "::error::Could not determine whether ${lockfile} matches the known Pixi samples-source pruning defect. Resolve the detector error above and rerun."
125+
exit "${defect_status}"
126+
fi
127+
128+
exit "${check_status}"
129+
fi
95130
96131
canonical_blob="$(git hash-object "${lockfile}")"
97-
pixi lock --check --manifest-path "${manifest}"
132+
verify_status=0
133+
pixi lock --check --manifest-path "${manifest}" \
134+
|| verify_status=$?
98135
verified_blob="$(git hash-object "${lockfile}")"
99-
if [ "${canonical_blob}" != "${verified_blob}" ]; then
100-
echo "::error::pixi ${pixi_version} rewrote ${lockfile} on a second consecutive pixi lock --check; refusing to open an unstable refresh PR."
136+
if ((verify_status != 0)) || [[ "${canonical_blob}" != "${verified_blob}" ]]; then
137+
echo "::error::pixi ${pixi_version} did not reach a successful byte-stable check for ${lockfile} (verification exit ${verify_status}, canonical blob ${canonical_blob}, verified blob ${verified_blob}); refusing to open an unstable refresh PR."
101138
exit 1
102139
fi
103140
' bash "${manifest}" "${lockfile}" "${PIXI_VERSION}" \
@@ -123,15 +160,24 @@ jobs:
123160
- name: Compose PR body
124161
id: pr-body
125162
env:
163+
KNOWN_DEFECT_SKIPPED: ${{ steps.update.outputs.known-defect-skipped }}
126164
PIXI_VERSION: ${{ steps.setup-pixi.outputs.pixi-version }}
127165
run: |
128166
body_path="${RUNNER_TEMP}/pixi-lock-refresh-body.md"
129167
{
130-
echo "Automated lockfile refresh for all workspaces using pixi" \
168+
echo "Automated lockfile refresh using pixi" \
131169
"\`${PIXI_VERSION}\` (\`pixi update --no-install\`, followed by" \
132-
"byte-stable \`pixi lock --check\` canonicalization)."
170+
"byte-stable \`pixi lock --check\` canonicalization for each" \
171+
"refreshed workspace)."
172+
if [[ "${KNOWN_DEFECT_SKIPPED}" == "true" ]]; then
173+
echo
174+
echo "> [!NOTE]"
175+
echo "> \`cuda_core/pixi.lock\` was left unchanged because Pixi" \
176+
"\`${PIXI_VERSION}\` reproduced the exact known samples-source" \
177+
"pruning defect. Other workspaces were refreshed normally."
178+
fi
133179
echo
134-
echo "Lockfiles included in the refresh:"
180+
echo "Lockfiles covered by the refresh:"
135181
python3 ci/tools/list_pixi_workspaces.py \
136182
| jq -r '.[] | "- `\(.lockfile)`"'
137183
echo
@@ -184,4 +230,7 @@ jobs:
184230
else
185231
echo "- No lockfile diff; PR not opened."
186232
fi
233+
if [[ "${{ steps.update.outputs.known-defect-skipped }}" == "true" ]]; then
234+
echo "- \`cuda_core/pixi.lock\` retained its committed state because the exact known Pixi samples-source pruning defect was detected."
235+
fi
187236
} >> "$GITHUB_STEP_SUMMARY"

‎ci/README.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ For PRs, the base must produce identical original and repaired blobs, and no
4545
`pixi.toml`, `pyproject.toml`, or Pixi-version input may differ from the base.
4646
Recognized cases emit a warning and restore the committed references.
4747

48+
The refresh workflow uses the same exact detector after updating `cuda_core`.
49+
On a match, it restores the pre-update committed lockfile and continues
50+
refreshing the other workspaces. This postpones `cuda_core` dependency updates
51+
without allowing an unstable lockfile into the generated refresh PR; every
52+
unrecognized refresh failure remains fatal.
53+
4854
Remove the detector and exception, and restore `PIXI_LOCKED=true`, once a
4955
released Pixi passes repeated lock and check commands without changing either
50-
the reduced upstream reproducer or our full workspaces. The refresh workflow
51-
still refuses to open an unstable lockfile-refresh PR.
56+
the reduced upstream reproducer or our full workspaces.
5257

5358
## Repository Customizations
5459

0 commit comments

Comments
 (0)