-
Notifications
You must be signed in to change notification settings - Fork 76
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
log into pr preview environments #865
Conversation
Codecov ReportBase: 87.11% // Head: 87.14% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #865 +/- ##
==========================================
+ Coverage 87.11% 87.14% +0.02%
==========================================
Files 106 107 +1
Lines 9083 9068 -15
==========================================
- Hits 7913 7902 -11
+ Misses 689 688 -1
+ Partials 481 478 -3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
02e97ff
to
5cf2232
Compare
5cf2232
to
3f89961
Compare
pkg/domainutil/domain.go
Outdated
// See https://github.com/astronomer/astrohub-cli/issues/7 for regexp rationale | ||
// This will need to be handled as part of the permanent solution to issue #432 | ||
CloudDomainRegex = regexp.MustCompile(`(cloud\.|^)astronomer(?:(-dev|-stage|-perf))?\.io`) | ||
PRPreviewDomainRegex = regexp.MustCompile(`(pr\d{4}\.)astronomer(-dev)\.io$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4+, and i think -dev
is mandatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^(pr\d{4+}\).astronomer-dev\.io$
matches := re.FindStringSubmatch
would get you one result here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to ^(pr\d{4,6}).astronomer-dev\.io$
so that it still has an upper limit on the numbers.
9a883db
to
3ed56f9
Compare
} | ||
|
||
func getPRSubDomain(domain string) (prSubDomain, restOfDomain string) { | ||
if isPrPreviewDomain(domain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this is a duplicate check, since the caller already checks if it's a pr preview domain and then only calls this method
3ed56f9
to
d44b351
Compare
- `auth.Login()` succeeds with a valid pr preview env - `auth.formatDomain()` and `auth.ValidateDomain()` allow pr preview - `config.IsCloudContext()` allows pr preview - add a pr prveiew context to `testing.NewTestConfig()` - TODO - address a few TODOs
- anytime we need to check domain or URLs to be derived from a domain for the user login flow, we use the `domainutil` package - tighten up the domain and pr preview regexes - able to transform astrohub url -> core api url for valid domains - remove redundant `GetCloudAPIURL()`
d44b351
to
f165b4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM...i tested this against local and dev environment to make sure we are not causing a regression
Great work on this @jemishp 🎉
Description
Users can now log into pr preview environments using astro cli
🎟 Issue(s)
Related #805 Related #808
🧪 Functional Testing
📋 Checklist
make test
before taking out of draftmake lint
before taking out of draft