Repository navigation
Merge main into v2, and port #2407 - #2416
Merged
Merged
Conversation
…ation can't be looked up (#2407)
Brings in #2407 as a parent only: every file it touches moved on v2, so the merge keeps v2's tree and the next commit ports it. Co-Authored-By: Claude <noreply@anthropic.com>
…PI token's organization can't be looked up The same change as main's, on v2's layout: pkg/httputil/retry.go as is, the v1 and v1alpha1 constructors in internal/platform/astro/clients (NewV1ClientForLogin too, which main does not have), the sentinel in cmd/astro/setup.go, and the hook in cmd/root_hooks.go. One difference: astro auth token, which only v2 has, keeps working when the lookup fails. The token is saved before the lookup and printing it needs no organization; TestPreRunLeavesJSONStdoutAlone holds it. Co-Authored-By: Claude <noreply@anthropic.com>
Coverage Report for CI Build 39806272762Coverage increased (+0.03%) to 60.602%Details
Uncovered Changes
Coverage Regressions2 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
Retries: a Retry-After wait is capped at 10s rather than taken as given; the retry check no longer returns an error beside a response, which left the response unclosed; and the retrying client closes only its own idle connections, not http.DefaultTransport's, which every client shares. Organization lookup: checkAPIToken and checkAPIKeys share one lookup, so an empty list or an organization with no product is ErrAPITokenOrganization rather than a panic, and API keys stop on a failed lookup as an API token does. The product cannot be skipped: an environment login keeps it only for the process, and it is what tells a hosted organization from a hybrid one. astro auth token still skips a lookup that failed for want of the API, but not one the API refused with 401 or 403: that token no longer works. astro api registry, which is public, needs no login at all. Co-Authored-By: Claude <noreply@anthropic.com>
Merged
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.
Syncs
main's one commit since #2415 intov2, and ports it.v2, so the merge commit keepsv2's tree unchanged and the second commit carries the changeThe port
Same change as main's, on v2's paths:
pkg/httputil/retry.go,retry_test.goastro-client-v1/client.gointernal/platform/astro/clients/astrov1/client.go, bothNewV1ClientandNewV1ClientForLogin(v2 only)astro-client-v1alpha1/client.gointernal/platform/astro/clients/astrov1alpha1/client.gocmd/cloud/setup.go,setup_test.gocmd/astro/setup.go,setup_test.gocmd/root_hooks.go,root_hooks_test.go(cloudSetup)astroSetup)go-retryablehttpis now a direct dependency at v0.7.8, main's version (it was already in v2's graph at v0.7.7).Test-only fixes for v2's stricter lint: import grouping in two test files, and a reason on
retry_test.go's//nolint:bodyclose.Review fixes (v2 only; main keeps #2407 as merged)
A
/code-reviewof the port found these. Most apply to main as well; they are fixed here because 1.x is winding down.Retries (
pkg/httputil/retry.go)Retry-Afterwait is capped at 10s per retry. Before, it was taken as given, soRetry-After: 300would hang a command about 15 minutes with no output.http.DefaultTransport's connections, which Houston, Airflow and the version check also use. The new transport still reads the wrapped client's transport per request, so test transports and the no-network guard keep working.The organization lookup (
cmd/astro/setup.go)checkAPITokenandcheckAPIKeysshare one lookup,environmentOrganization. An empty org list or an org with no product is nowErrAPITokenOrganizationinstead of a panic. API keys now stop on a failed lookup the way an API token does, and an emptydeploymentslist is an error too.organization.IsOrgHosted()reads (deployment create/update validation, the monitoring DAG on deploy). Carrying on without it would treat a hosted org as hybrid.Commands that don't need the org
astro auth tokenstill skips a lookup that failed because the API was unavailable (a 429, a 503, a network error), since the token is saved first and printing it needs no org. It no longer skips one the API refused with 401 or 403: that token doesn't work, and printing it with exit 0 would hide that.TestPreRunLeavesJSONStdoutAlonenow has both cases.astro api registryqueries the public provider registry, so it carriesNoLoginAnnotation(astelemetry,configandcontextdo) and the login check skips it.Checks
git rev-list HEAD..origin/mainis 0.v2's.make test,make tidy-checkandmake deadcodepass locally; golangci-lint v2.13.2 reports 0 issues;GOOS=windows go build ./...andgo veton the changed packages pass. (make lintitself can't run on the machine this was checked on: prek's hook runs Go 1.26.2, which v2'sgo.modrejects. The same golangci-lint version was run directly instead.)