Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables users to specify custom HTTP headers in their profile, which the CLI will include on API requests. Key changes include:
- Adding a
headersfield to the profile and a helpergetProfileIfExist(). - Passing the loaded profile into the API client and injecting its headers.
- Bumping Go module/toolchain versions and the Docker base image.
Reviewed Changes
Copilot reviewed 5 out of 480 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updated Go version to 1.24.5 and bumped x/sys to v0.33.0 |
| generators/cmd/templates/leaf.gotmpl | Invoke getProfileIfExist() and pass Profile to client |
| generators/cmd/predefined/profiles.go | Add Headers to profile struct and getProfileIfExist |
| generators/cmd/predefined/apiclient.go | Store profile in client and inject headers into requests |
| build/Dockerfile | Bump Golang base image to 1.24.5 |
Comments suppressed due to low confidence (4)
generators/cmd/predefined/profiles.go:36
- Consider adding a doc comment above
Headersto explain its purpose and usage in the profile configuration.
Headers map[string]string `json:"headers,omitempty"`
generators/cmd/predefined/profiles.go:73
- [nitpick] The function name
getProfileIfExistcould be more grammatically consistent asgetProfileIfExistsorloadProfileOrNil.
func getProfileIfExist() *profile {
generators/cmd/predefined/apiclient.go:393
- Add unit tests to verify that
profile.Headersentries are correctly injected into outgoing HTTP requests.
if ac.profile != nil {
generators/cmd/templates/leaf.gotmpl:121
- The generated code now calls getProfileIfExist but may not import it; ensure the appropriate package import is added so the function resolves correctly.
profile := getProfileIfExist()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Profile に
headersを入れておくことで soracom-cli が API リクエストを送信する際に追加のヘッダーを設定できるようにしました。自動生成されたファイルも更新されましたのでファイル変更数は多いですが、
soracom/generatedディレクトリ以下の更新はすべて同じです。