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

ci: improved skips without breaking branch protection #3460

Closed
terriko opened this issue Oct 24, 2023 · 3 comments
Closed

ci: improved skips without breaking branch protection #3460

terriko opened this issue Oct 24, 2023 · 3 comments
Labels
CI Related to our continuous integration service (GitHub Actions) hacktoberfest good issue for hacktoberfest participation

Comments

@terriko
Copy link
Contributor

terriko commented Oct 24, 2023

So, the fix we tried in #3415 works great for the non-required jobs: skipping the windows tests on the sboms is saving us a solid hour of compute time for each sbom PR and that's the behaviour we wanted, But unfortunately when the skipped jobs are required by our branch protection rules we still wind up with SBOM PRs that can never be merged:

SkippedChecks

So, obviously those skips aren't going to work on the linux test and linux longtest jobs.

I've taken out the if statements on the required workflows as part of #3449 but while I was there I've been trying to experiment with other options. It looks like having the if: apply to the whole job is no good, but we are able to skip individual steps with an if: (this is done regularly for the cache copy) so if we can figure out how to get a check in the steps instead of against the whole job that would probably work. Unfortunately, just copying the if statement down didn't seem to do what I expected (the steps I'd put the if on ran anyhow.)

While I was digging around I found this workaround that might be close to what we want where you shove stuff into an environment variable to use later: https://microsoft.github.io/code-with-engineering-playbook/continuous-delivery/devops-provider-recipes/github-actions/runtime-variables/runtime-variables/ I'm not sure if we need to that here, but we'd likely want to do something like this to make the code easier to read if we're going to skip a lot of the individual steps anyhow.

I'm going to tag @raffifu in case you want to take a look at it again.

@terriko terriko added hacktoberfest good issue for hacktoberfest participation CI Related to our continuous integration service (GitHub Actions) labels Oct 24, 2023
@raffifu
Copy link
Contributor

raffifu commented Oct 25, 2023

Will work on this asap. I want to implement if: statement on the steps instead on the jobs. If it didn't works, i think the only way is to write shellscript like the shared link above

@terriko
Copy link
Contributor Author

terriko commented Oct 25, 2023

I've got something that might work in #3446 and am waiting on the tests to run to see if it does the trick.

@terriko
Copy link
Contributor Author

terriko commented Apr 17, 2024

We've resolved this sufficiently well for now, so I'm going to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Related to our continuous integration service (GitHub Actions) hacktoberfest good issue for hacktoberfest participation
Projects
None yet
Development

No branches or pull requests

2 participants