apigee / apigeelint

Static code analysis for Apigee proxy bundles to encourage API developers to use best practices and avoid anti-patterns.
Apache License 2.0
91 stars 71 forks source link

BUG: DOM error #412

Closed marta-alberto closed 7 months ago

marta-alberto commented 7 months ago

Dear apigeelint team,

When using the apigeelint 2.45.0 version we get the following error when linting an Apigee proxy:

Error: Context node does not appear to be a valid DOM node. at XPath.evaluate (/home/jenkins/npm-global/lib/node_modules/apigeelint/node_modules/xpath/xpath.js:1359:19) at XPathExpression.evaluate (/home/jenkins/npm-global/lib/node_modules/apigeelint/node_modules/xpath/xpath.js:4536:33) at exports.selectWithResolver (/home/jenkins/npm-global/lib/node_modules/apigeelint/node_modules/xpath/xpath.js:4989:33) at exports.select (/home/jenkins/npm-global/lib/node_modules/apigeelint/node_modules/xpath/xpath.js:4969:24) at FlowPhase.getSteps (/home/jenkins/npm-global/lib/node_modules/apigeelint/lib/package/FlowPhase.js:50:21) at /home/jenkins/npm-global/lib/node_modules/apigeelint/lib/package/Endpoint.js:306:35 at Array.forEach () at /home/jenkins/npm-global/lib/node_modules/apigeelint/lib/package/Endpoint.js:304:17 at Array.forEach () at Endpoint.getSteps (/home/jenkins/npm-global/lib/node_modules/apigeelint/lib/package/Endpoint.js:299:8)

Command line: apigeelint --profile apigee -s ./our-proxy-dir-name/apiproxy -e PO005 -f table.js

However, Apigee linting seems to continue and shows to us the table output with the results:

╔════════════════════════════════════════════════════════════════════════════════════ ║ 0 Errors ║ ╟─────────────────────────────────────────────────────────── ║ 0 Warnings ║ ╚═════════════════════════════════════════════════════════════

Same linting command line was working smoothly with apigeelint 2.44.0.

Best regards

ssvaidyanathan commented 7 months ago

@marta-alberto - looks like the latest release (v0.0.34) of xpath is causing this issue.

CC - @DinoChiesa

marta-alberto commented 7 months ago

Hello @ssvaidyanathan ,

Thanks for your swift reply!

Do you have any suggestion on how can i overcome this issue?

Best regards

ssvaidyanathan commented 7 months ago

@marta-alberto - pls continue using v2.44.0 until a fix is pushed

marta-alberto commented 7 months ago

hello @ssvaidyanathan ,

Do you have any rough estimation delivery date for the fix?

Many thanks!!

ssvaidyanathan commented 7 months ago

not at the moment - the best I could do right now is release a patch version with the previous version of xpath..

ssvaidyanathan commented 7 months ago

Published v2.46.3 Please test and see if the issue still persists

marta-alberto commented 7 months ago

Hello @ssvaidyanathan ,

v2.46.3 works like a charm 💯

Many thanks for your quick fix!! 👍