-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add appLogs
to DeveloperPlatformClient interface
#5497
base: main
Are you sure you want to change the base?
Conversation
Coverage report
Show files with reduced coverage 🔻
Test suite run success2111 tests passing in 930 suites. Report generated by 🧪jest coverage report action from 0aa66ff |
65127cf
to
120f6ff
Compare
We detected some changes at packages/*/src and there are no updates in the .changeset. |
120f6ff
to
c645803
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.
Just some light suggestions. Can you put the follow-up PR into a stack with this?
} | ||
} | ||
|
||
export const fetchAppLogs = async ({jwtToken, cursor, filters}: FetchAppLogsOptions): Promise<Response> => { |
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 wondering if this should be moved into the partners client. Then you know its always called via the client.
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.
Yea, good idea, I think that makes sense give it's used no where else.
} | ||
} | ||
|
||
export const fetchAppLogs = async ({jwtToken, cursor, filters}: FetchAppLogsOptions): Promise<Response> => { |
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 know the existing type of this call is Response, so its not a change, but should it be? Is the response well-typed at all? It looks like within poll-app-logs we strongly expect it to either take an error or success form. In that code we just use as
rather than validating what's received. Maybe it'd make sense to have this function (in the client) return AppLogsError | AppLogsSuccess
and for it to call .json()
. Then callers don't need to think about casting.
That'll leave the function consistent with the rest of the client, as the other methods return data structures not the bare http/graphql responses.
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.
Ok to relax on this if we have a good reason for it to remain as Response
.
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 agree, that makes sense. I refactored this a bit so that we return the actual AppLogsError | AppLogsSuccess
. We check the status of the response for the error message and polling time, so I added that to so the return type for error as well since that when we use it. Let me know what you think :)
36fc50c
to
49c65b6
Compare
49c65b6
to
fa530fe
Compare
Part of: https://github.com/Shopify/shopify-functions/issues/605
WHY are these changes introduced?
This PR adds
appLogs
to theDeveloperPlatformClient
interface. Currently this is not necessarily needed since when we poll for app logs, we only have one client currently in use. But to integrate app logs streaming with the developer dashboard, this will make calling the correct request (partners vs app management) simpler.The next step is this follow Up PR: #5498
WHAT is this pull request doing?
This change enables app logs to be fetched from both the
PartnersClient
and we will update the methods for theAppManagementClient
in a separate PR, providing a consistent interface regardless of which backend is being used.Component Updates:
How to test your changes?
Test these changes in production using your local CLI on this branch (both commands below should work as expected):
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist