Skip to content

cli(upgrade): fix 404 — drop version from tarball filename (#352) - #377

Merged
danielraffel merged 2 commits into
mainfrom
feature/pulp-upgrade-asset-fix
Apr 17, 2026
Merged

cli(upgrade): fix 404 — drop version from tarball filename (#352)#377
danielraffel merged 2 commits into
mainfrom
feature/pulp-upgrade-asset-fix

Conversation

@danielraffel

Copy link
Copy Markdown
Collaborator

Summary

pulp upgrade 404'd on every run because the CLI built download URLs
using pulp-<version>-<platform>-<arch>.<ext> and x86_64, while the
release workflow uploads assets as pulp-<platform>-<arch>.<ext> with
x64. This PR pins the URL shape to the release workflow and adds a
Catch2 regression guard so the two can't drift silently again.

This is the second half of #352; the first half (pulp prshipyard pr
shim) is in-flight as #376. Fixing both gets pulp upgrade and pulp pr
back to parity with their documented behavior.

Changes

  • tools/cli/upgrade_url.hpp — new header-only URL/asset builder so
    the regression test can pin the naming convention without linking
    cmd_misc's transitive CLI deps.
  • tools/cli/cmd_misc.cpp — replace the local helper (which baked
    the version into the filename and used x86_64) with a call into
    pulp::cli::pulp_upgrade_url_for().
  • test/test_cli_upgrade_url.cpp — 6 Catch2 cases against real
    v0.14.0 release naming, including one that explicitly fails if a
    future refactor re-introduces the version in the filename.

Convention (pinned by the header + tests)

Asset = "pulp-<platform>-<arch>.<ext>"   (no version in the filename)
URL   = ".../releases/download/v<version>/<asset>"
arch  = "arm64" | "x64"                   (NOT "x86_64")
ext   = "zip" for windows, "tar.gz" otherwise

Mirrors .github/workflows/release-cli.yml.

Test plan

  • New pulp-test-cli-upgrade-url runs green locally (10 assertions,
    6 cases).
  • cmake --build build --target pulp-cli succeeds (refactor
    compiles end-to-end).
  • CI green on macOS / Ubuntu / Windows via shipyard.
  • Manual spot check post-merge: pulp upgrade against a real
    release downloads successfully.

Closes #352.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d963ea69d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/cli/cmd_misc.cpp
std::string ext = (platform == "windows") ? "zip" : "tar.gz";
std::string tarball = "pulp-" + version + "-" + platform + "-" + arch + "." + ext;
std::string url = "https://github.com/danielraffel/pulp/releases/download/v" + version + "/" + tarball;
auto [tarball, url] = pulp::cli::pulp_upgrade_url_for(version, platform, arch);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Handle Windows zip upgrade payloads end-to-end

After this change, Windows now targets pulp-windows-*.zip assets, but the rest of cmd_upgrade still follows the Unix tarball path (tar -xzf) and later expects ${tmp_dir}/pulp. The release workflow packages Windows as pulp.exe inside a zip, so on Windows the download can succeed and then fail during extraction or binary lookup, leaving pulp upgrade broken for that platform.

Useful? React with 👍 / 👎.

`pulp upgrade` constructed asset names as "pulp-<version>-<platform>-<arch>.<ext>"
and used "x86_64" for the Linux x64 arch. Both diverge from what
.github/workflows/release-cli.yml actually uploads, so every upgrade
404'd on the download step.

Release workflow naming (authoritative):
  Asset = "pulp-<platform>-<arch>.<ext>"  (no version in the filename)
  URL   = ".../releases/download/v<version>/<asset>"
  arch  = "arm64" | "x64"  (NOT "x86_64")
  ext   = "zip" for windows, "tar.gz" otherwise

Changes
- tools/cli/upgrade_url.hpp: header-only URL/asset builder. Kept as a
  header so tests pin the naming convention without linking cmd_misc's
  transitive CLI deps.
- tools/cli/cmd_misc.cpp: replace the local helper + version-in-filename
  bug with a call into upgrade_url.hpp. Drops x86_64 → x64 and the
  version segment.
- test/test_cli_upgrade_url.cpp: 6 Catch2 cases that pin asset names
  and URL shape against real v0.14.0 releases — including an explicit
  guard that the version never reappears in the filename.

Tests-ship-with-fixes: this is a correctness fix, and the 6 cases here
are the regression guard that keeps the convention wired to the release
workflow.

Closes #352.
@danielraffel
danielraffel force-pushed the feature/pulp-upgrade-asset-fix branch from d963ea6 to 6a2bb8c Compare April 17, 2026 19:03
Unblocks the skill-sync gate on PR #377: modifying cmd_misc.cpp maps
to the cli-maintenance skill, and the asset-name/URL convention the
upgrade helper relies on is exactly the kind of brittle-invariant
gotcha this skill is supposed to capture.
@danielraffel
danielraffel merged commit ca790e0 into main Apr 17, 2026
9 of 13 checks 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.

cli: consolidate pulp pr with shipyard pr + fix pulp upgrade 404

1 participant