-
Notifications
You must be signed in to change notification settings - Fork 39
chore: Generates and checks PURLS on the CI #1364
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
Conversation
| - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 | ||
| id: filter | ||
| with: | ||
| predicate-quantifier: 'every' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This avoids running contract test when only the files in /compliance have changed (see https://github.com/dorny/paths-filter/tree/de90cc6fb38fc0963ad72b210f1f284cd68cea36/ for more details)
| run: | | ||
| cd cfn-resources | ||
| go build -v ./... | ||
| - name: Install CloudFormation CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
necessary, as gen-purls runs make build inside the resource directory, and that runs cfn generate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need setup-python before, e.g.: https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/.github/workflows/publish.yaml#L56
| - '!cfn-resources/resource-policy/compliance/**' | ||
| search-deployment: | ||
| - 'cfn-resources/search-deployment/**' | ||
| serverless-private-endpoint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is serverless-private-endpoint not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is deprecated and tests can no longer be run (API does not work). I cleaned this up
| _Type_: String | ||
|
|
||
| _Minimum_: <code>20</code> | ||
| _Minimum Length_: <code>20</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like some changes are no related to the main changes of the PR, consider doing them in a different PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This are the changes of building the resources, which is needed to generate the PURLS. We need this if we want to generate the purls
| Action: | ||
| - "secretsmanager:GetSecretValue" | ||
| - "ec2:CreateVpcEndpoint" | ||
| - "ec2:DeleteVpcEndpoints" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar comment, these changes don't seem to be related to the main changes of the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This are the changes of building the resources, which is needed to generate the PURLS. We need this if we want to generate the purls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't this built first in a different PR? and then do the pr for purls?
| @@ -0,0 +1,19 @@ | |||
| pkg:golang/../vendor/go.mongodb.org/atlas-sdk/v20231115014@(devel) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I understand correctly, purls.txt depends on go.mod and go.sum. We share the same go.mod files for all the resources, so all purls.txt will be always be the same.
Do we need to generate all of them, or can we just generate one purls.txt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
purl file is generated from a binary, and a binary is generated for each of the resources, so even if they share go.mod and go.sum, technically the binary is different(and that is what we are shipping) so we have to generate the purls for each
| @@ -0,0 +1,30 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider exposing check & generate purls GHAs from TF repo so all the repos can use it, and we don't need the scripts & make goals in all the repos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CFN and TF are built different, so it's not exactly the same and wouldn't be 100% reusable. For now will keep it as is but will keep an eye for next repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, that's fair
|
Will not put PURLS in the repo anymore, and will generate it only when needed for the release |
Proposed changes
Majority of changes in this PR are due to building the resources and generating PURLS. Important changes are in
Makefile,/scriptsand.github/workflowsWill do a followup PR that will automatically update PURLS in dependabot PRs and SDK Updates
Link to any related issue(s): CLOUDP-324019
Type of change:
expected)
Manual QA performed:
Required Checklist:
make fmtand formatted my codeworks in Atlas
Further comments