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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/plenty-news-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
7 changes: 6 additions & 1 deletion packages/dtslint-runner/src/post-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

newComment += `Changes are too big to display here, please check [the log](${detailedLogUrl}).`;
console.log("There were interesting changes:\n");
console.log(diffComment);
console.log("\n");
} else {
newComment += diffComment;
}
Expand Down
Loading