skip_if_title_matches can never match draft/WIP-style patterns

Open Beginner friendly
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ruby
Domain
tooling

Research direction

Start in helpers.rb at danger_check_skipped?, then compare the title source used there with githost.mr_title_payload and mr_title. Verify coverage for a [Draft] or WIP: skip pattern and the existing merge-title pattern. Done means draft/WIP titles can match without breaking the current merge-title behavior.

Written by the indexing model from the issue text.

Description

Description

danger_check_skipped? (in helpers.rb) reads the title via
githost.mr_title_payload before checking it against
config[:skip_if_title_matches]. mr_title_payload already strips
anything matching DRAFT_TITLE_PATTERN ([Draft], Draft:, WIP:)
before that check ever runs, so a skip_if_title_matches pattern meant
to catch a draft/WIP title (e.g. ["[Draft]"]) can never match, the
text it's looking for has already been removed by an earlier step.

Verified directly:

title = "[Draft] Test PR"
after mr_title_payload strips DRAFT_TITLE_PATTERN: "Test PR"
matches_any?(["[Draft]"]) against "Test PR": false

This doesn't affect the only real usage in this repo today
(merge_request_default_config's
skip_if_title_matches: default_branch_merge_title_patterns, matching
auto-generated "Merge branch X into Y" titles, which never start with
[Draft]/WIP:), but it's a real gap for anyone configuring a
draft-detecting skip pattern.

Acceptance criteria

  • danger_check_skipped? can match a skip_if_title_matches
    pattern against a draft/WIP-style title (either by reading from
    mr_title instead of mr_title_payload, or some other fix),
    without breaking the existing merge-title use case
Dominant language
Ruby
Stars
0
Forks
0
Avg merge
11d 1h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from serokell/danger

All issues in serokell/danger

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.