Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

[Backport 5.2] fix installSrc in executors#59391

Merged
DaedalusG merged 2 commits into
5.2from
backport-57572-to-5.2
Jan 9, 2024
Merged

[Backport 5.2] fix installSrc in executors#59391
DaedalusG merged 2 commits into
5.2from
backport-57572-to-5.2

Conversation

@sourcegraph-release-bot

Copy link
Copy Markdown
Collaborator

Use client for auth in HTTP request not options apiclient.EndpointOptions
Correctly adds auth header to request
internal context: https://sourcegraph.slack.com/archives/C01JR51JR5J/p1697050361943039

Test plan

Tested the request construction locally against sgdev:

λ ~/sourcegraph/ wg/fix-executor-installSrc EXECUTOR_FRONTEND_URL=https://k8s.sgdev.org EXECUTOR_FRONTEND_PASSWORD=REDACTED go run ./cmd/executor install src-cli --bin-dir ~
λ ~/sourcegraph/ wg/fix-executor-installSrc ~/src version
Current version: 5.2.0
Recommended version: 5.2.0 or later

Printing the new request

λ ~/sourcegraph/ wg/fix-executor-installSrc EXECUTOR_FRONTEND_URL=https://k8s.sgdev.org/ EXECUTOR_FRONTEND_PASSWORD=REDACTED go run ./cmd/executor install src-cli --bin-dir ~
Request:  &{GET https://k8s.sgdev.org/.api/src-cli/version HTTP/1.1 1 1 map[Authorization:[token-executor REDACTED] Content-Type:[application/json]] {0xc0002cf470} 0x1321dc0 4 [] false k8s.sgdev.org map[] map[] <nil> map[]   <nil> <nil> <nil> 0xc000124010}

Printing the old request

λ ~/sourcegraph/ main EXECUTOR_FRONTEND_URL=https://k8s.sgdev.org/ EXECUTOR_FRONTEND_PASSWORD=REDACTED go run ./cmd/executor install src-cli --bin-dir ~
Request:  &{GET https://k8s.sgdev.org/.api/src-cli/version HTTP/1.1 1 1 map[Content-Type:[application/json]] {0xc0002a2f30} 0x1321dc0 4 [] false k8s.sgdev.org map[] map[] <nil> map[]   <nil> <nil> <nil> 0xc00011c010}


Backport 4012e57 from #57572

* untested refactor remove options apiclient.EndpointOptions

* possible fix after testing

(cherry picked from commit 4012e57)
@sourcegraph-bot

sourcegraph-bot commented Jan 8, 2024

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 09e5b7f...32e48f0.

Notify File(s)
@efritz cmd/executor/internal/run/install.go
cmd/executor/internal/run/run.go
cmd/executor/internal/run/validate.go
cmd/executor/internal/util/srccli.go
cmd/executor/internal/util/srccli_test.go
cmd/executor/internal/util/validate.go
cmd/executor/internal/util/validate_test.go

@sourcegraph-bot

sourcegraph-bot commented Jan 8, 2024

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@DaedalusG DaedalusG merged commit ac23781 into 5.2 Jan 9, 2024
@DaedalusG DaedalusG deleted the backport-57572-to-5.2 branch January 9, 2024 22:30
@varungandhi-src varungandhi-src mentioned this pull request Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants