-
Notifications
You must be signed in to change notification settings - Fork 72
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
Remove inline javascript code from BuildTriggerStep #126
Remove inline javascript code from BuildTriggerStep #126
Conversation
check |
https://github.com/jenkinsci/pipeline-build-step-plugin/runs/17351729476 passed in trunk last week. Also, the test failures in this PR are covering exactly the feature area you are modifying, so I think they are very likely related. |
My bad, I had left the script tags there. Rectified it, is there any way I can check if tests pass locally? I did mvn test but they fail locally. Do I have to download any requirements to set it up locally? |
Just latest Java 11 and latest Maven. |
d3e07e3
to
78a02d5
Compare
.../resources/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep/configLoad.js
Outdated
Show resolved
Hide resolved
Hi have made the changes, the bugs are fixed |
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.
There is also an onblur
call on this page.
Line 30 in 2239584
<f:textbox onblur="loadParams()" id="${jobFieldId}"/> |
a2ca180
to
1fd04a2
Compare
Hi, have rectified that as well. |
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 tested it locally, it works as expected and I'm not able to see CSP violation using the CSP plugin
@jglick Hi, can we please add the hacktoberfest topic in this repository? Or a label of hacktoberfest-accepted to this PR works as well. |
@@ -27,7 +27,9 @@ THE SOFTWARE. | |||
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:st="jelly:stapler"> | |||
<j:set var="jobFieldId" value="${h.generateId()}"/> |
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 general I think we should be able to get rid of h.generateId()
in these refactorings, by making the behavior function take the element argument into account and looking for siblings. Same for the hard-coded id params
, which we did not even bother uniquifying using generateId
since we expect this Jelly facet to be loaded only once in a page (Snippet generator).
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 makes sense, I want to contribute to Jenkins in long term as well so I can work on it as a separate issue?
Also is there any slack for Jenkins or is Gitter the preferred platform?
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 can work on it as a separate issue?
Sure, if you would like. It is not a priority, would just be a nice stylistic improvement.
is there any slack for Jenkins or is Gitter the preferred platform?
https://www.jenkins.io/chat/ though TBH I am not normally on those. Not sure why Slack is not used.
Testing done
Inspected the element from local machine to check the change. Screenshots attached
Before:
After:
Submitter checklist
Changed the inline script with accordance to Security Guideline for inline scripts.
Issue : [Issue #72145] (https://issues.jenkins.io/browse/JENKINS-72145)