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-66718] Un-inlining script in BuildTimelineWidget/control.jelly #5852

Merged
merged 1 commit into from Nov 4, 2021

Conversation

megathaum
Copy link
Contributor

See JENKINS-66718.

Proposed changelog entries

  • Un-inline script in BuildTimelineWidget/control.jelly to prepare for the introduction of Content Security Policy

Proposed upgrade guidelines

N/A

Submitter checklist

  • (If applicable) Jira issue is well described
  • Changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developer, depending on the change). Examples
    • Fill-in the Proposed changelog entries section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
  • Appropriate autotests or explanation to why this change has no tests
  • For dependency updates: links to external changelogs and, if possible, full diffs

Desired reviewers

@Wadeck

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least 2 approvals for the pull request and no outstanding requests for change
  • Conversations in the pull request are over OR it is explicit that a reviewer does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are correct
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@oleg-nenashev oleg-nenashev added the skip-changelog Should not be shown in the changelog label Oct 26, 2021
Copy link
Contributor

@Wadeck Wadeck left a comment

Choose a reason for hiding this comment

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

Not tested manually but it seems to have nothing wrong there :)

The different variables defined at the top level of the build-timeline-widget.js will be "global", = accessible outside of the script, but as this script is "local" to a single page, the risk of collision is pretty small.

If we are detecting such collision, we can just wrap it with the same kind of structure as it was done at the bottom of the script already 👍

Thanks for the contribution 🐝 🚀

@@ -0,0 +1,125 @@
var targetDiv = document.querySelector('#build-timeline-div');
Copy link
Contributor

Choose a reason for hiding this comment

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

Tips: document.getElementById('build-timeline-div') is an alternative (not necessarily faster, but perhaps more readable).
(No change required)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I'll remember it for the next time.

@megathaum
Copy link
Contributor Author

Thank you @Wadeck for the review. I did a manual test before and after. The timeline widget shows the builds successfully and I didn't see any errors in the console (browser's developer tool).

@timja timja added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Oct 27, 2021
@timja
Copy link
Member

timja commented Oct 27, 2021

This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@timja timja merged commit db62f35 into jenkinsci:master Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback skip-changelog Should not be shown in the changelog
Projects
None yet
4 participants