Skip to content

feat(helpers4-common): add h4_arch_musl_triple and h4_github_latest_tag - #95

Merged
baxyz merged 2 commits into
mainfrom
feat/h4-common-arch-helpers
Sep 9, 2026
Merged

feat(helpers4-common): add h4_arch_musl_triple and h4_github_latest_tag#95
baxyz merged 2 commits into
mainfrom
feat/h4-common-arch-helpers

Conversation

@baxyz

@baxyz baxyz commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extracted two shared helpers from duplicated logic in git-absorb and bitwarden-secrets-manager: h4_arch_musl_triple (uname -m → Rust musl target-triple) and h4_github_latest_tag <owner/repo> [prefix] (GitHub latest-release resolution, with prefix filtering for monorepos like bitwarden/sdk-sm).
  • github-dev's own arch mapping uses a different convention (GitHub CLI's own asset naming), not a duplicate — left feature-local.
  • An "official installer" helper (for nub/vite-plus/claude-dev) was evaluated but not extracted — each invocation differs in ways that matter (fatal vs. degraded failure, different su argument-passing, different env vars); forcing a shared wrapper risked the same kind of silent bug just found and fixed in vite-plus's own installer call.
  • Purely additive to helpers4-common — no existing feature's behavior changes until it opts in.

Consumer refactor (git-absorb, bitwarden-secrets-manager switching to use these) is a separate, follow-up PR — dependsOn resolves from the published GHCR registry, so it needs this merged and republished first.

Test plan

  • Verified both functions directly against the real GitHub API in a container (h4_arch_musl_triple, h4_github_latest_tag against tummychow/git-absorb and bitwarden/sdk-sm with a bws- prefix, plus the pipefail-safe empty-result path on a nonexistent repo)
  • CI green on this PR

baxyz and others added 2 commits September 9, 2026 17:40
…_tag

Extracted from duplicated logic in git-absorb and bitwarden-secrets-manager:
- h4_arch_musl_triple maps uname -m to the x86_64-unknown-linux-musl /
  aarch64-unknown-linux-musl target-triple convention those two features'
  Rust binaries use.
- h4_github_latest_tag <owner/repo> [prefix] resolves a GitHub repo's
  latest release tag, optionally filtered by prefix for a monorepo
  publishing several tools under one repo (bitwarden/sdk-sm's bws-
  releases).

github-dev's own arch mapping (amd64/arm64/armv6, GitHub CLI's own
asset-naming convention) is a different scheme, not a duplicate of the
musl triple above, so it stays feature-local. An "official installer"
helper (curl-installer scripts used by nub, vite-plus, claude-dev) was
evaluated too, but each invocation differs in ways that matter (fatal vs.
degraded failure, different su argument-passing styles, different env
vars) — forcing a shared wrapper risked the same kind of silent behavior
change already found and fixed once in vite-plus's own installer call, so
left feature-local.

Purely additive — existing features' behavior is unchanged until they
opt in (see the git-absorb/bitwarden-secrets-manager follow-up, which
needs this published first since dependsOn resolves from GHCR).

Verified both functions directly against the real GitHub API in a
container: h4_arch_musl_triple, h4_github_latest_tag against
tummychow/git-absorb (no prefix) and bitwarden/sdk-sm with a bws- prefix,
and the pipefail-safe empty-result path on a nonexistent repo.

Closes the "Factor arch mapping / GitHub latest-release / official-
installer patterns into helpers4-common" roadmap item.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…helpers

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

✅ PR Validation Passed

All checks passed!


📋 Pipeline Status

Job Status
🧾 Conventional Commits passing
🔖 Version Bump passing
🧪 Feature Tests passing
🐚 ShellCheck passing

🤖 Generated by @helpers4 CI • 2026-09-09

@baxyz
baxyz merged commit cb4f1aa into main Sep 9, 2026
41 checks passed
@baxyz
baxyz deleted the feat/h4-common-arch-helpers branch September 9, 2026 18:35
baxyz added a commit that referenced this pull request Sep 9, 2026
…_github_latest_tag

Drops the inline architecture-detection and latest-release-resolution
logic in favor of the shared helpers added in helpers4-common (PR #95),
which this feature already depends on. No behavior change — verified
directly in a container: git-absorb still resolves and installs the
latest release correctly through the new code path.

Needs helpers4-common's h4-common-arch-helpers PR merged and republished
first — dependsOn resolves from GHCR, not this repo's local src/ tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
baxyz added a commit that referenced this pull request Sep 9, 2026
…arch/latest-release helpers

Drops the inline architecture-detection and latest-release-resolution
logic (including its own bws- prefix filtering for the sdk-sm monorepo)
in favor of the shared helpers added in helpers4-common (PR #95), which
this feature already depends on. No behavior change — verified directly
in a container: bws still resolves and installs the latest release
correctly through the new code path.

Needs helpers4-common's h4-common-arch-helpers PR merged and republished
first — dependsOn resolves from GHCR, not this repo's local src/ tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
baxyz added a commit that referenced this pull request Sep 9, 2026
…_github_latest_tag

Drops the inline architecture-detection and latest-release-resolution
logic in favor of the shared helpers added in helpers4-common (PR #95),
which this feature already depends on. No behavior change — verified
directly in a container: git-absorb still resolves and installs the
latest release correctly through the new code path.

Needs helpers4-common's h4-common-arch-helpers PR merged and republished
first — dependsOn resolves from GHCR, not this repo's local src/ tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
baxyz added a commit that referenced this pull request Sep 9, 2026
…arch/latest-release helpers

Drops the inline architecture-detection and latest-release-resolution
logic (including its own bws- prefix filtering for the sdk-sm monorepo)
in favor of the shared helpers added in helpers4-common (PR #95), which
this feature already depends on. No behavior change — verified directly
in a container: bws still resolves and installs the latest release
correctly through the new code path.

Needs helpers4-common's h4-common-arch-helpers PR merged and republished
first — dependsOn resolves from GHCR, not this repo's local src/ tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant