Skip to content

Claude/dependabot updates counter risk j z8vg#335

Merged
stranske merged 7 commits intomainfrom
claude/dependabot-updates-counter-risk-jZ8vg
Mar 28, 2026
Merged

Claude/dependabot updates counter risk j z8vg#335
stranske merged 7 commits intomainfrom
claude/dependabot-updates-counter-risk-jZ8vg

Conversation

@stranske
Copy link
Copy Markdown
Owner

No description provided.

claude and others added 6 commits March 28, 2026 20:54
- 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
Copilot AI review requested due to automatic review settings March 28, 2026 23:14
@agents-workflows-bot
Copy link
Copy Markdown
Contributor

⚠️ Action Required: Unable to determine source issue for PR #335. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.xlsm from assets/templates/counter_risk_template.xlsm during assemble_release() via build_xlsm_artifact() (injects metadata into docProps/core.xml).
  • Update/extend release bundle tests to use a minimal valid XLSM zip and assert version injection.
  • Add a Release GitHub 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.

- name: Checkout repository
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref || github.ref }}
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
ref: ${{ inputs.ref || github.ref }}
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || github.ref }}

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +61
- 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

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +99 to 106
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."
)
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_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.

Copilot uses AI. Check for mistakes.
@agents-workflows-bot
Copy link
Copy Markdown
Contributor

🤖 Keepalive Loop Status

PR #335 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Disposition skipped (transient)
Gate failure
Tasks 0/0 complete
Timeout 45 min (default)
Timeout usage 5m elapsed (12%, 40m remaining)
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

@agents-workflows-bot
Copy link
Copy Markdown
Contributor

Keepalive Work Log (click to expand)
# Time (UTC) Agent Action Result Files Tasks Progress Commit Gate
0 2026-03-28 23:20:04 Codex wait (missing-agent-label-transient) skipped 0 0/0 failure

- 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
@stranske stranske merged commit ccff837 into main Mar 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants