forcedotcom / sfdx-scanner

MIT License
214 stars 49 forks source link

[BUG] canner command not picking up files under ".folder" like ".jenkins" #1455

Closed Yogesh-Tiwari closed 3 months ago

Yogesh-Tiwari commented 5 months ago

Description:

Details:

stephen-carter-at-sf commented 5 months ago

Did you instead mean to do sf scanner run -t "./*/.cls" ?

Yogesh-Tiwari commented 4 months ago

Hi @stephen-carter-at-sf yes I am trying to run the same command.

stephen-carter-at-sf commented 4 months ago

@Yogesh-Tiwari Oh I see the markdown in github is removing what you typed visually. Are you calling this from a jenkinsFile or something? If so, can you show me the code where you actually make this call.

Also, can you confirm that the environment that you are running this from in jenkins has your files actually checked out. Doing an ls or something first may help you confirm it in the logs.

stephen-carter-at-sf commented 3 months ago

OK, we were finally able to reproduce this and get to the bottom of things.

The issue is that inside of a jenkins environment, all of your files are being placed underneith a parent directory called .jenkins. In fact we are finding that if the files you want to scan live under any .folder then these files are hidden to our scanner when it comes to discovery of files.

We will try our best to find a solution to this. In the meantime, maybe you can move your files into a temporary folder on the machine that doesn't live underneith a .jenkins folder and run your scan from there, and then move the output file back into the target directory. I know this workaroudn isn't elegant - so we'll keep you updated on whether or not we can fix this asap.

git2gus[bot] commented 3 months ago

This issue has been linked to a new work item: W-16121713

stephen-carter-at-sf commented 3 months ago

We are hoping to submit a patch release by 4.3.1 tomorrow evening which will fix this so that it unblocks all jenkins users.

stephen-carter-at-sf commented 3 months ago

Ended up shipping as 4.3.2 actually... but is the latest. So you should be able to do a sf plugins install @salesforce/sfdx-scanner to get this change as the latest.

Yogesh-Tiwari commented 3 months ago

Thanks for the update @stephen-carter-at-sf.