openshift / openshift/ci-tools

Support `github_merge_blocks_policy` in per-repo supplemental prow config (`_prowconfig.yaml`)

Open
#5,353 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
44
Forks
336
Avg merge
1d 3h
Merged PRs (30d)
47

Description

Summary

The supplemental per-repo prow config (_prowconfig.yaml) currently only supports a limited set of fields under tide:. The TideConfig struct in pkg/api/shardprowconfig/shardprowconfig.go only defines merge_method and queries:

type TideConfig struct {
	MergeType map[string]types.PullRequestMergeType `json:"merge_method,omitempty"`
	Queries   prowconfig.TideQueries                `json:"queries,omitempty"`
}

This means github_merge_blocks_policy (added in upstream Prow via kubernetes-sigs/prow#579) cannot be configured per-repo in _prowconfig.yaml files — it can only be set in the main _config.yaml.

Problem

When a repo team adds github_merge_blocks_policy to their per-repo _prowconfig.yaml, CI validation fails with:

only 'branch-protection', 'slack_reporter_configs', 'tide.merge_method' and 'tide.queries' may be set via additional config, all other fields have no merging logic yet

This forces teams to modify the central _config.yaml in openshift/release to set github_merge_blocks_policy for their repos, which is less self-service than the per-repo config approach.

Context

github_merge_blocks_policy was introduced in upstream Prow (kubernetes-sigs/prow#579) to fix Tide's retry loop when enforce_admins: true and required_approving_review_count > 0 are configured (kubernetes-sigs/prow#673). Without it, Tide repeatedly attempts to merge PRs that GitHub blocks, causing unnecessary API calls and delays.

The OpenShift CI Prow deployment already includes support for this field — it appears in the diff output as GitHubMergeBlocksPolicyMap. The missing piece is the ci-tools supplemental config merge logic.

See also: https://github.com/openshift/release/pull/82902 (a PR that attempted to set this per-repo and hit this validation error).

Requested Change

  1. Add GitHubMergeBlocksPolicy to the TideConfig struct in pkg/api/shardprowconfig/shardprowconfig.go
  2. Add merge logic in ShardProwConfig to shard and merge this field similar to how MergeType is handled
  3. Update any validation/error messages to include the new field in the list of supported fields

The field is a map[string]prowconfig.TideGitHubMergeBlocksPolicy keyed by org/repo, which is the same pattern as merge_method — so the existing merge logic pattern should apply directly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with TideConfig and ShardProwConfig in pkg/api/shardprowconfig/shardprowconfig.go, then trace the existing MergeType sharding and merge logic and the validation message for supported supplemental fields. Confirm the related prowconfig type, update the merge path consistently, and verify that per-repo github_merge_blocks_policy passes validation and is preserved in the merged configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
ci-cd, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.