Milestone calculation fails in a certain condition
Milestone calculation fails if we have non-XX.YY
in milestones.
def ago(num_milestones)
major, minor = value.split(".").map(&:to_i)
older_major = minor > 1 ? major : major - 1
older_minor = (0..12).to_a[minor - num_milestones]
[older_major, older_minor].join(".")
Execution log
$ bundle exec bin/feature-flag-alert
Cloning into 'gitlab-repo'...
Updating files: 100% (53018/53018), done.
bundler: failed to load command: bin/feature-flag-alert (bin/feature-flag-alert)
NoMethodError: undefined method `>' for nil:NilClass
/builds/gitlab-org/gitlab-feature-flag-alert/lib/gitlab/feature_flag_alert/milestone.rb:15:in `ago'
/builds/gitlab-org/gitlab-feature-flag-alert/lib/gitlab/feature_flag_alert/monitor.rb:22:in `run'
bin/feature-flag-alert:6:in `<top (required)>'
Current milestone: ClickHouse Acceleration
from https://gitlab.com/gitlab-org/gitlab-feature-flag-alert/-/jobs/2546090764
Blocks !15 (merged)
Edited by Takuya Noguchi