-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix(appstore-connect): Add a new endpoint that returns the status of all configured apps [NATIVE-294] #29728
Conversation
size-limit report
|
i need to get a few test api keys set up to see what apple returns in a few easy-to-reproduce situations. |
f66e72c
to
54afb07
Compare
except appstore_connect.UnauthorizedError: | ||
asc_credentials = { | ||
"status": "invalid", | ||
"code": AppConnectAuthenticationError().code, |
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 plan to throw these errors directly in /app
so the FE can use the same code to handle the validation messages returned by this endpoint as well as /status
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'm not sure you need to instantiate the class here, can you not access the code attribute without instantiating?
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.
you're right about that, thanks for catching this!
@@ -1,3 +1,5 @@ | |||
import {ValidationErrorDetailed} from 'app/components/modals/debugFileCustomRepository/appStoreConnect/utils'; |
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.
this doesn't introduce a circular import but i'm not particularly confident about this import. maybe it's better to just duplicate the type here instead?
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.
should we move the ValidationErrorDetailed
type and maybe add some AppStoreConnect
prefix or rename it?
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.
do you have any ideas on where ValidationErrorDetailed
could be moved to? i'm not too familiar with the front end's file structure so hints here would be very helpful.
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.
please do not worry... I worked on this in the PR #29843
static/app/components/projects/appStoreConnectContext/utils.tsx
Outdated
Show resolved
Hide resolved
@ potential reviewers: i would really recommend reviewing this commit-by-commit, or to at least review the code without 3116b92 included as it performs a rename that only clutters the diff |
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.
Looks nice!
(but there are no tests :( )
```json | ||
{ | ||
"appstoreCredentialsValid": true, | ||
"pendingDownloads": 123, |
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.
It seems we're just hiding the fact that pendingDownloads
can be undefined right after a new source is created. The implementation here queries the database and will return 0 pending downloads if we never ran the task. This could be a tiny bit odd if our workers are a bit slow. But probably not important enough to worry about so I don't mind if we keep it like this.
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.
good catch, i've got something written down right now to investigate this as i've been seeing this behaviour after the switch to using the app store connect API to download dSYMs. i'm currently unsure what the best solution for this would be as it would probably need coordination from the front end, but i'm thinking we can maybe defer the work to address this to later on in the quarter unless we're getting a lot of customer feedback on this.
except appstore_connect.UnauthorizedError: | ||
asc_credentials = { | ||
"status": "invalid", | ||
"code": AppConnectAuthenticationError().code, |
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'm not sure you need to instantiate the class here, can you not access the code attribute without instantiating?
2fb9eb0
to
549d66b
Compare
fyi @priscilawebdev @flub i've rebased this off of |
549d66b
to
3116b92
Compare
status endpoint is currently throwing 405s for some reason, will investigate later after lunch |
…all configured apps
142c12d
to
1e7fa19
Compare
@priscilawebdev i believe i've addressed all of your feedback, so this should be good for a second look. if you're unable to find time to take a second look by tomorrow, i'll merge this in first and let's follow up on any remaining feedback you've got in another PR. |
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.
looks good to me
@@ -1,3 +1,5 @@ | |||
import {ValidationErrorDetailed} from 'app/components/modals/debugFileCustomRepository/appStoreConnect/utils'; |
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.
please do not worry... I worked on this in the PR #29843
switch (error.code) { | ||
case 'app-connect-authentication-error': | ||
return t( | ||
'Credentials are invalid or missing. Check the entered App Store Connect credentials are correct.' |
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.
<3
@ potential reviewers: i would really recommend reviewing this commit-by-commit, or to at least review the code without 3116b92 included as it performs a rename that only clutters the diff
This creates a new endpoint
appstoreconnect/status
meant to replaceappstoreconnect/validate/{id}/
.This new endpoint does the following things differently from its predecessor:
The following frontend changes have been made in response:
/validate
and the/apps
endpoints.Screenshots
When submitting invalid credentials (changed from "An unexpected error occurred while configuring...")
Inline warning
Context shown after clicking on inline warning