Claude/dependabot updates counter risk j z8vg#335
Conversation
- release.py: replace _copy_runner_xlsm (which copied the raw root-level Runner.xlsm) with _build_runner_xlsm, which calls build_xlsm_artifact to produce a versioned counter_risk_runner.xlsm from assets/templates/counter_risk_template.xlsm with version metadata injected into docProps/core.xml; raises ValueError if template missing - tests: provide a minimal valid XLSM ZIP in _write_fake_repo via _make_minimal_xlsm(); update runner_xlsm tests to exercise _build_runner_xlsm and verify version metadata is present in output; update fail-fast test to check for missing template, not missing Runner.xlsm - RELEASE_CHECKLIST.md: add Windows prerequisite note; add new bundle artifacts to validation checks and expected contents list; add config path update step; add macro trust confirmation step; remove stale explicit xlsm build step from main sequence (now internal to assembler) https://claude.ai/code/session_01D7662TN52iZPqh1HgAFBRQ
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The date symbol became unused after _build_runner_xlsm was updated to call run_date.date() instead of date.today(). Removes the F401 ruff violation. https://claude.ai/code/session_01D7662TN52iZPqh1HgAFBRQ
Adds a workflow_dispatch + tag-push triggered GitHub Actions job (windows-latest) that: - Runs PyInstaller to produce counter-risk.exe - Assembles the full versioned operator bundle via the release assembler - Validates all required bundle artifacts - Uploads the bundle as a downloadable Actions artifact Satisfies the "Run the release workflow in CI" step in RELEASE_CHECKLIST.md. https://claude.ai/code/session_01D7662TN52iZPqh1HgAFBRQ
Path.replace() (os.replace) fails with WinError 17 when the temp file and the destination are on different drives (e.g. C:\Temp -> D:\release on Windows CI runners). shutil.move handles cross-device moves correctly by falling back to copy+delete when rename fails. https://claude.ai/code/session_01D7662TN52iZPqh1HgAFBRQ
There was a problem hiding this comment.
Pull request overview
Updates the release bundling flow so the operator runner workbook is generated from the XLSM template during bundle assembly (with injected version metadata), and adds automation/docs to support producing a Windows release artifact.
Changes:
- Build
counter_risk_runner.xlsmfromassets/templates/counter_risk_template.xlsmduringassemble_release()viabuild_xlsm_artifact()(injects metadata intodocProps/core.xml). - Update/extend release bundle tests to use a minimal valid XLSM zip and assert version injection.
- Add a
ReleaseGitHub Actions workflow and update the release checklist to reflect the new runner build behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_release_bundle.py | Adjusts tests/fixtures to generate a minimal XLSM and validates runner metadata injection. |
| src/counter_risk/build/xlsm.py | Changes zip member replacement to use shutil.move for temp file finalization. |
| src/counter_risk/build/release.py | Switches from copying a repo-root Runner.xlsm to building the runner XLSM from the template during assembly. |
| docs/RELEASE_CHECKLIST.md | Documents prerequisites and updated bundle contents/runner build process. |
| .github/workflows/release.yml | Adds a Windows release workflow that assembles and uploads the operator bundle. |
.github/workflows/release.yml
Outdated
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ inputs.ref || github.ref }} |
There was a problem hiding this comment.
ref: ${{ inputs.ref || github.ref }} is likely invalid in a normal workflow: the inputs.* context is for workflow_call (reusable workflows), while workflow_dispatch inputs are accessed via github.event.inputs. As written, this can cause workflow validation errors or ignore the dispatch input. Use github.event.inputs.ref (optionally guarded by github.event_name == 'workflow_dispatch') and fall back to github.ref for tag pushes.
| ref: ${{ inputs.ref || github.ref }} | |
| ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || github.ref }} |
.github/workflows/release.yml
Outdated
| - name: Build executable with PyInstaller | ||
| run: pyinstaller -y release.spec | ||
|
|
||
| - name: Assemble release bundle | ||
| run: > | ||
| python -m counter_risk.build.release | ||
| --version-file VERSION | ||
| --output-dir release | ||
| --force | ||
|
|
There was a problem hiding this comment.
This workflow builds the executable twice: there’s an explicit pyinstaller -y release.spec step, and python -m counter_risk.build.release ... also runs PyInstaller via _copy_bundled_executable()/_run_pyinstaller() in src/counter_risk/build/release.py. Consider removing the standalone PyInstaller step, or add an option to assemble_release to skip rebuilding when dist/... already exists.
| def _build_runner_xlsm(root: Path, bundle_dir: Path, version: str) -> list[Path]: | ||
| template = root / "assets" / "templates" / "counter_risk_template.xlsm" | ||
| if not template.is_file(): | ||
| raise ValueError( | ||
| f"Required Excel runner not found at '{src}'. " | ||
| "Ensure Runner.xlsm is present in the repository root before building a release." | ||
| f"Required XLSM template not found at '{template}'. " | ||
| "Ensure assets/templates/counter_risk_template.xlsm is present " | ||
| "before building a release." | ||
| ) |
There was a problem hiding this comment.
_build_runner_xlsm hardcodes the template path (assets/templates/counter_risk_template.xlsm) even though counter_risk.build.xlsm already provides template_xlsm_path(...). Reusing the shared helper would avoid path drift if the template location changes again.
🤖 Keepalive Loop StatusPR #335 | Agent: Codex | Iteration 0/5 Current State
🔍 Failure Classification| Error type | infrastructure | |
Keepalive Work Log (click to expand)
|
- release.yml: fix checkout ref to use github.event.inputs.ref (not inputs.ref which is workflow_call context); remove standalone pyinstaller step since assemble_release already builds the exe via _copy_bundled_executable - release.py: use template_xlsm_path(root) from xlsm module instead of hardcoding the template path, preventing drift if the location changes https://claude.ai/code/session_01D7662TN52iZPqh1HgAFBRQ
No description provided.