npm-groovy-lint: Error "unable to resolve class Library" with npm-groovy-lint@15.0.1
Since 15.0.1 we see this error validating our Jenkins script:
Jenkinsfile.groovy
0 error Unknown parsing error: "Jenkinsfile.groovy: 1: unable to resolve class Library for annotation\n @ line 1, column 1.\n @Library('ff-pipeline-lib@LKG') _\n ^\n" NglParseError
The problematic line of code looks like this:
@Library('ff-pipeline-lib@LKG') _
I am using the “recommended-jenkinsfile” configuration.
I tried against these currently available versions:
15.0.0 - Good 15.0.1 - Bad 15.0.2 - Bad
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 19
- Comments: 30 (12 by maintainers)
Commits related to this issue
- fix: downgrate npm-groovy-lint to 15.0.0 Fix #6371 npm-groovy-lint > 15.0.0 is impacted by: - https://github.com/nvuillam/npm-groovy-lint/issues/428 - https://github.com/nvuillam/npm-groovy-lint/is... — committed to super-linter/super-linter by ferrarimarco 2 years ago
- fix: downgrade npm-groovy-lint to 15.0.0 Fix #6371 npm-groovy-lint > 15.0.0 is impacted by: - https://github.com/nvuillam/npm-groovy-lint/issues/428 - https://github.com/nvuillam/npm-groovy-lint/is... — committed to super-linter/super-linter by ferrarimarco 2 years ago
- fix: downgrade npm-groovy-lint to 15.0.0 Fix #6371 npm-groovy-lint > 15.0.0 is impacted by: - https://github.com/nvuillam/npm-groovy-lint/issues/428 - https://github.com/nvuillam/npm-groovy-lint/is... — committed to super-linter/super-linter by ferrarimarco 2 years ago
- fix: downgrade npm-groovy-lint to 15.0.0 (#6373) Fix #6371 npm-groovy-lint > 15.0.0 is impacted by: - https://github.com/nvuillam/npm-groovy-lint/issues/428 - https://github.com/nvuillam/npm-groovy... — committed to super-linter/super-linter by ferrarimarco 2 years ago
@nvuillam I think lots of us in here would appreciate it if we could get this looked at and released as soon as you can.
https://github.com/nvuillam/npm-groovy-lint/pull/444
Thank you ❤️ I appreciate the
npm-groovy-lintproject.@nvuillam I tested the new release and I believe we can close this. My jenkins pipelines being linted are getting the correct diagnostics and
npm-groovy-lintno longer has issues onLibrary()orimportsIt seems like the parseError at line 247 in codenarc-factory.js is now a String causing
parseError.causeetc to fail.I added some debug prints to codenarc-factory.js like this:
Output of debug prints (anonymized hence the garbage names)
Causing the following error:
Gonna throw this out there because I get notified about this issue every month, but not about any progress.
https://fvsch.com/stale-bots#:~:text=are not valued.-,Stale bots break your bug tracker,3%2C 6 or 12 months.
I really don’t like the stale bot.
unstale
I still would like to see this issue resolved
Thanks for your suggestion, we stick to the previous 15.0.0 version as a workaround.
@geoffswift @edwardtew @dahorak Until we find a fix, you can try with
--no-parseas workaroundTo add to this. This is what the response from codenarc server looks like
About here in the groovy we are expecting parseErrors to be a list of strings https://github.com/nvuillam/npm-groovy-lint/blob/main/groovy/src/main/com/nvuillam/Request.groovy#L149
Which comes out as string from here https://github.com/nvuillam/npm-groovy-lint/blob/main/groovy/src/main/com/nvuillam/Request.groovy#L214
For now I can atleast say that
parseFileinv15.0.0looked different https://github.com/nvuillam/npm-groovy-lint/blob/v15.0.0/groovy/src/main/com/nvuillam/Request.groovy#L214It used to return a typeof
List<Error>which is probably what the frontendcodenarc-factory.jsis expecting.Which changed in this PR: https://github.com/nvuillam/npm-groovy-lint/pull/420
unstale
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the
O: stale 🤖label or comment on the issue.Yes, this issue prevents us from using a newer version. Please fix! Thank you!
Bump. Don’t close please
I am also seeing this issue when using the latest code/container image