Skip to content

Resync publish_release.py with the wincompose copy - #129

Merged
thpoll83 merged 1 commit into
mainfrom
claude/wincompose-install-menu-3f8cy8
Aug 1, 2026
Merged

Resync publish_release.py with the wincompose copy#129
thpoll83 merged 1 commit into
mainfrom
claude/wincompose-install-menu-3f8cy8

Conversation

@thpoll83

@thpoll83 thpoll83 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

scripts/publish_release.py is meant to be byte-identical across the repos it serves. thpoll83/wincompose#2 moved that repo's copy ahead by teaching it a third repo; this brings the host copy back in line. No behaviour change here — only detect() gains a wincompose branch, parse_version() gains a wincompose case, and the docstring/closing hint mention it.

The wincompose branch resolves version from the csproj <AssemblyVersion>, tag prefix PK- (per its GitVersion.yml), target branch main.

Verified byte-identical to wincompose/scripts/publish_release.py (cmp), and the host path still resolves exactly as before:

repo    : thpoll83/PolyKybdHost  (host)
tag     : v0.10.1   target: main
title   : v0.10.1 — All nine modifier overlays + WinCompose install

The matching PR for qmk_firmware is on the same branch name there.

Version bump label

(none) — patch. Release tooling only; nothing in polyhost/ is touched.

Testing

  • Tested locally against real hardware
  • Tested with mock device (if UI changes)

Not applicable — no runtime code. Exercised via python scripts/publish_release.py --dry-run in this checkout (output above), which reads the release-notes branch and the default-branch version without changing anything.


Generated by Claude Code

Summary by Sourcery

Extend publish_release tooling to support the wincompose repository alongside firmware and host releases.

New Features:

  • Add wincompose repository auto-detection and version parsing from wincompose.csproj.
  • Trigger wincompose release CI to build and attach installer, portable ZIP, and checksum assets.

Enhancements:

  • Update script documentation to describe wincompose support, tag format, and default branch behavior.

Summary by CodeRabbit

  • New Features
    • Added release publishing support for the WinCompose project.
    • Release documentation now includes WinCompose tags and downloadable installer, portable ZIP, and checksum assets.
    • Publication results now report when WinCompose assets are generated.

The script is meant to be byte-identical across the repos it serves, and
thpoll83/wincompose#2 moved its copy ahead by teaching detect()/parse_version()
about a third repo: version from the csproj <AssemblyVersion>, tag prefix PK-
(GitVersion.yml), target branch main.

Nothing changes for this repo — the host branch of detect() is untouched and a
dry-run still resolves the same tag:

    repo    : thpoll83/PolyKybdHost  (host)
    tag     : v0.10.1   target: main

Verified byte-identical to wincompose scripts/publish_release.py.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011PNCWo57UmMMfaNWyfJMBG

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @thpoll83, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@sourcery-ai

sourcery-ai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Reviewer's Guide

Extend publish_release.py to support a third repository (wincompose) while keeping behavior consistent and scripts byte-identical across repos, by adding detection, version parsing, documentation, and CI messaging for wincompose releases.

Flow diagram for repo detection and version parsing with wincompose support

