Skip to content

Follow-ups: Rosetta x86 / multi-platform cleanup (deferred from #279, #54) #283

Closed

Description

@rgarcia

Deferred, non-blocking cleanup opportunities identified during review of the Rosetta x86 / multi-platform PRs (#279, kernel/hypeman-cli#54). None affect behavior; they were intentionally left out to keep those PRs reviewable. Two are marked inline with TODO(followup) and link here.

hypeman (server)

  • Unify Resolve / ResolveForPlatform (lib/images/reference.go) — near-duplicate methods differing only by platform-aware vs platform-less manifest inspection; collapse behind one path. (inline TODO(followup))
  • createAndQueueImage re-resolves the platform (lib/images/manager.go) — CreateImage already parsed/validated the platform; pass it in instead of calling resolveRequestPlatform again, which also removes the effectively-unreachable error branch. (inline TODO(followup))
  • ResolvedRef.DigestRef() helper — replace hand-assembled repo + "@" + digest strings with a method on ResolvedRef.
  • conversionFailedErr(msg) helper — extract the 3 duplicated WaitForReady failure-message branches in lib/images/manager.go.
  • Single source of truth for the rate-limit user message — one package const, or fold the actionable hint into ErrRateLimited and use err.Error() in the handlers (cmd/api/api/{images,instances}.go).
  • Tests: assertFailsFastNotFound helper for the two structurally identical fail-fast restore tests; a generic captureManager[Req] to collapse the 4 near-identical capture mocks (cmd/api/api/instances_test.go).

hypeman-cli

  • Drop the platform WithJSONSet / RawJSON workarounds once the hypeman-go SDK exposes a typed platform field — inspect/image list/run/pull can then read the typed field directly. Marked inline with TODO(sdk-bump:...).

Filed from the reviewer cleanup pass; see the discussion on #279.

Activity

  1. rgarcia commented on Aug 7, 2026

    @rgarcia
    ContributorAuthor

    All actionable follow-ups are complete. The server cleanup landed in #369, #370, and #371, covering reference resolution, platform threading, digest references, error messages, and test-helper consolidation.

    The remaining hypeman-cli item is superseded: the CLI now uses typed SDK Platform fields everywhere relevant. Its remaining RawJSON() use is intentional general forward compatibility—not a platform workaround—so there is no cleanup left to perform here. Closing as complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions