Skip to content

feat(cli): save latest operation id even on failure#768

Merged
AlessandroPomponio merged 2 commits into
mainfrom
ap_290_save_operation_identifier_even_on_failure
Mar 31, 2026
Merged

feat(cli): save latest operation id even on failure#768
AlessandroPomponio merged 2 commits into
mainfrom
ap_290_save_operation_identifier_even_on_failure

Conversation

@AlessandroPomponio
Copy link
Copy Markdown
Member

Summary

Refactors operation identifier saving logic to ensure the operation identifier is persisted even when exceptions occur during operation creation. This enables the --use-latest flag to reference failed operations.

Resolves #290

Files Changed

📄 orchestrator/cli/resources/operation/create.py

Extracts operation identifier saving logic into a dedicated helper function _save_operation_identifier() and calls it in exception handlers for InterruptedOperationError and OperationException. This ensures that operation identifiers are saved to the configuration even when operations fail or are interrupted, allowing users to reference these operations later using the --use-latest flag.

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
ref: #290 (comment)
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Copy link
Copy Markdown
Member

@michael-johnston michael-johnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michael-johnston michael-johnston added this pull request to the merge queue Mar 31, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Mar 31, 2026
@AlessandroPomponio AlessandroPomponio added this pull request to the merge queue Mar 31, 2026
Merged via the queue into main with commit 310a25c Mar 31, 2026
19 checks passed
@AlessandroPomponio AlessandroPomponio deleted the ap_290_save_operation_identifier_even_on_failure branch March 31, 2026 13:59
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.

refactor(cli): update latest operation id even if the operation fails

2 participants