feat(snyk support): Changes to use Snyk for dependencies, licenses, and code analysis #257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This is a changeset that accommodates Snyk automatic PR deployment and removes OBE workflows.
Linked Issues to Close
None
Approach
Snyk is a comprehensive security tool that scans and fixes vulnerabilities in open-source code, containers, and configurations. It can open pull requests to keep dependencies up to date, fix vulernable packages, check Pull Requests for new issues, check for license issues, and perform static code analysis. Macpro recently onboarded to an enterprise Snyk installation, this repo included. The configuration of PR checks and dependency update configuration is controlled in that instance, and not addressed here.
However, one behavior of Snyk is problematic for us. The branch names used when Snyk opens a PR are very long. This causes deployment failures due to some amazon resources having name length limits; we were going over them by double digits.
To correct the name length limit, the setting of our stage name in our workflows has been modified: if the branch name starts with "snyk-", then the stage name will be set to just "snyk". This way, deploy/destroy can occur for snyk generated branches. We are still using environment locking based on stage name, so only one operation against the 'snyk' stage will occur at any given time. However, because Snyk is configured to only have open one PR at a time, this shouldn't need to be relied upon.
Other things in this PR:
Assorted Notes/Considerations/Learning
If this goes into master and works out, our other repos could use this change as they suffer the same branch name issue and contain some of the same OBE workflows.