Add GitHub token authentication to Makefile downloads#1541
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: stuggi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This change depends on a change that failed to merge. Change openstack-k8s-operators/openstack-k8s-operators-ci#137 is needed. |
|
/retest |
|
recheck |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/15cfbf7a78af45b6bc7dfac4cbb2de3f ❌ openstack-k8s-operators-content-provider FAILURE in 6m 03s |
| test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.59.1 | ||
| test -s $(LOCALBIN)/golangci-lint || { \ | ||
| CURL_AUTH_HEADER=""; \ | ||
| if [ -n "$$GITHUB_TOKEN" ]; then \ |
There was a problem hiding this comment.
shouldn't we use $ instead of $$ if we want to access variable value. IIUC the later would return PID of running process.
There was a problem hiding this comment.
because its a Makefile to access environment variables we have to use $$. To pass a literal $ to the shell, you must escape it from make's interpretation by doubling it.
|
/retest |
|
recheck |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/337bf767273d4552a4e1bfc90e84c9a3 ❌ openstack-k8s-operators-content-provider FAILURE in 6m 02s |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/c61e973987134767af4a48a2b5fdfc5f ❌ openstack-k8s-operators-content-provider FAILURE in 5m 59s |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/1fbc4d5c57184b84ac0dd0a06ce0d7b8 ❌ openstack-k8s-operators-content-provider FAILURE in 7m 46s |
Fixes GitHub rate limiting issues in CI by automatically using GITHUB_TOKEN
when available for downloads from GitHub (raw.githubusercontent.com and
github.com/releases). Falls back gracefully to unauthenticated downloads
when no token is present, maintaining compatibility with local development.
Updated targets:
- kustomize (install script)
- yq (binary release)
- kuttl (binary release)
- operator-sdk (binary release)
- opm (binary release)
- golangci-lint (install script)
Usage in CI: export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
Local dev: no changes required
Jira: OSPRH-17779
Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/8f8f1f56e538465bb972663e0dcd2f97 ❌ openstack-k8s-operators-content-provider FAILURE in 5m 54s |
|
looks like ci-framework is calling the make command in the wrong dir comparing to a different job there it is |
|
|
I have a depends-on on the openstack-k8s-operators-ci repo ... lets remove that. |
|
recheck |
|
/retest |
|
@stuggi: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
dprince
left a comment
There was a problem hiding this comment.
Instead of automating it this way would it be better to just have the CI base container automatically add these dependencies via a Dockerfile? That way they won't be added repeatedly in each job. Also, the Makefile's for service operators would be simpler.
@dprince I have submitted PR [1] with the alternative approach to use a pre-build image with tools installed. One point I could see is that we need multiple images if we bump tool version, like golang, when we do the bump one service repo after each other. will add hold on this until we decided which way to go |
|
closing in preference of openstack-k8s-operators/openstack-k8s-operators-ci#138 |
Fixes GitHub rate limiting issues in CI by automatically using GITHUB_TOKEN when available for downloads from GitHub (raw.githubusercontent.com and github.com/releases). Falls back gracefully to unauthenticated downloads when no token is present, maintaining compatibility with local development.
E.g seen in https://github.com/openstack-k8s-operators/openstack-operator/actions/runs/15896190926/job/44828209996, force-bump actions can fail with github rate limit:
Updated targets:
Usage in CI: export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
Local dev: no changes required
Jira: OSPRH-17779