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

[JENKINS-69658] - CSP compatibility for failed-test.jelly #451

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

Artmorse
Copy link
Contributor

@Artmorse Artmorse commented Oct 24, 2022

The issue
You can find all the issue details here.

My updates
I've moved the onclick calls from the failed-test.jelly file to the failureSummary.js one.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

testShowlinks.forEach((element) => {
element.onclick = (_) => {
const testId = element.id.replace('-showlink', '');
showFailureSummary(testId, document.URL + "/summary");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document.URL is wrong, as it refers to that page we're in. Request has to go to JENKINS_URL/job/fs/5/testReport/<package_name>/<test_name>/summary and not just JENKINS_URL/job/fs/5/testReport/summary
Currently this returns 404:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, can you please complete the Reproduction steps section of the Jira ticket (JENKINS-69658) description ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Artmorse commented in the ticket

Copy link
Contributor Author

@Artmorse Artmorse Oct 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! I was able to do my tests! 😄

@Artmorse
Copy link
Contributor Author

@yaroslavafenkin
Can you add the hacktoberfest-accepted label to this PR if it's seems good to you ? 😊

Copy link
Contributor

@yaroslavafenkin yaroslavafenkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still does not work as expected.

image

Request URL still looks wrong:
image

Providing steps I used:

  1. Create a freestyle project
  2. Select Git as SCM, as repository URL specify https://github.com/yaroslavafenkin/security-notifier.git. As branch specifier put */fail.
  3. Add 'Invoke top-level Maven targets' build step. As goal set test.
  4. Add 'Publish JUnit test result report' post-build action. As fileset includes put **/*.xml.
  5. Save it and trigger a build.
  6. When it fails go to the build and then to 'Test Result' action.
  7. Open browser developer tools and go under 'All Failed Tests' hit the plus icon to obtain details about the failed test. You'll see failed request in the console, and should see an error as on the screenshot above.

@Artmorse Artmorse requested a review from yaroslavafenkin May 15, 2023 11:24
@Kevin-CB
Copy link

Kevin-CB commented Mar 8, 2024

Hey @Artmorse, I tried reviewing this PR and followed Yaroslav's steps. I'm not encountering any errors, it's working as expected.

However, I noticed that we missed to report an occurrence of inline JS (summary.jelly#L34-L35)
It's in a different class, but closely related to your changes, so if you're still willing to work on this topic, I'd be here to review it once more and help get it finally merged!

@Artmorse
Copy link
Contributor Author

Artmorse commented Mar 8, 2024

hey @Kevin-CB, yes I'll make the changes and I'll ping you when it's done!

@basil basil requested a review from a team as a code owner October 1, 2024 23:57
@timja timja merged commit 05e2505 into jenkinsci:master Oct 3, 2024
17 checks passed
@timja timja changed the title [JENKINS-69658] - failed-test.jelly javascript un-inlined. [JENKINS-69658] - CSP compatibility for failed-test.jelly Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants