megalinter icon indicating copy to clipboard operation
megalinter copied to clipboard

Salesforce SFDX CLI Update message confuses the regex parser

Open mcdcb opened this issue 2 years ago • 7 comments

Describe the bug We're trying to run the Salesforce SFDX linter suite and it looks like it's failing because the megalinter parser tries to parse the update warning from sfdx-cli. (We expect to see one issue with the code but it returns nothing but the green check)

The exact error message: Unable to extract version with regex re.compile('(?<=@salesforce/sfdx-scanner )\\d+(\\.\\d+)+') from › Warning: sfdx-cli update available from 7.144.2 to 7.145.0.

To Reproduce Steps to reproduce the behavior:

  1. Go to megalinter results
  2. Click on logs
  3. Scroll down to SALESFORCE_SFDX_SCANNER_AURA results
  4. See error no plugins installed (screenshot attached)

Expected behavior Either the parsing should ignore the sfdx-cli update message, or the sfdx update command should be run each time to ensure we're on the latest version.

The parsing code seems to be here: https://github.com/megalinter/megalinter/blob/main/megalinter/Linter.py#L715

Screenshots Added screenshot of the error Screen Shot 2022-04-09 at 9 52 15 AM

Additional context We think this is the root issue, but happy to be wrong :)

mcdcb avatar Apr 09 '22 16:04 mcdcb

I'm seeing a similar issue. I have attached the log files from the resulting run. mega-linter.log SUCCESS-SALESFORCE_SFDX_SCANNER_APEX.log SUCCESS-SALESFORCE_SFDX_SCANNER_AURA.log SUCCESS-SALESFORCE_SFDX_SCANNER_LWC.log

nmhegde-cb avatar Apr 18 '22 16:04 nmhegde-cb

According to your logs, the issue is more than sfdx-scanner is not installed than the not retrievable version :/

What version of MegaLinter are you using ?

nvuillam avatar Apr 18 '22 16:04 nvuillam

I tried both the beta & v5 version. It seems like it's happening for both of the versions.

nmhegde-cb avatar Apr 18 '22 16:04 nmhegde-cb

I'm currently stucked on git safe.directory hell https://github.com/megalinter/megalinter/issues/1416 but i'll try to look on this issue later if someone does not find a solution before :)

nvuillam avatar Apr 18 '22 17:04 nvuillam

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.

github-actions[bot] avatar May 19 '22 01:05 github-actions[bot]

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.

github-actions[bot] avatar Jun 21 '22 01:06 github-actions[bot]

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.

github-actions[bot] avatar Jul 22 '22 01:07 github-actions[bot]

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.

github-actions[bot] avatar Sep 05 '22 01:09 github-actions[bot]