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

Put explicit snyk scan workflow back #1695

Merged
merged 1 commit into from Mar 30, 2022
Merged

Put explicit snyk scan workflow back #1695

merged 1 commit into from Mar 30, 2022

Conversation

ozamosi
Copy link
Contributor

@ozamosi ozamosi commented Mar 11, 2022

This replaces the webhook, because the webhook does the
wrong thing:

  • You can't get the code scan to run using the webhook.
  • You also can't get snyk to look up go dependencies properly using the
    webhook (it uses go mod graph, which lists lots of packages that
    aren't part of your build, whereas the CLI uses go list, which only
    lists ones that are)

Thus, run all the checks manually.

Rather than putting them in a separate scan workflow, just put it into
an appropriate part of the overall PR workflow - that is:

  • The static check for all checks that don't require a built docker image
  • A bit of extra logic dunked at the end of the docker build to scan
    the built image
  • A new, post-merge job that uploads all the things.

Unfortunately, you can't (as far as I can tell) make github actions
depend on a status, only jobs, so while these jobs have to run, their
results aren't actually mandatory.

@ozamosi ozamosi marked this pull request as draft March 11, 2022 12:21
@ozamosi ozamosi force-pushed the explicit-snyk-workflow branch 9 times, most recently from 4247075 to dd384a7 Compare March 11, 2022 14:44
@mnowster mnowster self-requested a review March 11, 2022 14:47
Copy link
Contributor

@mnowster mnowster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the helpful description on names cos the prodcut names are a bit confusing.

@ozamosi ozamosi changed the base branch from v2 to main March 16, 2022 11:21
@ozamosi ozamosi force-pushed the explicit-snyk-workflow branch 10 times, most recently from fe165c5 to f08e63c Compare March 16, 2022 16:59
@ozamosi ozamosi force-pushed the explicit-snyk-workflow branch 2 times, most recently from e6f5a8c to a33ce4d Compare March 30, 2022 10:08
@ozamosi ozamosi marked this pull request as ready for review March 30, 2022 10:09
This replaces the webhook, because the webhook does the
wrong thing:

 * You can't get the code scan to run using the webhook.
 * You also can't get snyk to look up go dependencies properly using the
   webhook (it uses go mod graph, which lists lots of packages that
   aren't part of your build, whereas the CLI uses go list, which only
   lists ones that are)

Thus, run all the checks manually.

Rather than putting them in a separate scan workflow, just put it into
an appropriate part of the overall PR workflow - that is:
 * The static check for all checks that don't require a built docker image
 * A bit of extra logic dunked at the end of the docker build to scan
   the built image
 * A new, post-merge job that uploads all the things.

Unfortunately, you can't (as far as I can tell) make github actions
depend on a status, only jobs, so while these jobs have to run, their
results aren't actually mandatory.
@mnowster
Copy link
Contributor

reviewed and discussed 👍🏻

@ozamosi ozamosi merged commit d636ae1 into main Mar 30, 2022
@ozamosi ozamosi deleted the explicit-snyk-workflow branch March 30, 2022 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants