Automattic / Automattic/dangermattic

Improve milestone handling

Open
#69 0 comments 0 reactions 0 assignees View on GitHub
bug plugins
Dominant language
Ruby
Stars
10
Forks
2
PR merge metrics
No merged PRs in 30d

Description

1) Perhaps add an option to not show the warning when we target a hotfix, perhaps on the app side, or Dangermattic can provide a helper for that.
E.g. Dangerfile to make an exception for when PR targets /release\/\d+\.\d+\.\d+/

2) Handle empty `to_date`.
Now, we get this error when the milestone has no due date:

```console
Dangerfile:55:in `eval_file': (Danger::DSLError)
[!] Invalid `Dangerfile` file: undefined method `to_date' for nil:NilClass
# from Dangerfile:55
# -------------------------------------------
# if milestone
> code_freeze_date = milestone['due_on'].to_date
# submission_date = code_freeze_date + 7
# -------------------------------------------
from /usr/local/bundle/gems/danger-9.4.3/lib/danger/danger_core/dangerfile.rb:311:in `eval'
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at Dangerfile line 55, where milestone['due_on'] is converted with to_date, and inspect how the target branch or release pattern is available. Check the existing milestone warning flow and the referenced Dangerfile conditions. Done means hotfix targets can avoid the warning and milestones without a due date no longer raise the shown error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
ci-cd, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.