Skip to content

Conversation

@alexandru-manea-snyk
Copy link

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Commit messages
    are release-note ready, emphasizing
    what was changed, not how.
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)
  • Includes product update to be announced in the next stable release notes

What does this PR do?

Fixes incorrect project name parsing for Azure DevOps repositories during snyk iac --report.
Previously, unsupported Azure DevOps repo formats caused the CLI to fallback to the full FQDN (for example: http://ssh.dev.azure.com/v3/org-user/project/repo) as the project name.
This change updates the regex logic to correctly extract the relevant repo identifier.

This introduces a necessary behavior change regarding the repository identifier. While standard Git services (like GitHub) continue to use a user/repo format, Azure DevOps repositories will now report as org/project/repo. This change reflects Azure's three-tier hierarchy, ensuring that repositories are uniquely identified within their organization and project context.

Unit tests were refactored to a table-driven approach to accommodate the differing output formats (user/repo vs org/project/repo).

Where should the reviewer start?

  • Review the updated regex patterns and logic for parsing Azure URLs: src/cli/commands/test/iac/meta.ts.
  • Review the new table-driven tests covering the various Azure and standard URL formats: test/jest/unit/cli/commands/test/iac/meta.spec.ts.

How should this be manually tested?

The logic is covered by unit tests. You can verify the fix by running:
npx jest --runInBand test/jest/unit/cli/commands/test/iac/meta.spec.ts

What's the product update that needs to be communicated to CLI users?

Fix: Azure DevOps Repository URLs now correctly report Org/Project/Repo project names instead of the full URL.

Risk assessment (Low | Medium | High)?

Low

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the fix/IAC-3468/wrong-project-name-for-ssh-dev-azure-repos branch from 7cd17a4 to 581cae1 Compare December 18, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants