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

✨ Allow main branch only for trusted builder and e2e tests repos #63

Merged
merged 17 commits into from
May 26, 2022

Conversation

laurentsimon
Copy link
Contributor

@laurentsimon laurentsimon commented May 24, 2022

This is part of trying to reduce the time of compilation slsa-framework/slsa-github-generator#74

This PR allows the trusted builder and e2e repos to build using a trusted builder referenced at @main. This is an exception that is needed to use the builder binary generated during a release: the builder needs to build itself from main. For the e2e tests,, we also want to tests at main.
For any other repos, this is not allowed, and trusted builder referenced at a version/tag is required.

@laurentsimon
Copy link
Contributor Author

laurentsimon commented May 25, 2022

In order to fix the unit tests, we need to merge slsa-framework/slsa-github-generator#86 and generate the provenance with the trusted builder pinned with a tag. This is because starting with this PR, we only accept tagged's trusted builders (except for the old ones which we're going to deprecate as well once we fix the other unit tests)

@laurentsimon laurentsimon mentioned this pull request May 25, 2022
9 tasks
@laurentsimon laurentsimon added this to the v1 milestone May 25, 2022
@laurentsimon
Copy link
Contributor Author

Ready for review, PTAL

@laurentsimon laurentsimon changed the title ✨ Allow main branch for trusted builder ✨ Allow main branch only for trusted builder and e2e tests repos May 26, 2022
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
@@ -31,259 +32,260 @@ func Test_runVerify(t *testing.T) {
{
name: "valid main branch default",
artifact: "./testdata/binary-linux-amd64-workflow_dispatch",
source: "github.com/asraa/slsa-on-github-test",
source: "github.com/laurentsimon/slsa-verifier-test-gen",
Copy link
Member

Choose a reason for hiding this comment

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

Was changing this necessary for some reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just because I don't have access to Asra's repo so I could not re-generate the binaries under metadata/. In the future, I think we may want to create a repo just for that. I can create a repo under https://github.com/ossf-tests/, ilke https://github.com/ossf-tests/slsa-test-generators, or we create a new repo under slsa-framework

Copy link
Member

Choose a reason for hiding this comment

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

I see. We need to re-generate them by building in a github action but I guess doing it in this repo is problematic? Maybe a workflow that is only triggered by workflow_dispatch would work?

We probably want to have a readme in the testdata directory to document how to regenerate it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed on all these steps. What repo name shall we create?

Copy link
Member

@ianlewis ianlewis May 27, 2022

Choose a reason for hiding this comment

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

Under ossf-tests is fine probably

pkg/provenance.go Outdated Show resolved Hide resolved
pkg/provenance.go Show resolved Hide resolved
Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

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

+1 that we need a generator test repository that we have perms to trigger workflows

pkg/provenance.go Show resolved Hide resolved
@laurentsimon laurentsimon enabled auto-merge (squash) May 26, 2022 15:22
@laurentsimon laurentsimon merged commit f9e31da into slsa-framework:main May 26, 2022
laurentsimon added a commit to laurentsimon/slsa-verifier that referenced this pull request Aug 3, 2022
…a-framework#63)

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* Fix unit tests

* unit tests

* updates

* updates

* updates

* updates

* updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants