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 dead JS code #9136

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Remove dead JS code #9136

merged 1 commit into from
Apr 8, 2024

Conversation

zbynek
Copy link
Contributor

@zbynek zbynek commented Apr 6, 2024

The YUI.log was most likely a typo (was meant to be YAHOO.log) and is not needed anyway since the standard console.log is used in other places. Checks for existence of console can be dropped since they are missing in other places. Some global vars are not needed in anymore (mostly because of Prototype removal).

No tests were added/changed because functionality didn't change.
geval code was simplified by removing IE-only hacks, but it remains incompatible with CSP (on purpose)

Testing done

JS lint passes

Proposed changelog entries

(skip changelog)

Proposed upgrade guidelines

N/A

Submitter checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
    Options
  2. There is automated testing or an explanation as to why this change has no tests.
    Options
  3. New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
    Options
  4. New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
    Options
  5. For dependency updates, there are links to external changelogs and, if possible, full differentials.
    Options
  6. For new APIs and extension points, there is a link to at least one consumer.
    Options
Loading

Desired reviewers

@mention

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

Maintainer checklist

Edit tasklist title
Beta Give feedback Tasklist Maintainer checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. There are at least two (2) approvals for the pull request and no outstanding requests for change.
    Options
  2. Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
    Options
  3. Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
    Options
  4. Proper changelog labels are set so that the changelog can be generated automatically.
    Options
  5. If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
    Options
  6. 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).
    Options
Loading

@timja timja added the skip-changelog Should not be shown in the changelog label Apr 7, 2024
@timja
Copy link
Member

timja commented Apr 7, 2024

/label ready-for-merge


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

Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Apr 7, 2024
@NotMyFault NotMyFault merged commit 89c7754 into jenkinsci:master Apr 8, 2024
17 checks passed
@MarkEWaite
Copy link
Contributor

This seems to have caused a regression when creating a new certificate credential with PKCS#12 type. @zbynek can you investigate JENKINS-73166 to confirm that my git bisect is correct and to identify a fix?

@MarkEWaite
Copy link
Contributor

MarkEWaite commented May 14, 2024

As far as I can tell, I had to restore the following subset of the commit:

 function geval(script) {
-  eval(script);
+  // execScript chokes on "" but eval doesn't, so we need to reject it first.
+  if (script == null || script == "") {
+    return;
+  }
+  // see http://perfectionkills.com/global-eval-what-are-the-options/
+  // note that execScript cannot return value
+  (this.execScript || eval)(script);
 }

When I replace the (this.execScript || eval)(script); with eval(script) it fails.

The replacement of the YUI logging lines with console.log did not seem to affect JENKINS-73166.

MarkEWaite added a commit to MarkEWaite/jenkins that referenced this pull request May 17, 2024
https://issues.jenkins.io/browse/JENKINS-73166 notes that the credentials
code for certificates has a dependency on this JavaScript code.
Without this JavaScript, an attempt to add a new certificate credential
type using PKCS#12 will fail with an HTTP 404 error.

The replacement of YUI.log with console.log is not involved in the bug
report, so it is retained in the code change.

This reverts part of commit 932ab19c5448bb0afa46f60b93c245eb08e86b55.
@zbynek zbynek deleted the remove-dead-js branch May 17, 2024 19:26
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