-
Notifications
You must be signed in to change notification settings - Fork 329
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
Make all instances of doc links in logs clickable #2355
Conversation
2e6d089
to
90ece33
Compare
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.
LGTM broadly, just a couple of nits - don't need to be implemented within the PR.
src/codeql.test.ts
Outdated
@@ -912,8 +912,8 @@ test("runTool summarizes autobuilder errors", async (t) => { | |||
instanceOf: CommandInvocationError, | |||
message: | |||
"We were unable to automatically build your code. Please provide manual build steps. " + | |||
"For more information, see " + | |||
"https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/automatic-build-failed. " + | |||
"See https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/automatic-build-failed " + |
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'm wondering whether it makes sense to export these into their own variables, and even better perhaps in their own file, something like src/docs-urls.ts
or something similar.
Doing so would have the benefit of them being more centrally organised, so we can do a one-step global replace if anything changes by just changing the value of the constant to the new URL, and have the documentation strings be automatically updated everywhere.
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 did this in an enum, similar to the way we have EnvVar
for shared environment variables 😄 it was a really good idea — from there I found other instances where we had docs links that ended with periods!
src/autobuild.ts
Outdated
: "" | ||
}`, | ||
); | ||
core.exportVariable(envVar, "false"); | ||
} else { | ||
logger.info( | ||
`Enabling ${featureName}. This can be disabled by setting the ${envVar} environment variable to 'false' (see ${envDoc}).`, | ||
`Enabling ${featureName}. This can be disabled by setting the ${envVar} environment variable to 'false' (see ${envDoc} for more information).`, |
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.
In some of these strings we have the URL reference inside of a parenthesis, whereas in others we end the sentence with a period and start a new one.
I'm curious if there are any benefits to being more consistent on that front.
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 definitely don't see any downsides to standardizing our docs links — I removed all the parenthetical URL references!
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.
Nice! Non-blocking, optional: This could be something we create a CodeQL query for to help make sure we follow this pattern going forward.
10d5681
90ece33
to
10d5681
Compare
Always say "see $URL for more information" without parentheses.
10d5681
to
edfef27
Compare
Thanks!! I've waited too long to get back to this PR 😆 so I won't write the CodeQL query this time. I think the new |
33902d8
to
892ff9e
Compare
Fixes #2354.
This PR updates all log messages with links to GitHub docs so that they are not succeeded by punctuation marks, in order to make sure the links are clickable from our logs.
Merge / deployment checklist