Fix: apm marketplace add silently fails for private repos#701
Merged
danielmeppiel merged 4 commits intomicrosoft:mainfrom Apr 14, 2026
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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_fallbackusage tounauth_first=Falseso private repos are probed with credentials before unauthenticated fallback. - Add unit tests that assert
unauth_first=Falseis passed through_fetch_fileand during_auto_detect_pathprobing. - 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>
SebastienDegodez
approved these changes
Apr 14, 2026
danielmeppiel
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix
apm marketplace addsilently 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
Testing