-
Notifications
You must be signed in to change notification settings - Fork 2
Update fork base to v0.7.8 to add RateLimitLinearJitterBackoff #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[COMPLIANCE] Add Copyright and License Headers
IND-3836 additions of new parameters to dependabot.yml
- Add last status code to error message
- Use retry after only if lower than max
Remove secrets from URLs when logging We use go-retryablehttp when uploading data to presigned URLs and retries/errors are logging the URLs.
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| go-version: ['1.23', '1.22'] | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 | ||
| with: | ||
| go-version: ${{matrix.go-version}} | ||
|
|
||
| - name: Run golangci-lint | ||
| uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 | ||
|
|
||
| - name: Run unit tests and generate coverage report | ||
| run: make test | ||
|
|
||
| - name: Upload coverage report | ||
| uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 | ||
| with: | ||
| path: coverage.out | ||
| name: Coverage-report-${{matrix.go-version}} | ||
|
|
||
| - name: Display coverage test | ||
| run: go tool cover -func=coverage.out | ||
|
|
||
| - name: Build Go | ||
| run: go build ./... |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix the problem, the workflow should explicitly declare least-privilege GITHUB_TOKEN permissions. Since this job only checks out code, runs Go tooling, and uploads artifacts, it needs only read access to repository contents, and does not need write access to any scopes.
The best fix with no functional change is to add a permissions block with contents: read. This can be done at the workflow root (applies to all jobs) or for the specific job. Here, we will add it at the root level right after the name line to clearly restrict permissions for the entire workflow. Concretely, in .github/workflows/pr-unit-tests.yaml, insert:
permissions:
contents: readbetween the existing name: Unit tests and the on: block. No imports or additional methods are required; this is purely a YAML configuration change.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Unit tests | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| pull_request: | ||
| types: ['opened', 'synchronize'] |
Summary
v0.7.8(upstream) to includeRateLimitLinearJitterBackofffunctionMotivation
vault/api@v1.22.0(pulled transitively bysigstore/fulcio@v1.8.3) requiresRateLimitLinearJitterBackofffromgo-retryablehttp v0.7.8. This function was missing in our fork based onv0.7.7, causing build failures when usinggo.work:../../../go/pkg/mod/github.com/hashicorp/vault/api@v1.22.0/client.go:264:31: undefined: retryablehttp.RateLimitLinearJitterBackoff
Changes
Rebased wiz-specific commits onto upstream v0.7.8:
WZ-42693- Add last status code to error messageWZ-42693- Use retry after only if lower than maxPRSEC-2439- Remove URL query when loggingWhat we did?
After Merge
Tag as
v0.7.8-wiz-1and update replace directives in the monorepo.