Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-9175

[Test] Support Regexp in Incoming Webhook Targets on PAC

XMLWordPrintable

    • 5
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      The `targets` field in Repository CR supports both exact string matching and glob patterns, allowing users to match multiple branches with a single rule.

      Glob patterns: Use shell-style patterns:
      - `*` - matches any characters (e.g., `feature/*` matches `feature/login`, `feature/api`)
      - `?` - matches exactly one character (e.g., `v?` matches `v1`, `v2`)
      - `[abc]` - matches one character from set (e.g., `[A-Z]*` matches any uppercase letter)
      - `[0-9]` - matches digits (e.g., `v[0-9]*.[0-9]*` matches `v1.2`, `v10.5`)
      - `{a,b,c}` - matches alternatives (e.g., `{dev,staging}/*` matches `dev/test` or `staging/test`)

      First-match-wins: If multiple incoming webhooks match the same branch, the first matching webhook in the YAML order is used. Place more specific webhooks before general catch-all webhooks.
      Show
      The `targets` field in Repository CR supports both exact string matching and glob patterns, allowing users to match multiple branches with a single rule. Glob patterns: Use shell-style patterns: - `*` - matches any characters (e.g., `feature/*` matches `feature/login`, `feature/api`) - `?` - matches exactly one character (e.g., `v?` matches `v1`, `v2`) - `[abc]` - matches one character from set (e.g., `[A-Z]*` matches any uppercase letter) - `[0-9]` - matches digits (e.g., `v[0-9]*.[0-9]*` matches `v1.2`, `v10.5`) - `{a,b,c}` - matches alternatives (e.g., `{dev,staging}/*` matches `dev/test` or `staging/test`) First-match-wins: If multiple incoming webhooks match the same branch, the first matching webhook in the YAML order is used. Place more specific webhooks before general catch-all webhooks.
    • Feature

      Story (Required)

      As targets of incoming webhook can be specified using regexp in repository CR, I want Pipelines as Code to match the branches in incoming webhook request using regexp.

      upstream issue: https://github.com/openshift-pipelines/pipelines-as-code/issues/1398

      Background (Required)

      Currently, Pipelines as Code doesn't match branch name if name pattern is specified in targets of incoming webhook in repository CR, this blocks users to have specify branch name pattern and trigger PipelineRun, see example below:

      incoming:
          - targets:
              - main
              - feature/* <<<
            type: webhook-url 

      Out of scope

      • Any modification in Repository CR struct
      • modification in branch matching logic on git provider events.

      Approach (Required)

      • use regexp to match branch names on incoming webhook
      • verify it by running locally
      • update the upstream docs specifying this new behavior. 

      Dependencies

      <Describes what this story depends on. Dependent Stories and EPICs should be linked to the story.>

      Acceptance Criteria (Mandatory)

      • Pipelines as Code must match branch names pattern on incoming webhook event.
      • Documentation is updated specifying this behavior
      • current login of incoming webhook should be remained unchanged. 

      INVEST Checklist

      • Dependencies identified: None
      • Blockers noted: None
      • Design is implementable: Yes
      • Acceptance criteria agreed upon: Pending
      • Story estimated: Pending

      Legend

      Unknown

      Verified

      Unsatisfied

      Done Checklist

      • Code is completed, reviewed, documented and checked in
      • Unit and integration test automation have been delivered and running cleanly in continuous integration/staging/canary environment
      • Continuous Delivery pipeline(s) is able to proceed with new code included
      • Customer facing documentation, API docs etc. are produced/updated, reviewed and published
      • Acceptance criteria are met

              Unassigned Unassigned
              rh-ee-zashaikh Zaki Shaikh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: