Skip to content

Conversation

@magurotuna
Copy link
Member

@magurotuna magurotuna commented Jul 23, 2024

This commit makes x-deno-ray values always printed in GitHub Actions as soon as we get a response from the backend API server.

The primary motivation behind it is that it's hard to debug issues with streaming APIs - in particular, gitHubActionsDeploy:

deployctl/src/utils/api.ts

Lines 410 to 424 in acb2ba3

gitHubActionsDeploy(
projectId: string,
request: GitHubActionsDeploymentRequest,
files: Uint8Array[],
): Promise<AsyncGenerator<DeploymentProgress>> {
const form = new FormData();
form.append("request", JSON.stringify(request));
for (const bytes of files) {
form.append("file", new Blob([bytes]));
}
return this.#requestJsonStream(
`/projects/${projectId}/deployment_github_actions`,
{ method: "POST", body: form },
);
}

This API returns 200 OK and then starts streaming the progress. But currently x-deno-ray is not printed when the status code is 200. Problems that happen during streaming, e.g. very slow file uploads, could be made easier to debug by making x-deno-ray available in this case too.

@magurotuna magurotuna marked this pull request as ready for review August 11, 2024 09:14
@magurotuna magurotuna requested a review from a team August 11, 2024 09:14
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

@magurotuna magurotuna merged commit 8644ec5 into denoland:main Aug 15, 2024
@magurotuna magurotuna deleted the always-print-x-deno-ray-on-action branch August 15, 2024 02:35
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