Skip to content

feat(pkg): non-GitHub hosting (gitlab, codeberg) for ilo add#677

Closed
danieljohnmorris wants to merge 1 commit into
feature/ilo-add-semverfrom
feature/ilo-add-hosts
Closed

feat(pkg): non-GitHub hosting (gitlab, codeberg) for ilo add#677
danieljohnmorris wants to merge 1 commit into
feature/ilo-add-semverfrom
feature/ilo-add-hosts

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Implements ILO-359. Extends ILO-63 / PR #614 (semver constraints).

Summary

  • New Host enum (GitHub, GitLab, Codeberg, Custom) with URL helpers
  • parse_package_spec now returns a PackageSpec struct with host, owner, repo, git_ref
  • Supported input forms:
    • org/repo — bare, defaults to GitHub (backwards-compatible)
    • github:org/repo — explicit GitHub
    • gitlab:org/repo — GitLab
    • codeberg:user/repo — Codeberg
    • https://github.com/..., https://gitlab.com/..., https://codeberg.org/... — full URLs
    • All forms accept @ref / semver constraints as before
  • Cache layout: ~/.ilo/pkgs/<host>/<owner>/<repo>/ (host subdirectory added)
  • Lockfile slug: host:owner/repo (e.g. gitlab:myorg/myrepo)
  • is_pkg_path and resolve_pkg_path understand host: prefixes so use "gitlab:org/repo/mod" resolves correctly

Test plan

  • 18 unit tests covering all parsing paths, host URL generation, is_pkg_path, pkg_dir_for — all pass
  • Full test suite passes (390 tests; only pre-existing AOT binary-size test fails as it requires a release build)

Closes ILO-359

🤖 Generated with Claude Code

- Add `Host` enum (GitHub/GitLab/Codeberg/Custom) with base URL and
  clone URL helpers
- Replace bare `(owner, repo, git_ref)` tuple from `parse_package_spec`
  with a `PackageSpec` struct that includes the resolved `Host`
- Parse `gitlab:org/repo`, `codeberg:user/repo`, `github:org/repo`,
  and full `https://gitlab.com/...` / `https://codeberg.org/...` URLs
- Cache layout now includes the host component:
  `~/.ilo/pkgs/<host>/<owner>/<repo>/`
- Lockfile slug is now `host:owner/repo` (e.g. `gitlab:myorg/myrepo`)
- `is_pkg_path` and `resolve_pkg_path` understand `host:` prefixed paths
  so `use "gitlab:org/repo/mod"` finds the right cache directory
- 18 unit tests covering all new parsing paths and host URL generation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@danieljohnmorris danieljohnmorris deleted the branch feature/ilo-add-semver May 22, 2026 06:43
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.

1 participant