Skip to content

Conversation

@ShuP1
Copy link

@ShuP1 ShuP1 commented Dec 10, 2025

Description

GithubMetaAnalyzer should use repositoryUrl even if no password is provided

Addressed Issue

fixes #5621

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • [~] This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • [~] This PR introduces changes to the database model, and I have added corresponding update logic
  • [~] This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

Signed-off-by: May B. <clement.bois@orange.com>
Copilot AI review requested due to automatic review settings December 10, 2025 12:36
@owasp-dt-bot
Copy link

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where GithubMetaAnalyzer was not using the configured repositoryUrl when connecting anonymously to GitHub (i.e., when no credentials are provided). Previously, it would call GitHub.connectAnonymously() which always connects to the default GitHub.com, ignoring any custom GitHub Enterprise URL that may have been configured.

Key Changes:

  • Changed anonymous GitHub connection to use GitHub.connectToEnterpriseAnonymously(repositoryUrl) instead of GitHub.connectAnonymously(), ensuring custom GitHub Enterprise URLs are respected even without credentials

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

github = GitHub.connectUsingOAuth(repositoryUrl, repositoryPassword);
} else {
github = GitHub.connectAnonymously();
github = GitHub.connectToEnterpriseAnonymously(repositoryUrl);
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix changes the behavior when connecting anonymously to use a custom repository URL instead of the default GitHub.com. However, there are no tests covering this scenario. Consider adding a test that verifies anonymous connections respect the custom repositoryUrl when set via setRepositoryBaseUrl(), similar to how ComposerMetaAnalyzerTest and NpmMetaAnalyzerTest test custom repository URLs.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GithubMetaAnalyzer ignore repositoryUrl if repositoryPassword is empty

2 participants