Skip to content

feat: publish CLI orchestrator#30

Merged
ziv-lazarov-nagish merged 3 commits intonagishfrom
feat/publish-cli
Apr 26, 2026
Merged

feat: publish CLI orchestrator#30
ziv-lazarov-nagish merged 3 commits intonagishfrom
feat/publish-cli

Conversation

@ziv-lazarov-nagish
Copy link
Copy Markdown
Contributor

@ziv-lazarov-nagish ziv-lazarov-nagish commented Apr 20, 2026

Depends on: #31feat/publish-hf-ops-and-eval

Summary

Fourth of a 5-PR stack — final layer of the #22 split (layer 5, PR #32, adds --dry-run on top). Adds the CLI entry point — an 8-step orchestrator that stitches the helpers from the earlier layers into a runnable publish pipeline.

  • publish/publish.py — 8-step orchestrator: convert → find manifest → eval → regression check → save manifest → model card → upload to weekly branch → promote tag (on regression pass).
  • publish/__init__.py — re-export publish and main.
  • pyproject.toml — add [publish] optional group ([hf] + [train]).
  • .gitignore — add dist/, wandb/, *.log.

Review-comment fixes in this layer

# Fix
#1 dropped unused os, datetime, UTC imports from publish.py
#6 --regression-threshold default 0.020.005

(Fixes #4, #5, #7 live in PR #31.)

Tests

4 new TestPublishIntegration cases — every HF + eval boundary mocked:

  • skip-eval + no-promote
  • skip-eval + promote (creates tag)
  • eval + regression pass + promote
  • eval + regression fail → no promote

Stack

5-PR stack — layers 1–4 split #22, layer 5 adds --dry-run:

  1. feat/safetensors-runtimenagish (PR feat: safetensors runtime loading + HF-aware resolver #28)
  2. feat/publish-utils-and-cardfeat: safetensors runtime loading + HF-aware resolver #28 (PR feat: publish utils — conversion, versioning, model card #29)
  3. feat/publish-hf-ops-and-evalfeat: publish utils — conversion, versioning, model card #29 (PR feat: publish HF ops + evaluation helpers #31)
  4. This PRfeat: publish HF ops + evaluation helpers #31
  5. feat/publish-dry-run → this PR (PR feat: --dry-run flag on publish CLI #32)

When layers 1–4 merge, #22 can be closed.

Test plan

  • uv run --extra dev pytest sign_language_segmentation/tests — 103 passed (full stack, includes the 4 new integration tests)
  • uv run --extra dev ruff check sign_language_segmentation/publish/ — clean
  • End-to-end orchestrator exercised via --dry-run against sign/segmentation on all datasets (see PR feat: --dry-run flag on publish CLI #32): all 8 steps ran — convert, manifest, eval (full), regression check, save manifest, model card render — with the final HF upload calls skipped. Model card in publish_dry_run.md matches template. HF upload + tag promotion remain covered by the mocked integration tests above.

@ziv-lazarov-nagish ziv-lazarov-nagish changed the base branch from feat/publish-utils-and-card to feat/publish-hf-ops-and-eval April 20, 2026 11:23
@ziv-lazarov-nagish ziv-lazarov-nagish changed the title feat: publish CLI — eval, regression, promotion, orchestrator feat: publish CLI orchestrator Apr 20, 2026
@ziv-lazarov-nagish ziv-lazarov-nagish marked this pull request as ready for review April 20, 2026 12:21
@ziv-lazarov-nagish ziv-lazarov-nagish force-pushed the feat/publish-hf-ops-and-eval branch from f4135e1 to ec1c80f Compare April 23, 2026 11:36
@ziv-lazarov-nagish ziv-lazarov-nagish force-pushed the feat/publish-cli branch 2 times, most recently from 7944cde to 1329527 Compare April 23, 2026 11:57
ziv-lazarov-nagish added a commit that referenced this pull request Apr 23, 2026
Rebase side-effect: after #31 renamed test_publish_cli.py → test_publish_hf_ops.py,
git's rename detection merged #30's CLI-orchestrator additions into the HF-ops file.
Restore the intended separation — TestPublishIntegration lives in test_publish_cli.py,
TestCheckRegression and TestPromote stay in test_publish_hf_ops.py.
@ziv-lazarov-nagish ziv-lazarov-nagish force-pushed the feat/publish-hf-ops-and-eval branch from 4a5474a to 0c3cf67 Compare April 26, 2026 07:51
Completes the publish pipeline on top of the pure-helpers layer:

- `publish/utils.py`: append `_eval_single`, `run_evaluation`, `check_regression`,
  `promote`.
- `publish/publish.py`: 8-step orchestrator — convert → find manifest → eval →
  regression check → save manifest → model card → upload to `weekly` branch →
  promote tag.
- `publish/__init__.py`: re-export `publish` and `main`.
- `datasets/common.py`: rename `_ensure_datasets_registered` →
  `ensure_datasets_registered` (now a public API so `run_evaluation` can call
  it without reaching into a private name).
- `pyproject.toml`: add `[hf]` (huggingface_hub>=0.20.0) and `[publish]`
  (`[hf]` + `[train]`) optional-dependency groups.
- `.env.example`: append HF section (`HF_TOKEN`, `HF_MODEL_REPO`,
  `HF_MODEL_REVISION`, `XDG_CACHE_HOME` for sparks cache).
- `.gitignore`: add `dist/`, `wandb/`, `*.log`.

Review-comment fixes shipped here:
- #1: dropped unused `os`, `datetime`, `UTC` imports from `publish.py`.
- #4: `_ensure_datasets_registered` → `ensure_datasets_registered` (public).
- #5: `class EvalArgs: pass` → `argparse.Namespace(...)`.
- #6: `--regression-threshold` default `0.02` → `0.005`.
- #7: `promote()` now raises `ValueError` on unresolved revision instead of
  silently passing the ref string through to `create_tag`.

11 new tests in `test_publish_cli.py` cover:
- `check_regression`: no_baseline (no tags / download failure), pass
  (within threshold), fail (beyond threshold).
- `promote`: tag found, branch found, unresolved raises `ValueError`.
- `publish()` integration with every HF + eval boundary mocked: skip-eval +
  no-promote, skip-eval + promote, eval + regression pass + promote, eval +
  regression fail (no promote).
Rebase side-effect: after #31 renamed test_publish_cli.py → test_publish_hf_ops.py,
git's rename detection merged #30's CLI-orchestrator additions into the HF-ops file.
Restore the intended separation — TestPublishIntegration lives in test_publish_cli.py,
TestCheckRegression and TestPromote stay in test_publish_hf_ops.py.
@ziv-lazarov-nagish ziv-lazarov-nagish changed the base branch from feat/publish-hf-ops-and-eval to nagish April 26, 2026 07:56
@ziv-lazarov-nagish ziv-lazarov-nagish changed the base branch from nagish to main April 26, 2026 07:58
@ziv-lazarov-nagish ziv-lazarov-nagish changed the base branch from main to nagish April 26, 2026 07:58
@ziv-lazarov-nagish ziv-lazarov-nagish merged commit e6d1724 into nagish Apr 26, 2026
3 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.

Different results for e1 and e2

2 participants