docs: add comment explaining GitLab issue ID format and remove debug logs

- Added comment explaining that issueId format 'project/repo#123' is intentional for uniqueness
- Removed debug console.log statements now that the issue is understood and resolved
- The URL construction correctly extracts numeric ID from the unique identifier format

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Johannes Millan 2025-06-10 22:11:38 +02:00
parent 0e557afec7
commit 4e7517ad0c

View file

@ -44,26 +44,17 @@ export class GitlabCommonInterfacesService implements IssueServiceInterface {
const project: string = cfg.project;
// Extract just the numeric issue ID from formats like 'project/repo#123' or '#123'
// Note: issueId is intentionally stored as 'project/repo#123' to ensure uniqueness across different projects
// but for URL construction we only need the numeric part after the '#'
const cleanIssueId = issueId.toString().replace(/^.*#/, '');
console.log('GitLab issueLink debug:', {
originalIssueId: issueId,
cleanIssueId,
project,
gitlabBaseUrl: cfg.gitlabBaseUrl,
});
if (cfg.gitlabBaseUrl) {
const fixedUrl = cfg.gitlabBaseUrl.match(/.*\/$/)
? cfg.gitlabBaseUrl
: `${cfg.gitlabBaseUrl}/`;
const url = `${fixedUrl}${project}/-/issues/${cleanIssueId}`;
console.log('GitLab issueLink result (custom base):', url);
return url;
return `${fixedUrl}${project}/-/issues/${cleanIssueId}`;
} else {
const url = `${GITLAB_BASE_URL}${project}/-/issues/${cleanIssueId}`;
console.log('GitLab issueLink result (default base):', url);
return url;
return `${GITLAB_BASE_URL}${project}/-/issues/${cleanIssueId}`;
}
}),
)