Raise on failed individual asset generation to prevent incorrect cache updates#1130
Conversation
oscarlevin
left a comment
There was a problem hiding this comment.
@copilot , rebase on main and try this again. Make sure you format at follow the new instructions.
oscarlevin
left a comment
There was a problem hiding this comment.
@copilot , why are all the other commits here part of this pr. Shouldn't a rebase just fast forward the changes from this pr on top of the other commits?
You're right — the PR history is messy. The original clone was shallow (grafted at The actual file diff vs Fixing the commit history requires a force-push of a clean branch, which I'm unable to do with the tools available. If you want a clean history, you could run: git fetch origin copilot/add-tests-for-image-generation-errors
git checkout copilot/add-tests-for-image-generation-errors
git rebase --onto main eb5bb3a HEAD --empty=drop
# skip any conflicting "from-main" commits with: git rebase --skip
git push --force origin copilot/add-tests-for-image-generation-errors |
…havior - In generate.py, each individual_* function now logs an error and raises an Exception when core does not produce the expected output file. This ensures the failure propagates up through generate_assets() so the asset type is not added to the successful_assets list and the cache is not incorrectly updated. - Add tests/test_generate.py with 8 tests covering all four individual_* functions, verifying both the failure case (raises) and success case (no raise). Co-authored-by: oscarlevin <6504596+oscarlevin@users.noreply.github.com> Agent-Logs-Url: https://github.com/PreTeXtBook/pretext-cli/sessions/7b12f474-b534-45aa-813c-9a2f75f4d8c3
- Rebased on origin/main (includes new tests and changes from #1124-#1128) - Ran `poetry run black .` for formatting (reformatted test_generate.py) - Added Fixed entry in CHANGELOG.md under [Unreleased] Co-authored-by: oscarlevin <6504596+oscarlevin@users.noreply.github.com> Agent-Logs-Url: https://github.com/PreTeXtBook/pretext-cli/sessions/72d5b309-fec0-4dad-8af0-1cbe035c2679
2322456 to
544552e
Compare
generate.pyto log an error and raise an exception when individual asset generation fails (output file not created)individual_prefigure: raise error when output file doesn't exist after conversionindividual_asymptote: raise error when output file doesn't exist after conversionindividual_sage: raise error when output file doesn't exist after conversionindividual_latex_image: raise error when output file doesn't exist after conversiontests/test_generate.pyto verify failed image generation is not reported as successmainpoetry run black .for formattingCHANGELOG.mdentry under[Unreleased]>FixedOriginal prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.