Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4d5135f
support virtual packages on generic git hosts (Gitea)
GanesanRengasamy Apr 6, 2026
cc79114
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 7, 2026
3dedd94
Addressed reviewed corrections
GanesanRengasamy Apr 7, 2026
8cfcd22
Merge branch 'main' into feat/genric-host-gitea-private
danielmeppiel Apr 9, 2026
13dbf73
Update src/apm_cli/deps/github_downloader.py
ganesanviji Apr 9, 2026
c386e89
Merge branch 'main' into feat/genric-host-gitea-private
sergio-sisternes-epam Apr 10, 2026
e455776
Review comments addressed
ganesanviji Apr 15, 2026
ab09b7a
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 15, 2026
4fb6dcd
Merge branch 'feat/genric-host-gitea-private' of https://github.com/g…
ganesanviji Apr 16, 2026
0b3460c
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 16, 2026
8cc38d8
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 17, 2026
47b8051
Merge branch 'main' into feat/genric-host-gitea-private
danielmeppiel Apr 18, 2026
22cc4e7
Merge branch 'main' into feat/genric-host-gitea-private
danielmeppiel Apr 19, 2026
ea3fd0c
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 24, 2026
00f88e7
Update reference.py
ganesanviji Apr 24, 2026
fb75924
Merge branch 'feat/genric-host-gitea-private' of https://github.com/g…
ganesanviji Apr 24, 2026
77c077d
restore: re-add TestVirtualFilePackageYamlGeneration and TestSCPPortD…
ganesanviji Apr 24, 2026
dbaa48b
Merge branch 'main' into feat/genric-host-gitea-private
danielmeppiel Apr 24, 2026
8b56ffa
Review concerns addressed
ganesanviji Apr 25, 2026
d55b754
Merge branch 'feat/genric-host-gitea-private' of https://github.com/g…
ganesanviji Apr 25, 2026
8e3e078
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 25, 2026
179ce53
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 25, 2026
1d74243
Merge branch 'main' into feat/genric-host-gitea-private
danielmeppiel Apr 25, 2026
d183107
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 26, 2026
b4af12d
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 26, 2026
c1f4d49
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji Apr 27, 2026
77e2d02
review changes addressed
ganesanviji May 6, 2026
4a6ea32
Merge remote-tracking branch 'upstream/main' into feat/genric-host-gi…
ganesanviji May 6, 2026
59308a9
Merge branch 'main' of https://github.com/microsoft/apm into feat/gen…
ganesanviji May 6, 2026
825361c
Merge branch 'main' into feat/genric-host-gitea-private
ganesanviji May 6, 2026
2049524
Merge branch 'main' of https://github.com/microsoft/apm into feat/gen…
ganesanviji May 8, 2026
a509b96
Merge branch 'main' into feat/genric-host-gitea-private
danielmeppiel May 8, 2026
c006e9a
style: apply ruff format to fix CI lint
danielmeppiel May 8, 2026
13fd8cd
fix(deps): guard token forwarding to non-GitHub hosts; decode Gitea A…
May 8, 2026
3928c24
Address round-2 panel follow-ups for Gitea/Gogs support
May 8, 2026
3c76c96
Regenerate NOTICE for requests floor bump
May 8, 2026
d7d7b90
Fix CodeQL py/incomplete-url-substring-sanitization in 404 test
May 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/apm_cli/deps/github_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,14 +1056,29 @@ def _download_github_file(self, dep_ref: DependencyReference, file_path: str, re
# All raw attempts failed — fall through to API path which
# handles private repos, rate-limit messaging, and SAML errors.

# Try raw URL for generic hosts (Gitea, GitLab, etc.)
if host.lower() not in ("github.com",) and not host.lower().endswith(".ghe.com"):
raw_url = f"https://{host}/{owner}/{repo}/raw/{ref}/{file_path}"
raw_headers = {}
if token:
raw_headers['Authorization'] = f'token {token}'
try:
response = self._resilient_get(raw_url, headers=raw_headers, timeout=30)
if response.status_code == 200:
if verbose_callback:
verbose_callback(f"Downloaded file: {host}/{dep_ref.repo_url}/{file_path}")
return response.content
except:
pass

# --- Contents API path (authenticated, enterprise, or raw fallback) ---
# Build GitHub API URL - format differs by host type
if host == "github.com":
api_url = f"https://api.github.com/repos/{owner}/{repo}/contents/{file_path}?ref={ref}"
elif host.lower().endswith(".ghe.com"):
api_url = f"https://api.{host}/repos/{owner}/{repo}/contents/{file_path}?ref={ref}"
else:
api_url = f"https://{host}/api/v3/repos/{owner}/{repo}/contents/{file_path}?ref={ref}"
api_url = f"https://{host}/api/v1/repos/{owner}/{repo}/contents/{file_path}?ref={ref}"

# Set up authentication headers
headers = {
Expand Down
2 changes: 1 addition & 1 deletion src/apm_cli/models/dependency/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def _detect_virtual_package(cls, dependency_str: str):
for seg in path_segments
)
has_collection = "collections" in path_segments
if has_virtual_ext or has_collection:
if has_virtual_ext or has_collection or len(path_segments) > 2:
min_base_segments = 2
else:
min_base_segments = len(path_segments)
Expand Down