Skip to content

fix: log which import failed when resolving another group's output - #98

Merged
amannocci merged 1 commit into
mainfrom
fix/import-failure-logging
Oct 7, 2026
Merged

amannocci merged 1 commit into
mainfrom
fix/import-failure-logging

Conversation

@amannocci

Copy link
Copy Markdown
Member

🧑‍💻What is the change being made?

When a manifest imports entry cannot be read from another resource group, terranova now logs a failure that names the import, its source group and the importing group, followed by a cause and resolution. This adds an ImportOutputError and logs it in extract_output_var before exiting with the same exit code as before. Self-imports still raise SelfImportNotReadyError.

❓ Why is the change being made?

A failing import used to exit silently with only terraform's raw output stderr, so users could not tell whether the import or the resource group's own plan/apply had failed.

✅ How has this been tested?

Added test_error_logs_failing_import, which checks that stderr names the import, its source and the importing group, and includes a cause. The tests/it suite passes locally (368 tests), along with ruff and basedpyright.

🔗 Related Issues

Closes #97

@amannocci
amannocci merged commit 6cd58ac into main Oct 7, 2026
17 checks passed
@amannocci
amannocci deleted the fix/import-failure-logging branch October 7, 2026 15:51
@amannocci amannocci self-assigned this Oct 7, 2026
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.

[Feature]: Improve console logs to identify the failing phase (import vs resource group)

1 participant