Skip to content

aimgr repo sync exits 0 when configured sources fail partially #5

@hk9890

Description

@hk9890

Bug\n\naimgr repo sync now reports per-source failures in its output, but it still exits successfully unless all configured sources fail. This means automation cannot detect a partial sync failure even when one or more configured sources were not refreshed.\n\n## Steps to Reproduce\n\n1. Configure two sync sources:\n - one valid source\n - one invalid or unreachable source\n2. Run:\n\nbash\naimgr repo sync --format=json\n\n\n## Actual Behavior\n\nThe command exits with status 0 even though the JSON output reports failed sources, for example:\n\njson\n{\n "summary": {\n "sources_total": 2,\n "sources_synced": 1,\n "sources_failed": 1\n }\n}\n\n\nPer-source error details are present in the output, but the process exit status still signals success.\n\n## Expected Behavior\n\n- Exit non-zero when any configured source fails to sync\n- Preserve per-source error details in table/json/yaml output\n- Keep successful sources applied, but make the partial failure visible to scripts and CI\n\n## Impact\n\nThis breaks automation and CI workflows that rely on the process exit status to detect whether a sync completed fully. A partially refreshed repository can currently be treated as success.\n\n## Notes\n\nThis issue is no longer primarily about silent failure: current code already includes per-source failure details. The remaining bug is the success exit code on partial failure.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions