Skip to content
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

[github] Improve log entries when retrieving github files #16635

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

easyCZ
Copy link
Member

@easyCZ easyCZ commented Mar 2, 2023

Description

See logs here

Related Issue(s)

Fixes #

How to test

Release Notes

NONE

Documentation

Build Options:

  • /werft with-github-actions
    Experimental feature to run the build with GitHub Actions (and not in Werft).
  • leeway-no-cache
    leeway-target=components:all
  • /werft no-test
    Run Leeway with --dont-test
Publish Options
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer Options
  • with-ee-license
  • with-slow-database
  • with-dedicated-emulation
  • with-ws-manager-mk2
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated

Preview Environment Options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@easyCZ easyCZ requested a review from a team March 2, 2023 11:31
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Mar 2, 2023
Comment on lines 69 to +81
if (response.status === 200) {
if (typeof response.data === "string") {
return response.data;
}
console.warn("GithubFileProvider.getFileContent – unexpected response type.", {
headers: response.headers,
type: typeof response.data,
log.warn("GithubFileProvider.getFileContent – unexpected response type.", {
request: params,
response: {
headers: {
"content-encoding": response.headers["content-encoding"],
"content-type": response.headers["content-type"],
},
type: typeof response.data,
},
Copy link
Member Author

Choose a reason for hiding this comment

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

The log here will allow us to possibly improve the response checking. We should, in theory, be able to check that the returned content-type matches the one we expected rather than having to read the response type. Reading the response type means we actually have to consume the body of the request and hence more bandwidth/work for us.

});
}
return undefined;
} catch (err) {
log.debug(err);
Copy link
Member

Choose a reason for hiding this comment

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

There might have been a reason for the debug here (probably surfaces a ton of user errors as well), but as this has no comment... let's try. 🙂

@roboquat roboquat merged commit adc0f6e into main Mar 6, 2023
@roboquat roboquat deleted the mp/log-github-file-content branch March 6, 2023 08:01
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/M team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants