Skip to content

refactor(integrations): move harbor out of the hud package - #523

Merged
jdchawla29 merged 1 commit into
mainfrom
jaideep/integrations-outside-core
Jul 31, 2026
Merged

refactor(integrations): move harbor out of the hud package#523
jdchawla29 merged 1 commit into
mainfrom
jaideep/integrations-outside-core

Conversation

@jdchawla29

@jdchawla29 jdchawla29 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

The integration contract belongs in core; its implementations do not. hud/integrations/harbor/ was shipping inside the hud wheel, which contradicts the repository map (cookbooks/ and integrations/ live outside the hud package).

Nothing in core imported it, so this is purely a location fix — no dependency untangling was needed.

What moves

  • hud/integrations/harbor/integrations/harbor/, tests alongside it
  • hud/integrations/__init__.pyintegrations/__init__.py
  • Core keeps hud.environment.Integration and imports no implementation

The built wheel now contains hud/environment/integration.py and no format code.

Adapted images

An adapted image can no longer get the integration from pip install hud, so the adaptation layer copies it in from the build context:

COPY _hud /hud
RUN sh /hud/install.sh
COPY _hud_harbor /hud/venv/lib/python3.12/site-packages/harbor
CMD ["/hud/venv/bin/hud", "serve", "harbor:environment", ...]

A side effect worth having: the code serving an image is now the revision that adapted it, rather than whatever the index resolves to at build time. hud_requirement still means the core SDK and is unchanged.

The interpreter version shared by the venv and that path is now one constant (SERVING_PYTHON) instead of being spelled out in the install script alone.

Contract docstring

Integration.name claimed to be the CLI --format value and a registry key. Neither exists — the origin scheme is the only role it backs, and the docstring now says only that.

Checks

  • uv run pytest -q — 824 passed (66 under integrations/)
  • uv run ruff format . --check, uv run ruff check . — clean
  • uv run pyright — 0 errors
  • Built the wheel and confirmed it ships no implementation

testpaths gains integrations, and the hatch build excludes it alongside cookbooks/.

One thing left open: integrations.harbor is not an installable import path for anyone outside this repo. If that becomes necessary it wants a pyproject.toml under integrations/harbor/, which is a separate decision from where the files live.


Note

Medium Risk
Changes Harbor image build/serve paths and wheel contents; adapted images depend on the new COPY layout and harbor module name, though core runtime behavior is unchanged and tests cover adapt contexts.

Overview
Harbor and other format integrations are relocated from hud/integrations/ to top-level integrations/, so the hud wheel no longer ships implementation code—only hud.environment.Integration in core. Docs and imports now use integrations / harbor:environment instead of hud.integrations.*.

Adapted Harbor images copy the integration into the serving venv (COPY _hud_harborsite-packages/harbor) because it is no longer available via pip install hud. SERVING_PYTHON ties the venv path and install script to one version; serve CMD references harbor:environment.

Packaging/tests: hatch excludes integrations/; pytest testpaths includes integrations. Integration.name docstring is narrowed to origin-stamping only (drops unused CLI/registry claims).

Reviewed by Cursor Bugbot for commit 223a687. Bugbot is set up for automated code reviews on this repo. Configure here.

The integration contract belongs in core; its implementations do not.
`hud/integrations/harbor/` shipped inside the `hud` wheel, contradicting
the repository map, so it moves to `integrations/harbor/`. Core keeps
`hud.environment.Integration` and imports no implementation — the built
wheel now contains the contract and nothing else.

An adapted image can no longer get the integration from `pip install hud`,
so the adaptation layer copies it in from the build context and drops it
into the serving venv. The code serving an image is then the revision that
adapted it, rather than whatever the index resolves to at build time. The
interpreter version the venv and that path share is one constant instead of
being spelled out in the install script alone.

Also trims `Integration.name` to what it actually backs: the format
identifier and the taskset origin scheme. There is no format registry and
no `--format` flag for it to key.
@jdchawla29
jdchawla29 merged commit 93d615f into main Jul 31, 2026
8 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 223a687787

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


```python
from hud.integrations import harbor
from integrations import harbor

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Package the Harbor import used in the live docs

For users following the normal pip install hud workflow, this import now raises ModuleNotFoundError: pyproject.toml packages only hud, explicitly excludes integrations/, and there is no separate project manifest that installs Harbor. The relocated tests pass only because pytest runs from the repository root. Either publish/install this integration separately or make this page explicitly repository-checkout-only instead of presenting the snippet as usable SDK code.

AGENTS.md reference: AGENTS.md:L14-L15

Useful? React with 👍 / 👎.

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