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

Add script to write prow branchprotector checks contexts #205

Merged

Conversation

BobyMCbobs
Copy link
Contributor

@BobyMCbobs BobyMCbobs commented Oct 10, 2023

given output of ./hack/list-checks.sh (in this branch or #204), generate or update configuration consumable in Prow's branchprotector (https://docs.prow.k8s.io/docs/components/optional/branchprotector)

branch based off of #204

usage

dump the state of the world

./hack/list-checks.sh | ./hack/set-bp-yaml-checks.sh PATH_TO_CONFIG.yaml sow

input the latest workflow contexts

./hack/list-checks.sh | ./hack/set-bp-yaml-checks.sh PATH_TO_CONFIG.yaml update

applying with a container image

podman run -it --rm \
  -v "PATH_TO_TOKEN:PATH_TO_TOKEN:row" \
  -v "PATH_TO_CONFIG:PATH_TO_CONFIG:ro" \
  gcr.io/k8s-prow/branchprotector:v20231011-acf4a2e26b \
    --github-token-path PATH_TO_TOKEN \
    --config-path PATH_TO_CONFIG.yaml # --confirm

or applying with go run

go run k8s.io/test-infra/prow/cmd/branchprotector@acf4a2e26b --github-token-path PATH_TO_TOKEN --config-path PATH_TO_CONFIG.yaml # --confirm

@BobyMCbobs BobyMCbobs requested a review from a team October 10, 2023 22:32
@BobyMCbobs BobyMCbobs force-pushed the add-script-to-write-prow-branchprotector-checks-contexts branch 3 times, most recently from 6b3bd01 to 3442a91 Compare October 13, 2023 00:34
@BobyMCbobs BobyMCbobs force-pushed the add-script-to-write-prow-branchprotector-checks-contexts branch 12 times, most recently from e78a39e to 2935015 Compare October 15, 2023 23:01
pass through the output of ./hack/list-checks.sh to ./hack/set-checks.sh
and create or update the branch protection rule for the main branch
@BobyMCbobs BobyMCbobs force-pushed the add-script-to-write-prow-branchprotector-checks-contexts branch 5 times, most recently from a571275 to 373ad5c Compare October 17, 2023 02:59
from the format of ./hack/list-checks.sh
@BobyMCbobs BobyMCbobs force-pushed the add-script-to-write-prow-branchprotector-checks-contexts branch from 373ad5c to a2261bc Compare October 17, 2023 03:23
@quiffman quiffman merged commit b0bcc56 into main Oct 17, 2023
@quiffman quiffman deleted the add-script-to-write-prow-branchprotector-checks-contexts branch October 17, 2023 20:49
@BobyMCbobs
Copy link
Contributor Author

@quiffman, thank you!

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.

2 participants