fix: repair master build after conflicting merges #96

Merged
benvin merged 1 commits from benvin/fix-master-build into master 2026-07-02 22:36:09 +10:00
Owner

Why

master does not compile. Three PRs that each built individually combined badly:

  • #92 changed fetchBearerToken to return (string, time.Duration, error) and added cachedBearerToken (which hashes the challenge via sha256Hash).
  • #94 (streaming) removed the now-unused-in-that-PR sha256Hash helper and its crypto/sha256 / encoding/hex imports.
  • #89 (HEAD) added headUpstream, which calls fetchBearerToken expecting two return values.

Result on master: internal/proxy/engine.go fails to build (assignment mismatch: 2 variables but fetchBearerToken returns 3 values; undefined: sha256Hash).

Changes

  • Re-add the sha256Hash helper and its crypto/sha256 + encoding/hex imports.
  • Fix the headUpstream 401 path to handle fetchBearerTokens three return values.

Validation

  • go build ./..., go vet, and make e2e all pass.

Should merge before the other in-flight branches so they rebase onto a compiling master.

## Why `master` does not compile. Three PRs that each built individually combined badly: - #92 changed `fetchBearerToken` to return `(string, time.Duration, error)` and added `cachedBearerToken` (which hashes the challenge via `sha256Hash`). - #94 (streaming) removed the now-unused-in-that-PR `sha256Hash` helper and its `crypto/sha256` / `encoding/hex` imports. - #89 (HEAD) added `headUpstream`, which calls `fetchBearerToken` expecting two return values. Result on `master`: `internal/proxy/engine.go` fails to build (`assignment mismatch: 2 variables but fetchBearerToken returns 3 values`; `undefined: sha256Hash`). ## Changes - Re-add the `sha256Hash` helper and its `crypto/sha256` + `encoding/hex` imports. - Fix the `headUpstream` 401 path to handle `fetchBearerToken`s three return values. ## Validation - `go build ./...`, `go vet`, and `make e2e` all pass. Should merge before the other in-flight branches so they rebase onto a compiling `master`.
unkinben added 1 commit 2026-07-02 22:29:45 +10:00
fix: repair master build after conflicting merges
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
6a1c836513
Merging the bearer-token cache (#92), streaming (#94) and HEAD (#89) PRs
independently left master not compiling: fetchBearerToken now returns
three values but headUpstream still assigned two, and cachedBearerToken
referenced sha256Hash which the streaming PR had removed. Restore the
sha256Hash helper (with its crypto/sha256 + encoding/hex imports) and fix
the headUpstream call site.
benvin merged commit 7e07eaa758 into master 2026-07-02 22:36:09 +10:00
benvin deleted branch benvin/fix-master-build 2026-07-02 22:36:10 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#96