Fix nondeterministic workflow catalog ZIP fixture - #4830
Open
KSchlobohm wants to merge 1 commit into
Open
KSchlobohm wants to merge 1 commit into
KSchlobohm wants to merge 1 commit into
Conversation
Assisted-by: GitHub Copilot App (model: GPT-6.1 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused test-only fix addresses the reproduced failure and includes appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Makes the workflow catalog ZIP fixture deterministic by removing clock-derived timestamps.
Changes:
- Uses a fixed
ZipInfotimestamp. - Adds regression coverage for clock boundaries and changed content.
| File | Description |
|---|---|
tests/specify_cli/workflows/test_catalog_versions.py |
Stabilizes ZIP bytes and tests determinism. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Merged
1 of 5 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Make the ZIP fixture in
tests/specify_cli/workflows/test_catalog_versions.pyindependent of the clock._entry()hashes an archive that the mock HTTP response later regenerates. Passing a filename toZipFile.writestr()inserts the current time; crossing a two-second ZIP timestamp boundary changes the bytes and digest even when the YAML is identical. This causedtest_exact_add_uses_historical_url_digest_and_requirementsto fail with an integrity-check error in the public fork's Windows/Python 3.13 CI job. A rerun can hide the timing dependency without fixing it.Use
ZipInfowith a fixed timestamp of(1980, 1, 1, 0, 0, 0). The member name, YAML serialization, single-member layout, andZIP_STOREDcompression stay unchanged. Add a regression that mocks the clock across a two-second boundary, checks identical inputs produce identical bytes, and checks changed versions or requirements still produce different bytes.This is the test-only delta from KSchlobohm/spec-kit#57: one file, 22 insertions and one deletion. No production or workflow configuration changes.
Testing
uv run specify --helpuv sync && uv run pytestAutomated validation used this worktree's own
.venv\Scripts\python.exeon Windows, Python 3.11.5, against upstream baselinede0cbd762e2d0b30f90d3ffcbe2ee9d7167f4eda(including merged #4829).uv sync --extra test-m pytest -c <worktree>\pyproject.toml <baseline-copy>::test_archive_is_deterministic_across_clock_changes -q.venv\Scripts\python.exe -m pytest tests\specify_cli\workflows\test_catalog_versions.py::test_archive_is_deterministic_across_clock_changes -q.venv\Scripts\python.exe -m pytest tests\specify_cli\workflows\test_catalog_versions.py -qgit diff --checkandgit diff --cached --checkThe template's literal
uv sync && uv run pytestcommand was not used; the targeted tests above ran through the worktree interpreter to avoid cross-worktree editable-install resolution. CLI help and sample-project tests were not run because this changes only a test fixture. The full suite and local Python 3.13 were not run, and no hosted CI run was created. Later green fork CI does not establish isolated upstream CI results for this patch.AI Disclosure
AI disclosure: GitHub Copilot App using GPT-6.1 Sol authored the original fixture fix and regression autonomously, with runtime-default reasoning effort and human publication approval. GitHub Copilot App using GPT-6.1 Sol (model ID
gpt-6.1-sol) prepared this upstream patch, ran automated validation, and drafted this body in autonomous/autopilot mode. Preparation reasoning effort was runtime-selected, not explicitly overridden; its exact level was not exposed. This preparation does not claim human line-by-line review or human-run testing. Publication was approved by the contributor.