flowchart TD
    A[root directory] --> B[detect]
    B -->|firmware present| C[return kind firmware<br/>config.h<br/>branch PolyKybd<br/>tag prefix PolyKybd-fw-v]
    B -->|host present| D[return kind host<br/>polyhost/_version.py<br/>branch main<br/>tag prefix v]
    B -->|wincompose present| E[return kind wincompose<br/>wincompose.csproj<br/>branch main<br/>tag prefix PK-]
    B -->|none present| F[die can't tell which repo this is]

    C --> G[show reads ref_path]
    D --> G
    E --> G

    G --> H[parse_version]
    H -->|kind firmware| I[extract FW_VERSION from config.h]
    H -->|kind wincompose| J[extract AssemblyVersion from wincompose.csproj]
    H -->|kind host| K[extract __major__/__minor__/__patch__]

    H --> L[main constructs release]
    L --> M[print html_url]
    M -->|kind firmware| N[print firmware CI will attach .bin/.uf2]
    M -->|kind wincompose| O[print wincompose CI will attach installer, portable zip, SHA256SUMS]
    M -->|kind host| P[end without extra message]
Loading

File-Level Changes

Change Details Files
Add repo auto-detection and tagging support for wincompose in the release script.
  • Extend repo detection to recognize a wincompose checkout via the presence of src/wincompose/wincompose.csproj.
  • Return wincompose-specific metadata from detect(), including the version source path, target branch main, and tag prefix PK-.
  • Update the error message when detection fails to mention the wincompose.csproj check.
scripts/publish_release.py
Parse wincompose version information from the csproj AssemblyVersion.
  • Add a wincompose case in parse_version() that regex-extracts the AssemblyVersion from wincompose.csproj.
  • Format the extracted major/minor/patch components into a standard x.y.z version string.
  • Emit a clear error if AssemblyVersion cannot be found in wincompose.csproj.
scripts/publish_release.py
Update documentation and runtime messaging to describe wincompose behavior and CI integration.
  • Expand the top-level script docstring to list wincompose as a supported repo and describe its version source, tag prefix, target branch, and release assets.
  • Clarify that publish_release triggers wincompose’s release: published workflow to build and attach installer, portable zip, and SHA256SUMS.
  • Add a post-publish message for the wincompose kind in main() explaining what CI will attach.
scripts/publish_release.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3191807f-1c51-428c-b0c2-ecbe0160af6c

📥 Commits

Reviewing files that changed from the base of the PR and between 8ff859f and fa0b242.

📒 Files selected for processing (1)
  • scripts/publish_release.py

📝 Walkthrough

Walkthrough

The release publishing script now supports the wincompose repository. It detects the project file, reads AssemblyVersion, documents PK- tags and CI assets, and reports generated installer, portable ZIP, and checksum files.

Changes

Wincompose release publishing

Layer / File(s) Summary
Repository detection and version parsing
scripts/publish_release.py
The script detects src/wincompose/wincompose.csproj and reads its <AssemblyVersion> value.
Release guidance and asset reporting
scripts/publish_release.py
The documentation and post-publication output describe PK-<version> tags and CI-generated release assets.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies synchronizing publish_release.py with the wincompose copy, which matches the main change.
Description check ✅ Passed The description includes the required Summary, Version bump label, and Testing sections, with clear scope and verification details.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thpoll83
thpoll83 merged commit ff8ac3b into main Aug 1, 2026
1 of 2 checks passed
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Sync publish_release.py with wincompose support (csproj version + PK- tags)

✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Extend release publisher to detect and version the wincompose repo.
• Derive wincompose version from csproj  and use PK- tag prefix.
• Update docstring and post-publish hints to mention wincompose artifacts.
Diagram

graph TD
  U["Release engineer"] --> S["scripts/publish_release.py"] --> D["detect() repo kind"] --> V["Read version source"] --> P["parse_version()"] --> N["Read release-notes <TAG>.md"] --> G{{"GitHub Release API"}} --> W{{"CI: release workflow"}}
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Centralize the script as a shared package/submodule
  • ➕ Eliminates drift between repos; no need to manually keep files byte-identical
  • ➕ Allows versioned distribution and changelogging of release tooling
  • ➖ Adds dependency management overhead (submodule updates / packaging / release process)
  • ➖ May complicate bootstrapping for contributors who just want a single script
2. Fetch canonical script during CI/release (curl/pinned commit)
  • ➕ Ensures the latest approved script is used without copy-pasting
  • ➕ Can pin to a known-good revision for reproducibility
  • ➖ Introduces network/repo availability dependency at release time
  • ➖ Harder to run offline; adds trust/supply-chain considerations

Recommendation: Given the explicit goal of keeping the script byte-identical across repos, this PR’s approach is appropriate and low-risk: it adds the missing wincompose branches while preserving existing host/firmware behavior. If drift continues to be a recurring maintenance issue, consider centralizing the script (package/submodule) as a follow-up, but that’s likely overkill for the current scope.

Files changed (1) +24 / -8

Enhancement (1) +24 / -8
publish_release.pyAdd wincompose repo detection and csproj-based version parsing +24/-8

Add wincompose repo detection and csproj-based version parsing

• Updates the top-level docstring to include wincompose behavior and artifacts. Extends detect() to recognize wincompose via src/wincompose/wincompose.csproj and sets tag prefix PK- with target branch main. Adds a wincompose case in parse_version() to parse <AssemblyVersion> (major.minor.patch) and prints a wincompose-specific post-publish CI hint.

scripts/publish_release.py

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.

2 participants