Skip to content

Decouple format check and rule action skip logic; add config-driven format check disable via regex #259

Description

@mskacelik

Currently, the @wildfly-bot[bot] skip format command in a PR body skips both format checks (title, commit message, description validation) and rule checks (should be probably named as rule actions) (label assignment, reviewer notifications, CC mentions).

These are fundamentally different concerns and should be controllable independently.

Additionally, there is no config-level mechanism to conditionally disable format checks based on PR content.

So my proposals are:

  1. Remove the @wildfly-bot skip format bot command -- its not even documented, and its use is rather cumbersome.
  2. Refactor "skip" logic to separate format checks from rule actions -- with that also rename rule checks to rule actions.
  3. Add a new config field for disabling format checks via regex:
    • Add a new field(s) under wildfly.format that accepts a case-insensitive regex matched against the PR description. When matched, format checks are skipped but rule actions still run.

PoC example of a YAML config file (see skip field):

  wildfly:
    projectKey: "WFLY"

    format:
      skip: # checks description for the regex pattern(s) -- disjunction
        - "No JIRA required"
        - "No JIRA needed"
        - "No issue required"

      title:
        # enabled: true (default)
        failMessage: "PR title must reference a JIRA issue"

      commit:
        # enabled: true (default)
        failMessage: "At least one commit must reference a JIRA issue"

      description:
        failMessage: "The PR description is not correct"
        regexes:
          - pattern: "https://redhat.atlassian.net/browse/WFLY-\\d+"
            failMessage: "The PR description must contain a link to the JIRA issue"
            # ... some other patterns 

n.b. I also renamed message to failMessage, to be more explicit.

For more info, see Zulip thread: https://wildfly.zulipchat.com/#narrow/channel/174184-wildfly-developers/topic/WildFly.20Bot.20.E2.80.93.20format.20check.20failed.20based.20on.20incorrect.20premise/with/607149523

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions