Skip to content
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

Merged
merged 4 commits into from
Oct 27, 2023

Conversation

NeetigyaPod
Copy link
Contributor

@NeetigyaPod NeetigyaPod commented Oct 9, 2023

Testing done

Inspected the element from local machine to check the change. Screenshots attached

Before:
image

After:
Screenshot from 2023-10-09 22-46-02

Submitter checklist

Changed the inline script with accordance to Security Guideline for inline scripts.
Issue : [Issue #72145] (https://issues.jenkins.io/browse/JENKINS-72145)

@NeetigyaPod NeetigyaPod requested a review from a team as a code owner October 9, 2023 17:32
@jglick
Copy link
Member

jglick commented Oct 9, 2023

check BuildTriggerStepConfigTest

@jglick jglick added the bug label Oct 9, 2023
@NeetigyaPod
Copy link
Contributor Author

NeetigyaPod commented Oct 9, 2023

Hi, the tests seem to fail from original code. Like even in cloned version, the same tests are failing.
Screenshot from 2023-10-09 23-38-00
Can you please guide me in the same?

@jglick
Copy link
Member

jglick commented Oct 9, 2023

the tests seem to fail from original code

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.

@NeetigyaPod
Copy link
Contributor Author

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?
Right now I cloned and am just mvn:hpi run and checking.

@jglick
Copy link
Member

jglick commented Oct 9, 2023

Do I have to download any requirements to set it up locally?

Just latest Java 11 and latest Maven.

@NeetigyaPod NeetigyaPod force-pushed the feat/remove-inline-buildtrigger branch from d3e07e3 to 78a02d5 Compare October 9, 2023 20:12
@NeetigyaPod
Copy link
Contributor Author

Hi have made the changes, the bugs are fixed

Copy link

@Kevin-CB Kevin-CB left a 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.

@NeetigyaPod NeetigyaPod force-pushed the feat/remove-inline-buildtrigger branch from a2ca180 to 1fd04a2 Compare October 25, 2023 17:55
@NeetigyaPod
Copy link
Contributor Author

Hi, have rectified that as well.

@jglick jglick changed the title feat:Remove inline javascript code from BuildTriggerStep Remove inline javascript code from BuildTriggerStep Oct 25, 2023
@jglick jglick requested a review from Kevin-CB October 25, 2023 18:01
Copy link

@Kevin-CB Kevin-CB left a 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

@NeetigyaPod
Copy link
Contributor Author

@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()}"/>
Copy link
Member

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).

Copy link
Contributor Author

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?

Copy link
Member

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.

@jglick jglick merged commit 8ee60a8 into jenkinsci:master Oct 27, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants