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-73744] npm scripts lint:fix do not work #9713

Closed
wants to merge 4 commits into from

Conversation

scherler
Copy link
Contributor

See JENKINS-73744.

Testing done

Proposed changelog entries

  • human-readable text

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

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

Maintainer checklist

@scherler scherler changed the title [JENKINS-73744] [JENKINS-73744] npm scripts lint:fix do not work Sep 10, 2024
Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

Previously: JENKINS-71021, #9615.

Fails interactive testing. Steps to reproduce are as follows: intentionally introduce a violation to core/src/main/resources/lib/form/password/password.js, then run mvn clean verify -DskipTests.

diff --git a/core/src/main/resources/lib/form/password/password.js b/core/src/main/resources/lib/form/password/password.js
index 4cd33dbfc6..70d24f77db 100644
--- a/core/src/main/resources/lib/form/password/password.js
+++ b/core/src/main/resources/lib/form/password/password.js
@@ -28,9 +28,8 @@ Behaviour.specify(
   0,
   function (e) {
     var secretUpdateBtn = e.querySelector(".hidden-password-update-btn");
-    if (secretUpdateBtn === null) {
+    if (secretUpdateBtn === null)
       return;
-    }
 
     secretUpdateBtn.onclick = function () {
       e.querySelector(".hidden-password-field").setAttribute(

Before this PR, the yarn lint:ci portion of the Maven build fails, and running yarn lint as documented in CONTRIBUTING.md fails with

core/src/main/resources/lib/form/password/password.js
  32:7  error  Expected { after 'if' condition  curly

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

After this PR, the yarn lint:ci portion of the Maven build (erroneously!) succeeds, and running yarn lint as documented in CONTRIBUTING.md (erroneously!) passes. This is a regression.

@timja
Copy link
Member

timja commented Sep 10, 2024

FWIW the instructions in #9615 do work but something is wrong as the local project yarn should be picked up, I'm not sure why the PATH workaround is needed.

@scherler
Copy link
Contributor Author

@basil thanks for pointing out, lemme investigate how https://github.com/jenkinsci/jenkins/pull/9615/files#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055R58 could be prevented since that is not something you want to have to do working with yarn I wonder whether it makes sense to move the whole npm to the root folder since it has to cover 2 subfolder but maybe there is a reason not to do so. Further I wonder why js is kept in core and not in war which would be another possible solution.

@scherler
Copy link
Contributor Author

BTW I tried the workaround
image
...but that did not work

@timja timja added the web-ui The PR includes WebUI changes which may need special expertise label Sep 11, 2024
@scherler
Copy link
Contributor Author

@basil @timja #9718 one thing I am unsure is to use env.CI to use lint:fix and if not set lint so we get back the stack trace

@scherler scherler closed this Sep 11, 2024
@basil
Copy link
Member

basil commented Sep 11, 2024

use env.CI to use lint:fix and if not set lint so we get back the stack trace

As suggested in #6948 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants