Skip to content

configure.sh: the label payload validator admits duplicate names and uppercase hex, and merges its refusal causes #1372

Closed

Description

@ptr727

Deferred from #1334 under outcome 4, after two granted rounds. All three sit in labels_payload_ok in repo-config/configure.sh, the shared pre-flight validator for repo-config/labels.json.

  1. Duplicate names pass. Two entries with the same name are accepted, apply_labels writes both last-wins, and check_labels asserts the first row against the second's live values, so the check fails on every run and no re-apply clears it. ruleset_id one function away already warns on a duplicate ruleset name for the same reason. Fix: (map(.name) | unique | length) == length in the validator.
  2. Uppercase hex passes but never matches. The color test admits A2EEEF, and check_labels compares the payload color byte-exact against the stored one, so an uppercase entry applies and then reads as permanent drift if GitHub stores colors lowercased. Fix: lowercase-only in the test, or lowercase both sides of the comparison. Which GitHub does was not exercised, so confirm against the API when fixing.
  3. One refusal message for five causes. The predicate folds unparseable, not an array, empty, out of contract, and jq itself failing into one boolean and discards jq's stderr, where check_settings separates "did not parse" from "declares no keys" on purpose. A jq built without regex support fails the predicate and blames a valid payload. Fix: split the parse step from the contract step, as the settings check does.

A constructed payload demonstrates each: two entries named a, one entry colored A2EEEF, and a payload run against a jq lacking test/1.

Activity

  1. added
    script
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    script

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions