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

Actually print the full diff into the log when the log is too big #974

Merged

Conversation

weswigham
Copy link
Member

Otherwise, the "diff" we're so used to seeing reported on github hasn't actually been reported anywhere in the logs - only individual branch and main errors, not any comparisons between them.

@jakebailey
Copy link
Member

To fix the CI just do pnpm changeset --empty; this doesn't need a version bump as the pipeline builds from source.

@@ -46,7 +46,12 @@ async function main() {
if (diffComment) {
newComment += `There were interesting changes:\n`;
if (newComment.length + diffComment.length + checkLogsMessage.length > 65535) {
newComment += `Changes are too big to display here, please check the log.`;
// hardlink directly into the output of this script
const detailedLogUrl = `https://typescript.visualstudio.com/TypeScript/_build/results?buildId=${buildId}&view=logs&j=275f1d19-1bd8-5591-b06b-07d489ea915a&t=40b1ee41-44d6-5bba-aa04-4b76a5c732e5`;
Copy link
Member

Choose a reason for hiding this comment

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

What are the extra query params?

Copy link
Member Author

Choose a reason for hiding this comment

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

Deep linking directly to the job and task within the job that refers to this script's output.

Copy link
Member

Choose a reason for hiding this comment

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

Hm, do those still work if the pipeline changes (I want to move it to yaml at some point)

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 GUIDs will probably change if the underlying tasks shift.

Copy link
Member Author

Choose a reason for hiding this comment

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

Notably, if the GUIDs don't exist in the job, it just links to the first job/task - it doesn't 404 or anything - so it's pretty safe to just use these for now and change them in the future when the underlying task changes.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, that's not too bad then.

@@ -46,7 +46,12 @@ async function main() {
if (diffComment) {
newComment += `There were interesting changes:\n`;
if (newComment.length + diffComment.length + checkLogsMessage.length > 65535) {
newComment += `Changes are too big to display here, please check the log.`;
// hardlink directly into the output of this script
const detailedLogUrl = `https://typescript.visualstudio.com/TypeScript/_build/results?buildId=${buildId}&view=logs&j=275f1d19-1bd8-5591-b06b-07d489ea915a&t=40b1ee41-44d6-5bba-aa04-4b76a5c732e5`;
Copy link
Member

Choose a reason for hiding this comment

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

Ah, that's not too bad then.

@jakebailey jakebailey merged commit fc31ea5 into microsoft:main Mar 5, 2024
7 checks passed
@weswigham weswigham deleted the include-full-diff-comment-in-output branch March 5, 2024 19:22
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