fossas / fossa-cli

Fast, portable and reliable dependency analysis for any codebase. Supports license & vulnerability scanning for large monoliths. Language-agnostic; integrates with 20+ build systems.
https://fossa.com
Other
1.28k stars 173 forks source link

Ane 1252 preflight check #1371

Closed JeffreyHuynh1 closed 9 months ago

JeffreyHuynh1 commented 9 months ago

Overview

As a fossa user, I want fossa to perform pre-flight mode so I’m confident that my API key, and configuration and dependency files are valid.

Acceptance criteria

If fossa-cli, should be able to write to temp directory in the system

Testing plan

PreflightChecksSpec:

Manually tested related commands with invalid api key

Risks

Metrics

References

Checklist

JeffreyHuynh1 commented 9 months ago

The ticket specified to validate the .fossa.yml and fossa-deps.yml configs.

.fossa config is validated at parsing and an error will be thrown if the config isn't correct. Fossa-deps is only used in fossa analyze so I just moved that function call to validate fossa-deps earlier on in the analyze work flow. As a result, I didn't include the validation for .fossa and fossa-deps it in the preflightChecks function to avoid duplicate calls to validate the config files.

Was wondering if my logic makes sense, or if I should just add the config validation to the preflight checks?