-
Notifications
You must be signed in to change notification settings - Fork 112
Upload lychee results to GH artifacts for excessively long reports #386
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
Merged
Conversation
This file contains hidden or 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
Contributor
Vercel Previews Deployed
|
7f5c4ab to
2ef0916
Compare
6701a80 to
c1a927e
Compare
Checks the char count of the lychee broken link report prior to attaching to the PR. This is to help avoid a scenario where the report hits the 65536 char max count of the GH API
This allows us more flexibility to adjust the max length in the future without doing a find-and-replace accross the workflow file
c1a927e to
b383d73
Compare
This compares the char count to the action variable numerically (integer to integer) rather than lexicographically. In this case, the report char count was '1209122' which is _technically_ greater than 65536(the configured max), but since the values were being compared lexicographically, and the string '1209122' begins with a 1, this expression was evaluating to '1209122' >= '65536'(since '1209122' begins with a 1).
4fe0f33 to
e719427
Compare
RubenSandwich
requested changes
May 8, 2025
Contributor
RubenSandwich
left a comment
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.
Let's be more specific in the instructions: https://github.com/hashicorp/web-unified-docs/pull/386/files#r2080356783.
"Download full report" is a more actionable sentence than "See <link> for full report"
RubenSandwich
approved these changes
May 8, 2025
Contributor
RubenSandwich
left a comment
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.
ππ»
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
π Relevant links
ποΈ What
Set a configurable char limit on broken link reports.
π€· Why
This is to avoid a limitation in the GH API preventing the creation of a PR comment with a body longer than 65536 characters. Attempting to do so (as can happen when there are a lot of broken links) produces the following error:
π οΈ How
π§ͺ Testing
A PR has been opened against this branch (
rm/lychee-results-to-gh-artifacts) to test this without merging intomain. That PR has a large number of files changed and the links intentionally broken, so that the char length of the report exceeds the maximum char limit(configurable as a variable here). Looking at that PR, we can see that the full report has been uploaded to GH artifacts and a link posted as a PR comment instead