You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI: add hflow stale --exit-code so CI can gate on stale episodes #30
_command_stale (src/hflow/cli.py:268) prints stale episode URIs and always returns 0 (src/hflow/cli.py:318), regardless of how many episodes are behind the current pipeline version. That means hflow stale cannot gate a CI job or a pre-training checklist, while hflow doctor already exits 1 on findings.
Proposed change
Add an --exit-code flag (named after git diff --exit-code): when passed, exit 1 if any stale episode was printed. Keep the default at 0 so existing pipes keep working (docs/CATALOG.md documents piping the output into xargs hflow ingest).
Definition of done
hflow stale --exit-code ... exits 1 when at least one stale episode exists and 0 when none do.
Without the flag, behavior is unchanged.
Test with the existing catalog fixtures in tests/test_catalog_curation.py.
Validation
uv run pytest -q
uv run ruff check --fix && uv run ruff format
uv run ty check
Happy to take this one. Plan: add --exit-code (store_true) to the stale subparser and return 1 from _command_stale when it's set and at least one stale episode was printed. Default stays 0 so the xargs hflow ingest pipe in docs/CATALOG.md is unaffected. I'll cover the behind and up-to-date cases against the existing fixtures in test_catalog_curation.py and document the flag.
Yours, @chiruu12, assigned. The plan: store_true on the stale subparser, return 1 from _command_stale only when the flag is set and at least one stale episode printed, default exit code unchanged so the xargs pipe in docs/CATALOG.md keeps working.
Heads-up @chiruu12: #30 is still yours, but someone else opened a pull request for it (#76, now closed since you have the assignment). No pressure and no deadline, I just wanted you to know there is interest, in case you would rather hand it off than hold it.
If you have hit a snag, say so here and I will help. If you would rather do something else, that is completely fine too, just let me know and I will unassign so it goes back in the pool.
Thanks @kstonekuan, and thanks for handling #76 the way you did.
No snag, I want to keep it. The reason there was no PR yet is that I wanted the change verified rather than just written. The flag itself is a few lines, but the part worth getting right is that the default path stays exactly what it was, since docs/CATALOG.md pipes stale into xargs hflow ingest and a changed exit code there breaks that quietly. So I checked the new tests fail on current main with unrecognized arguments: --exit-code before checking they pass on the change, and I ran the whole suite on main as well as on the branch so the comparison is against a measured base rather than an assumed one.
Local run on macOS with uv sync --locked --all-extras:
uv run pytest -q tests/test_catalog_curation.py -k cli_stale, 4 passed
uv run pytest -q, 301 passed, 5 failed, 6 skipped. The same 5 fail on unmodified main on this host, all ffmpeg related, and base sits at 299 passed, so the change adds two and moves nothing else
uv run ruff check and uv run ruff format --check, clean
Activity
chiruu12 commentedon Aug 20, 2026
Happy to take this one. Plan: add
--exit-code(store_true) to thestalesubparser and return 1 from_command_stalewhen it's set and at least one stale episode was printed. Default stays 0 so thexargs hflow ingestpipe in docs/CATALOG.md is unaffected. I'll cover the behind and up-to-date cases against the existing fixtures in test_catalog_curation.py and document the flag.kstonekuan commentedon Aug 20, 2026
Yours, @chiruu12, assigned. The plan:
store_trueon thestalesubparser, return 1 from_command_staleonly when the flag is set and at least one stale episode printed, default exit code unchanged so thexargspipe in docs/CATALOG.md keeps working.kstonekuan commentedon Aug 21, 2026
Heads-up @chiruu12: #30 is still yours, but someone else opened a pull request for it (#76, now closed since you have the assignment). No pressure and no deadline, I just wanted you to know there is interest, in case you would rather hand it off than hold it.
If you have hit a snag, say so here and I will help. If you would rather do something else, that is completely fine too, just let me know and I will unassign so it goes back in the pool.
chiruu12 commentedon Aug 21, 2026
Thanks @kstonekuan, and thanks for handling #76 the way you did.
No snag, I want to keep it. The reason there was no PR yet is that I wanted the change verified rather than just written. The flag itself is a few lines, but the part worth getting right is that the default path stays exactly what it was, since
docs/CATALOG.mdpipesstaleintoxargs hflow ingestand a changed exit code there breaks that quietly. So I checked the new tests fail on currentmainwithunrecognized arguments: --exit-codebefore checking they pass on the change, and I ran the whole suite onmainas well as on the branch so the comparison is against a measured base rather than an assumed one.PR is up now: #81
Local run on macOS with
uv sync --locked --all-extras:uv run pytest -q tests/test_catalog_curation.py -k cli_stale, 4 passeduv run pytest -q, 301 passed, 5 failed, 6 skipped. The same 5 fail on unmodifiedmainon this host, all ffmpeg related, and base sits at 299 passed, so the change adds two and moves nothing elseuv run ruff checkanduv run ruff format --check, cleanuv run ty check, clean