Skip to content

fix: exclude parents rulesets#2573

Merged
marcoieni merged 1 commit into
mainfrom
fix-exclude-parents-rulesets
Jul 10, 2026
Merged

fix: exclude parents rulesets#2573
marcoieni merged 1 commit into
mainfrom
fix-exclude-parents-rulesets

Conversation

@marcoieni

@marcoieni marcoieni commented Jul 10, 2026

Copy link
Copy Markdown
Member

I defined an organization ruleset for the repositories with the crabwatch = true custom properties.
Unfortunately, now CI fails because when retrieving repository rulesets, it doesn't recognize the "workflows" type.

This PR unblocks CI.

Here is the error I saw when applying #2572:

**Error:** rust_team] failed: Cannot deserialize type `rust_team::sync::github::api::Ruleset` from the following response body:
    {
      "_links": {
        "html": {
          "href": "[https://github.com/rust-lang/crabwatch/rules/18624409](https://github.com/rust-lang/crabwatch/rules/18624409)"
        },
        "self": {
          "href": "[https://api.github.com/repos/rust-lang/crabwatch/rulesets/18624409](https://api.github.com/repos/rust-lang/crabwatch/rulesets/18624409)"
        }
      },
      "bypass_actors": [],
      "conditions": {
        "ref_name": {
          "exclude": [],
          "include": [
            "~DEFAULT_BRANCH"
          ]
        }
      },
      "created_at": "2026-07-07T16:08:44.564+02:00",
      "current_user_can_bypass": "never",
      "enforcement": "active",
      "id": 18624409,
      "name": "crabwatch",
      "node_id": "RRS_lACkVXNlcs4AUt55zgEcL5k",
      "rules": [
        {
          "parameters": {
            "do_not_enforce_on_create": false,
            "workflows": [
              {
                "path": ".github/workflows/crabwatch.yml",
                "ref": "refs/heads/main",
                "repository_id": 1256932671
              }
            ]
          },
          "type": "workflows"
        }
      ],
      "source": "rust-lang",
      "source_type": "Organization",
      "target": "branch",
      "updated_at": "2026-07-09T16:53:19.260+02:00"
    }
**Error:** rust_team] caused by: unknown variant `workflows`, expected one of `creation`, `update`, `deletion`, `required_linear_history`, `merge_queue`, `required_deployments`, `required_signatures`, `pull_request`, `required_status_checks`, `non_fast_forward` at line 1 column 224
**Error:** Process completed with exit code 1.

AI disclosure

I used GPT5.6 with the codex harness to generate this change. I reviewed its output and changed it where necessary.

@marcoieni marcoieni force-pushed the fix-exclude-parents-rulesets branch from 5e89d2f to f8e8ff4 Compare July 10, 2026 14:17
@marcoieni marcoieni marked this pull request as ready for review July 10, 2026 14:20
@marcoieni marcoieni force-pushed the fix-exclude-parents-rulesets branch 2 times, most recently from 95b160b to bda15dd Compare July 10, 2026 14:23
@github-actions

Copy link
Copy Markdown
Dry-run check results

[WARN  rust_team::sync] sync-team is running in dry mode, no changes will be applied.
[INFO  rust_team::sync] synchronizing crates-io
[INFO  rust_team::sync] synchronizing github

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks reasonable to me, but since this changes our permission handling, I'd like an infra-admin to double-check.

@jieyouxu jieyouxu added needs-infra-admin-review This change requires one of the `infra-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin. labels Jul 10, 2026
@marcoieni marcoieni added this pull request to the merge queue Jul 10, 2026
Merged via the queue into main with commit fd38345 Jul 10, 2026
4 checks passed
@marcoieni marcoieni deleted the fix-exclude-parents-rulesets branch July 10, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-infra-admin-review This change requires one of the `infra-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants