Skip to content
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

action: query the Go proxy for CUE versions #13

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

jpluscplusm
Copy link
Collaborator

@jpluscplusm jpluscplusm commented Aug 2, 2023

We believe that the cause of intermittent GitHub API 403 responses,
which are now exposed to the Action consumer and not masked, is that
this Action doesn't use a GITHUB_TOKEN (even when provided as an envvar)
to authenticate to the GitHub API.

Therefore, all our API requests are unauthenticated, which are nominally
rate-limited at a level which shouldn't affect any consumer. However,
they do affect consumers: ourselves, in testing, and also in
production.

We hypothesise that this is because GitHub-hosted GitHub Actions runners
are issued IP addresses from some shared pool, thus any requests "we"
make are counted against a rate limit that a previous user may have
already used up.

To get round this, this commit changes the Action's behaviour to use the
Go Proxy as the upstream decision maker for which CUE version is the
"latest", instead of querying the GitHub API for all versions and then
making this decision locally. This has the advantage of harmonising the
Action and the Go CLI's concepts of "latest".

An alternative would be to teach this Action's API requests to use the
GITHUB_TOKEN, if provided. This would have the downside of needing the
Action's consumers to provide this token in their workflows, so we avoid
this alternative for now.

@jpluscplusm jpluscplusm requested a review from myitcv August 2, 2023 13:24
@jpluscplusm jpluscplusm force-pushed the use_go_proxy_as_source_of_cue_versions branch 2 times, most recently from ce1ecde to 8f8507a Compare August 2, 2023 14:09
We believe that the cause of intermittent GitHub API 403 responses,
which are now exposed to the Action consumer and not masked, is that
this Action doesn't use a GITHUB_TOKEN (even when provided as an envvar)
to authenticate to the GitHub API.

Therefore, all our API requests are unauthenticated, which are nominally
rate-limited at a level which shouldn't affect any consumer. However,
they *do* affect consumers: ourselves, in testing, and also in
production.

We hypothesise that this is because GitHub-hosted GitHub Actions runners
are issued IP addresses from some shared pool, thus any requests "we"
make are counted against a rate limit that a previous user may have
already used up.

To get round this, this commit changes the Action's behaviour to use the
Go Proxy as the upstream decision maker for which CUE version is the
"latest", instead of querying the GitHub API for all versions and then
making this decision locally. This has the advantage of harmonising the
Action and the Go CLI's concepts of "latest".

An alternative would be to teach this Action's API requests to use the
GITHUB_TOKEN, if provided. This would have the downside of needing the
Action's consumers to provide this token in their workflows, so we avoid
this alternative for now.

Signed-off-by: Jonathan Matthews <[email protected]>
@jpluscplusm jpluscplusm force-pushed the use_go_proxy_as_source_of_cue_versions branch from 8f8507a to eb2a542 Compare August 2, 2023 14:10
Copy link
Member

@myitcv myitcv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jpluscplusm jpluscplusm merged commit 8e50d5d into main Aug 2, 2023
2 checks passed
@jpluscplusm jpluscplusm deleted the use_go_proxy_as_source_of_cue_versions branch August 2, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants