-
Notifications
You must be signed in to change notification settings - Fork 268
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
[JENKINS-73951][JENKINS-73952] Improve CSP compatibility #321
Conversation
…pl/credentialOK.jelly
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.
Testing looks good. Left some optional feedback for your consideration. Feel free to disregard if these suggestions aren't helping.
@@ -0,0 +1,3 @@ | |||
window.addEventListener("DOMContentLoaded", () => { | |||
document.querySelector(".svn-credential-ok-close").addEventListener("click", () => window.close()); |
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.
Elsewhere in your changes, you've been putting one-line lambdas into their own block. I don't care either way, as long as we're consistent within the same file.
document.querySelector(".svn-credential-ok-close").addEventListener("click", () => window.close()); | |
document.querySelector(".svn-credential-ok-close").addEventListener("click", () => { | |
window.close(); | |
}); |
} | ||
|
||
window.addEventListener("DOMContentLoaded", () => { | ||
document.querySelectorAll(".svn-tagform-tag-checkbox").forEach(checkbox => { |
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.
Elsewhere in Jenkins core and in other CSP PRs we're putting parameters in parentheses consistently, so please do so here as well:
document.querySelectorAll(".svn-tagform-tag-checkbox").forEach(checkbox => { | |
document.querySelectorAll(".svn-tagform-tag-checkbox").forEach((checkbox) => { |
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.
Thanks, I'll try to be more consistent with it.
|
||
window.addEventListener("DOMContentLoaded", () => { | ||
document.querySelectorAll(".svn-tagform-tag-checkbox").forEach(checkbox => { | ||
document.addEventListener("change", updateRow); |
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 seems odd to me that we aren't using checkbox
. If it's truly unused, maybe we should use ()
instead on the previous line? Or if we should use it, should this line be:
document.addEventListener("change", updateRow); | |
checkbox.addEventListener("change", updateRow); |
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, it's an oversight from my side. I'm unsure how this even worked for the sake of the video :/
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.
Thanks for the PR!
https://issues.jenkins.io/browse/JENKINS-73951
https://issues.jenkins.io/browse/JENKINS-73952
Testing done
For JENKINS-73951 I needed to go to the
enterCredential
page that's referenced fromurl
field help file. And then to get to thecredentialOK
I commented out these lines locally:subversion-plugin/src/main/java/hudson/scm/SubversionSCM.java
Lines 2347 to 2348 in c73117e
https://www.loom.com/share/4b2e8bfe5ab147e8b05584dded1343f1
https://www.loom.com/share/94b12cc934c8439f879bf5c8cc6709eb
CSP violations that appear in the list in the end are addressed by #319.
For JENKINS-73952 had to setup a project with 2 module locations, so that at least 2 entries appear on the
tagBuild
page which allows affected elements to be rendered. The functionality in the related script was broken due to jQuery not being available, so I've fixed that along the way.https://www.loom.com/share/2b96f17fe29340ec8d536ebedbd9517e
https://www.loom.com/share/58b6fdaae7384c86bf9dd64b0ebe93f0
Submitter checklist