-
Notifications
You must be signed in to change notification settings - Fork 2
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
Print debug information #36
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This will be a ton of output; are you sure it’s helpful?
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.
Does it hurt? What are the downsides?
I'm not sure, tbh, how useful this is on OSS side of things, but at work this has been a life saver in numerous occassions:
npm ci
respects thepackage-lock=false
config flag npm/cli#4185, [BUG]npm ci
succeeds whenpackage-lock.json
doesn't matchpackage.json
npm/cli#2701)The later two can be somewhat solved by using lockfiles, but there's opinions about that.
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.
What opinions? The latter two absolutely are covered by lockfiles.
Also, GitHub actions are almost exclusively used by open source projects, so that’s what we should be optimizing for.
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.
The downsides are that it might cause actually important log output to be truncated if the log gets too large - I’m not sure what GitHub’s log size limit is, but this specific output caused that problem on projects for me on Travis in the past, so i don’t do it anymore.
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 meant that while lockfiles cover the issues mentioned, there are opinions about using lockfiles. Esp. in the context of OSS libraries a lot of people don't use them?
https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy does not mention any size limits.
I do recall them recently posting a blog post about how they rewrote the log viewer to cater for larger log files 🤔 https://github.blog/2021-03-25-how-github-actions-renders-large-scale-logs/ mentions that they need to support at least 50k lines. Surely that should be enough to list the dependencies 🤔
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.
Oh definitely there are opinions about that :-) but by not using a lockfile, I’d use --before locally to investigate anyways, which the full tree output wouldn’t help with.
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.
how much time does it add to list and log the entire dep tree?
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.
It does say
0s
here: https://github.com/dominykas/pkgjs-action/runs/4685158763?check_suite_focus=true (randome poke). Other places say1s
. Ofc that's a very small tree, but I doubt it would go much over that.Regarding the log lines, it could be attached as an artifact, but that would probably add another second... Not sure it's worth that.
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.
Fair enough :-) altho actually it might be much more useful to attach the lockfile itself - or, the one npm would have produced - as an artifact.
I guess i can see the usefulness of both, based on what you’ve described. The lockfile could be looked into as a follow up.