Skip to content

feat(builder): show when a newer Builder release exists - #68

Merged
github-actions[bot] merged 1 commit into
masterfrom
feat/update-check-67
Nov 5, 2026
Merged

github-actions[bot] merged 1 commit into
masterfrom
feat/update-check-67

Conversation

@endercodezz

Copy link
Copy Markdown
Owner

The Windows Builder shows when a newer release exists.

  • platform/pc/builder/update_check.{hpp,cpp} (no network code, unit-tested): version parsing (v1.2.3, strict), the top-level tag_name of a releases/latest response (nested objects ignored), comparison.
  • Wizard: on start, a detached thread GETs https://api.github.com/repos/endercodezz/P3P3DS/releases/latest with WinHTTP (5 s timeouts, User-Agent: P3P3DS-Builder/<version>). A newer tag shows a bottom-left button "Update: Builder X.Y.Z is available" that opens https://github.com/endercodezz/P3P3DS/releases/tag/<tag>, plus a close button. The URL is built from the validated tag, never taken from the response.
  • Off: --no-update-check or P3P3DS_NO_UPDATE_CHECK=1. --cli builds never check.
  • New flags: --check-update prints the result in a console; --version shows the version.
  • P3P3DS_UPDATE_URL overrides the URL for tests.
  • The version comes from builder.rc FileVersion through CMake, so a release still bumps one place and release.yml is unchanged.
  • The welcome text now says the Builder asks GitHub for the latest version, and how to turn that off.

Verified (Windows):

  • Real API: --check-update -> "latest release: v0.3.2; no update" in about 1 s.
  • Local server returning v9.9.9, with a foreign html_url and a nested tag_name: the banner appears (window capture), the page is built from the tag, the foreign URL is ignored.
  • Unreachable server: no banner; --check-update returns after about 2 s.
  • Server log: 0 requests from --cli, --no-update-check and P3P3DS_NO_UPDATE_CHECK=1.
  • Imports: system DLLs and UCRT as before, plus WINHTTP.dll.
  • test_update_check (versions, tag extraction from real-shaped, error, malformed and hostile responses, builder version = builder.rc). CTest 32/32.

[UNVERIFIED] The Linux console Builder gets --version only, no update check (statically linked, no TLS library).

Closes #67

On start the Windows wizard asks GitHub for the latest release on a
detached thread (WinHTTP, 5 s timeouts) and, if its tag is newer than
the Builder's version, shows a bottom-left button that opens the release
page. The page URL is built from the validated tag, never taken from
the response. --no-update-check or P3P3DS_NO_UPDATE_CHECK turn it off,
--cli never checks, --check-update prints the result, --version shows
the version. The version comes from builder.rc through CMake.

Verified: real API reports v0.3.2 and no update; a local server with
v9.9.9 shows the banner; an unreachable server shows nothing; 0 requests
from --cli, --no-update-check and the environment switch; imports stay
system DLLs plus WINHTTP; CTest 32/32.
@github-actions
github-actions Bot enabled auto-merge November 5, 2026 21:52
@github-actions
github-actions Bot merged commit 05354c0 into master Nov 5, 2026
7 checks passed
@endercodezz
endercodezz deleted the feat/update-check-67 branch November 6, 2026 15:04
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.

Builder: notify about a newer release (GitHub Releases check + banner)

1 participant