feat: download fallback to latest release + cross-platform CI#112
Merged
feat: download fallback to latest release + cross-platform CI#112
Conversation
Addresses #110 where the plugin fails to start when the manifest version hasn't been released yet. Design covers fallback to latest GitHub release, a version subcommand, and cross-platform CI download tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add GITHUB_TOKEN auth handling to run.sh and run.bat fallback logic - Add detailed pseudocode for run.bat fallback (was underspecified) - Add version output assertions to CI download job - Add timeout-minutes to CI download job - Add tag validation (must match v[0-9]*) before retry - Add retry/max-time flags to fallback curl calls - Expand risks table with API non-JSON response mitigation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix run.sh AUTH_HEADER quoting: use bash array AUTH_ARGS instead of string with embedded quotes - Fix run.bat missing /repos/ path in GitHub API URL - Add --max-time and --retry flags to run.bat curl calls - Add tag format validation (findstr ^v[0-9]) to run.bat fallback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the version in .release-please-manifest.json has not been released yet (e.g. release-please bumped the manifest but goreleaser hasn't run), the download scripts now fall back to the latest published GitHub release instead of failing with a 404. Also adds: - `lumen version` subcommand with ldflags-injected build version - Cross-platform CI job (Linux, macOS, Windows) testing both happy path and fallback downloads with semver output assertions - 13 new offline tests for tag parsing, fallback URL construction, and tag validation Closes #110 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Table-driven tests verifying the version command outputs the correct buildVersion value for default, release, and pre-release versions. Also fixes the command to use cmd.OutOrStdout() for testability. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f634922 to
9955fcc
Compare
Two printf commands with ".": (colon + space) in plain YAML scalars caused the YAML parser to treat them as mapping separators, making the entire workflow file unparseable. Convert both run: values to block scalars to fix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace download CI job with cross-platform build-from-source job; lumen has no published releases yet so downloading from GitHub Releases is not possible — build with CGO_ENABLED=1 and verify version output - Fix errcheck lint violation in cmd/version.go (discard fmt.Fprintln return) - Realign .release-please-manifest.json to 0.0.32 to match distribution manifests and fix TestDistributionManifestVersionsStayAligned Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When built without ldflags, cmd.buildVersion defaults to "dev" which fails the semver pattern check. Read the version from .release-please-manifest.json and pass it via -ldflags at build time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Windows CGO builds need MinGW headers not present on the runner. Cross-compilation to Windows is handled by goreleaser at release time. Also simplify build/verify into a single step per platform. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Apr 8, 2026
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.
Summary
.release-please-manifest.jsondeclares a version that hasn't been released yet, the download scripts now fall back to the latest published GitHub release instead of failing with a 404lumen versionsubcommand (ldflags-injected via goreleaser)Closes #110
Changes
cmd/version.goversionsubcommand.goreleaser.ymlscripts/run.shscripts/run.batscripts/test_run.sh.github/workflows/ci.ymldownloadjob: 3-OS matrix, happy + fallback paths, version assertionsHow it works
https://api.github.com/repos/ory/lumen/releases/latesttag_namewithsed(nojqdependency), validates it matches^v[0-9]GITHUB_TOKENfor auth when available (CI), falls back to unauthenticated (end users)Test plan
scripts/test_run.sh— 34/34 tests pass (13 new)lumen versionprintsdevwithout ldflags, injected version with ldflagsdownloadjob passes on all 3 platforms (verify after merge)🤖 Generated with Claude Code