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

Scan crashes when there are no files moved into temporary folder #5

Closed
mitchspano opened this issue Aug 1, 2022 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@mitchspano
Copy link
Owner

If the scope of the pull request does not generate any files to be moved into the temporary folder, the scan crashes.

This can happen if the PR only contains modifications to the .github folder, and potentially other scenarios as well.

The system should gracefully exit if there is nothing in temporary.

Getting difference since Last commit...
Recursively moving all files to the temp folder...
(node:1[8](https://github.com/rsoesemann/salesforce-recipes/runs/7617039009?check_suite_focus=true#step:4:9)31) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Performing static code analysis on all of the files in the difference...
WARNING: We're constantly improving Salesforce Code Analyzer. Tell us what you think! Give feedback at https://research.net/r/SalesforceCA.
WARNING: In September 2022, v3.x of the Salesforce Code Analyzer will become the default version,
         and older versions, including your currently installed version, will no longer be supported.
         You can manually update to v3.x earlier for a smoother transition.
WARNING: As of April 27, 2022, v3.x of the Salesforce Code Analyzer is available as an open pilot.
         To update to v3.x and try out our pilot features, run these commands:
         > sfdx plugins:uninstall @salesforce/sfdx-scanner
         > sfdx plugins:install @salesforce/sfdx-scanner@latest-pilot
WARNING: Target: 'temporary' was not processed by any engines.
node:fs:585
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open '/home/runner/work/salesforce-recipes/salesforce-recipes/sfdx-scanner-findings.json'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at performStaticCodeAnalysisOnFilesInDiff (/home/runner/work/_actions/mitchspano/sfdx-scan-pull-request/v0.1/dist/index.js:7[15](https://github.com/rsoesemann/salesforce-recipes/runs/7617039009?check_suite_focus=true#step:4:16)64:33)
    at main (/home/runner/work/_actions/mitchspano/sfdx-scan-pull-request/v0.1/dist/index.js:717[16](https://github.com/rsoesemann/salesforce-recipes/runs/7617039009?check_suite_focus=true#step:4:17):3) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/runner/work/salesforce-recipes/salesforce-recipes/sfdx-scanner-findings.json'
}
mitchspano added a commit that referenced this issue Aug 3, 2022
- Rename `getDiffSinceLastCommit` to `getDiffInPullRequest` #2
- Gracefully exit is ther are no applicable files found in the git difference between the branches in the pull request  #5
@mitchspano mitchspano added the bug Something isn't working label Aug 3, 2022
mitchspano added a commit that referenced this issue Aug 3, 2022
… | `node_modules` instead of Vercel (#8)

- Rename `getDiffSinceLastCommit` to `getDiffInPullRequest`#2
- Support additional attributes passed into the scan command #3
- Gracefully exit is there are no applicable files found in the git difference between the branches in the pull request  #5
- Get rid of vercel created dist folder - use node_modules instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant