Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ it.each([
"https://github.com/acme/web/pull/42",
"https://example.test/acme/web/issues/42",
"https://github.com/acme/web/issues/0",
"https://gitlab.com/groups/acme/-/work_items/12",
])("does not read %s as an issue", (url) => {
expect(sourceControlDefinitions.parseIssueUrl(url)).toBeNull();
});
Expand Down
5 changes: 3 additions & 2 deletions packages/source-control-gitlab/src/shared/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ const CHANGE_REQUEST_REFERENCE =
// Self-managed GitLab runs on any hostname and nests projects in groups.
const CHANGE_REQUEST_PATH = /^\/([^/]+(?:\/[^/]+)+)\/-\/merge_requests\/(\d+)(?:\/|$)/u;
const COMMIT_PATH = /^\/([^/]+(?:\/[^/]+)+)\/-\/commit\/([0-9a-f]+)\/?$/iu;
// An incident is an issue that GitLab also serves at `/-/issues/incident/<iid>`.
// An incident is an issue that GitLab also serves at `/-/issues/incident/<iid>`. No project is
// below `/groups/`: a work item there is the group's own, such as an epic.
const ISSUE_PATH =
/^\/([^/]+(?:\/[^/]+)+)\/-\/(?:issues(?:\/incident)?|work_items)\/(\d+)(?:\/|$)/u;
/^\/(?!groups\/)([^/]+(?:\/[^/]+)+)\/-\/(?:issues(?:\/incident)?|work_items)\/(\d+)(?:\/|$)/u;
// Every GitLab page inside a project sits below its first `/-/`.
const REPOSITORY_PAGE_PATH = /^\/([^/]+(?:\/[^/]+)+?)\/-\//u;

Expand Down
Loading