Make `milestone.succ` more flexible
In https://gitlab.com/gitlab-org/gitlab-triage/merge_requests/45 we implemented a way so we can:
!resource[:confidential] && milestone&.succ && Date.today > milestone.succ.start_date
However milestone.succ
is dumb, it just sorts all the milestones by start_date
. This works alright until we hit into gitlab-org/quality/triage-ops#104 (closed) where it found %"2019" as the next milestone.
In https://gitlab.com/gitlab-org/gitlab-triage/merge_requests/84 we intended to workaround this by picking only X.Y
, but this is hard coded and may not fit into other workflows.
We again workaround this in gitlab-org/quality/triage-ops!81 (merged) where we just apply this in our policy file, which should not affect other users.
However it's ugly and tedious to do. We need to find a better way to handle this more elegantly, and use it cleanly in triage-ops.