skip_if_title_matches can never match draft/WIP-style patterns
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
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 askip_if_title_matches
pattern against a draft/WIP-style title (either by reading from
mr_titleinstead ofmr_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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from serokell/danger
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100