jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
115 stars 186 forks source link

Remove usage of prototype.js #852

Open timja opened 11 months ago

timja commented 11 months ago

Describe the bug

See this blog post for details. Prototype will soon be removed from Jenkins core, and to prepare for this transition, this plugin must be migrated away from Prototype. The blog post contains instructions on how to find and eliminate usages of Prototype.

To Reproduce

In this plugin, the following usages of Prototype have been identified. This may not be an exhaustive list:

lib/jfrog/promotions/promotions.js:    target = spinner.next();
lib/jfrog/repos/repos.js:        credentialsId = $(credentialsInput).down('select').value;
lib/jfrog/repos/repos.js:    let spinner = $(button).up("DIV").next();
lib/jfrog/repos/repos.js:        let target = spinner.next();
lib/jfrog/repos/repos.js:    let target = spinner.next();
lib/jfrog/repos/repos.js:        let warning = target.next();
lib/jfrog/repos/repos.js:    let warning = target.next();
lib/jfrog/repos/repos.js:        overrideCredentials = legacyInput.down('input[type=checkbox]').checked;
lib/jfrog/repos/repos.js:        password = legacyInput.down('input[name=_.password]').value;
lib/jfrog/repos/repos.js:    target.addClassName('error');
lib/jfrog/repos/repos.js:    target.removeClassName('error');
lib/jfrog/repos/repos.js:        username = legacyInput.down('input[name=_.username]').value;

Expected behavior

No usages of prototype

Screenshots If applicable, add screenshots to help explain your problem.

Versions

Additional context

This was originally posted here: https://issues.jenkins.io/browse/JENKINS-71671

timja commented 11 months ago

@eyalbe4

We plan to remove prototype.js from Jenkins in the weekly line on October 3rd and in LTS most likely 15th November

timja commented 10 months ago

fyi @yahavi

This plugin will break from next week in the weekly line.

yahavi commented 10 months ago

Thanks, @timja. We've created https://github.com/jfrog/jenkins-artifactory-plugin/pull/889 to remove the usage of prototype.js from the plugin. However, I'm still uncertain about how to handle Javascript binding. For instance: Javascript: https://github.com/jfrog/jenkins-artifactory-plugin/blob/artifactory-3.18.10/src/main/resources/lib/jfrog/repos/repos.js#L49 Java binding: https://github.com/jfrog/jenkins-artifactory-plugin/blob/artifactory-3.18.10/src/main/java/org/jfrog/hudson/ivy/ArtifactoryIvyFreeStyleConfigurator.java#L453

These requests are resulting in a 500 error.

timja commented 10 months ago

unsure off the top of my head, there is supposed to be shims in there to make it work out of the box without any changes from what I remember.

yahavi commented 10 months ago

Hi @timja, It's still not working, even though we haven't made any modifications. Who can lend us a hand with this? Thanks!

timja commented 10 months ago

can you write steps to reproduce please and I can try have a look (fyi @basil if you have any ideas)