-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Prevent absolute links from adoc to www.jenkins.io and jenkins.io #5899
Prevent absolute links from adoc to www.jenkins.io and jenkins.io #5899
Conversation
See new check that was just proposed in jenkins-infra#5899
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.
Please make execution of make check
non-fatal on builds running on trusted.ci (or just skip it in the Jenkinsfile
for env.BRANCH_NAME == null
), otherwise this can block publication of security advisories.
Thanks for reminding me of that case. I adapted the shell script to never fail if run on trusted.ci.jenkins.io in 185fbf8 |
WDYT about adding a condition on renew the signer certificate for jenkins instead? It would use https://github.com/jenkins-infra/pipeline-library#infraistrusted :
Advantages:
(but I might be not pointing in the correct direction, WDYT @daniel-beck ?) |
If |
The checks performed by `make check` are advisory. Advisory checks should not stop a deployment from trusted.ci.jenkins.io.
Jenkinsfile
Outdated
@@ -49,8 +49,11 @@ node('docker&&linux') { | |||
} | |||
|
|||
stage('Check for typos') { | |||
sh 'make check' | |||
recordIssues(tools: [checkStyle(id: 'typos', name: 'Typos', pattern: 'checkstyle.xml')], qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]) | |||
if (!infra.isTrusted()) { |
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.
Inconsistent with
Line 92 in f9472d3
if (env.BRANCH_NAME == null) { |
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.
Included in d67b1ba with a comment to clarify why two conditions are being checked.
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.
@daniel-beck does the change in d67b1ba address your concerns enough that this can be merged or are more changes required?
Use same terms in the conditional in both places.
See jenkins-infra#5899 and jenkins-infra#5718 for the detailed reasons why we want to keep the hostname out of the links of the jenkins.io docuemntation
Ping @daniel-beck , is it ok for you (as GitHub indicates "Merging can be performed automatically once the requested changes are addressed.")? |
* Checks are advisory only. | ||
* They are intentionally skipped when preparing a deployment. | ||
*/ | ||
if (!infra.isTrusted() && env.BRANCH_NAME != null) { |
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.
Where is this infra.isTrusted defined?
I was just looking around.
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.
Here: https://github.com/jenkins-infra/pipeline-library/blob/master/vars/infra.groovy
It allows to determine if the current build is run from trusted.ci.jenkins.io or not.
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.
Thank you for explaining that. I have one follow up question. So basically we are importing that from another repository. I have imported groovyscript in the same repo by using load "path to script" but here how is this import from different repo done?
Prevent absolute links to jenkins.io and www.jenkins.io in adoc files
When the https://www.jenkins.io/ URL is embedded in the source code of the jenkins.io pages, it causes a user exploring a pull request through the preview sites to be moved from the preview site to the www.jenkins.io site. If they are not very carefully watching the URL address bar, they can waste time looking at the production site when they wanted to review the preview site.
@ADITYADAS1999 I assumed that the issue was more difficult than you were ready to attack. If you'd like to review the technique I've used, I'd love to have comments or recommendations of ways it could be improved.