Skip to content

Fix epic_notable_path to handle nested subgroups correctly

What does this MR do and why?

Describe in detail what your merge request does and why.

The epic_notable_path method was only extracting the first group segment from URLs, causing comments to be posted to wrong epics.

This fix:

  • Extracts the full group path including all nested subgroups
  • Properly handles the /-/ separator in GitLab URLs
  • URL-encodes group paths for GitLab API compatibility / becomes %2F)
  • Adds nil guard to prevent crashes when group path cannot be extracted

Examples:

  • https://gitlab.com/groups/gitlab-org/quality/analytics/-/epics/30/groups/gitlab-org%2Fquality%2Fanalytics/epics/30
  • https://gitlab.com/groups/gitlab-org/-/epics/23/groups/gitlab-org/epics/23

Expected impact & dry-runs

These are strongly recommended to assist reviewers and reduce the time to merge your change.

See https://gitlab.com/gitlab-org/quality/triage-ops/-/tree/master/doc/scheduled#testing-policies-with-a-dry-run on how to perform dry-runs for new policies.

See https://gitlab.com/gitlab-org/quality/triage-ops/-/blob/master/doc/reactive/best_practices.md#use-the-sandbox-to-test-new-processors on how to make sure a new processor can be tested.

Action items

Edited by Richard Chong

Merge request reports

Loading