Skip to content

Fix: apm marketplace add silently fails for private repos#701

Merged
danielmeppiel merged 4 commits intomicrosoft:mainfrom
sergio-sisternes-epam:fix/693-marketplace-private-repos
Apr 14, 2026
Merged

Fix: apm marketplace add silently fails for private repos#701
danielmeppiel merged 4 commits intomicrosoft:mainfrom
sergio-sisternes-epam:fix/693-marketplace-private-repos

Conversation

@sergio-sisternes-epam
Copy link
Copy Markdown
Collaborator

@sergio-sisternes-epam sergio-sisternes-epam commented Apr 14, 2026

Description

Fix apm marketplace add silently failing when the target marketplace repo is private. The command currently reports "No marketplace.json found" even when the file exists and the user has valid credentials.

Fixes #693

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Change unauth_first from True to False in _fetch_file() so that
private marketplace repos are accessed with credentials on the first
attempt. Previously, the unauthenticated request returned 404 for
private repos (indistinguishable from 'file not found'), and the
authenticated fallback never triggered.

Fixes microsoft#693

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sergio-sisternes-epam sergio-sisternes-epam marked this pull request as ready for review April 14, 2026 08:47
Copy link
Copy Markdown
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

Note

Copilot was unable to run its full agentic suite in this review.

Fixes apm marketplace add incorrectly reporting “No marketplace.json found” for private GitHub repos by switching the GitHub Contents API fetch to try authenticated requests first.

Changes:

  • Change AuthResolver.try_with_fallback usage to unauth_first=False so private repos are probed with credentials before unauthenticated fallback.
  • Add unit tests that assert unauth_first=False is passed through _fetch_file and during _auto_detect_path probing.
  • Document the fix in the changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/apm_cli/marketplace/client.py Switches GitHub fetch fallback order to auth-first to handle private repo “404 for unauthenticated” behavior.
tests/unit/marketplace/test_marketplace_client.py Adds regression tests to ensure auth-first probing is used consistently.
CHANGELOG.md Records the bug fix for private repos.

Address Copilot review feedback — patch _try_proxy_fetch at class level
so tests remain deterministic when PROXY_REGISTRY_URL is set in CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danielmeppiel danielmeppiel merged commit 1e01f92 into microsoft:main Apr 14, 2026
6 checks passed
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.

[BUG] apm marketplace add silently fails for private repos

4 participants