Skip to content

Opt in to .asf.yaml rulesets staged rollout #4603

Closed

Description

@Yicong-Huang

Task Summary

Follow-up to #4579 / #4582.

The Release Branch Protection ruleset added in #4582 is currently a no-op: GitHub API confirms release/v1.1.0-incubating has no active rules and the repository has no rulesets at all (/repos/apache/texera/rulesets returns []).

Root cause: in apache/infrastructure-asfyaml, the rulesets directive is gated behind a staged-rollout flag — see asfyaml/feature/github/rulesets.py:

@directive
def rulesets(self):
    if "github_rulesets" not in self.instance.environments_enabled:
        return

The schema accepts rulesets: (so no parse error fires), but the directive returns early unless the project opts in via meta: (see asfyaml/asfyaml.py).

This task: add the opt-in so the existing Release Branch Protection ruleset actually gets reconciled into GitHub.

meta:
  environment: github_rulesets

Priority

P1 – High

Task Type

  • DevOps / Deployment

Activity

  1. added a commit that references this issue on May 1, 2026
    8756165
  2. Yicong-Huang commented on May 1, 2026

    @Yicong-Huang
    ContributorAuthor

    Reopening — PR #4604 was merged 18+ minutes ago and the opt-in had no observable effect:

    • GET /repos/apache/texera/rulesets → []
    • GET /repos/apache/texera/rules/branches/release/v1.1.0-incubating → []

    Root cause traced into apache/infrastructure-asfyaml:

    1. The dispatcher (infrastructure-p6/modules/gitbox/files/asfgit/hooks/post-receive.d/05-asfyaml.py) routes to next-gen by default and our meta.environment: github_rulesets opt-in is honored, so the rulesets directive does run.
    2. But _build_ref_name_condition in asfyaml/feature/github/rulesets.py does not prefix bare convenience patterns with refs/heads/. Our release/* is sent as-is to the GitHub Rulesets API, which requires refs/heads/release/* (or ~DEFAULT_BRANCH / ~ALL).
    3. The reconciler's REST calls do not check HTTP status codes, so the resulting 422 is silently swallowed — no email, no log, /rulesets stays empty.

    Both bugs are being addressed in apache/infrastructure-asfyaml#93 ("Follow-up fixes for the GitHub rulesets feature") which is still open. apache/logging-parent — the only other ASF project that has tried this opt-in — also has empty /rulesets for related reasons.

    Reverting #4604 to keep main clean. Will revisit once apache/infrastructure-asfyaml#93 is merged upstream, or pursue an INFRA Jira ticket (Kafka-style, INFRA-26603 precedent).

  3. added theissue type on May 1, 2026
  4. Yicong-Huang commented on Jun 7, 2026

    @Yicong-Huang
    ContributorAuthor

    Resolved. The meta.environment: github_rulesets opt-in was re-added incidentally by #5036 (merge queue setup), then INFRA's #5080 (Set up default rulesets for default and release branches) installed the actual rulesets, and #5139 (fix: enable ASF nextgen config) added meta.nextgen: true to let the next-gen parser apply them.

    Verified on apache/texera now:

    ```
    $ gh api repos/apache/texera/rulesets --jq '.[] | {id, name, enforcement}'
    {"id":16663487,"name":"Default Branch Protection","enforcement":"active"}
    {"id":16663486,"name":"Merge Queue","enforcement":"active"}
    ```

    No longer the empty [] from the original report. Closing.

  5. added a commit that references this issue on Jun 22, 2026
    9f85f29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions