Skip to content

feat: phased resource#148

Open
ekristen wants to merge 5 commits intomainfrom
feat/phased-resource
Open

feat: phased resource#148
ekristen wants to merge 5 commits intomainfrom
feat/phased-resource

Conversation

@ekristen
Copy link
Copy Markdown
Owner

Summary

  • Adds a PhasedResource interface that allows resource to defined a multi-step removal workflow.
  • Each phase is a named function that controls flow via error with nil to advance, ErrWaitResource to poll, ErrHoldResource to pause and ErrResetPhase to restart from phase 0.
  • Phase state is tracked per queue item (Phase Name + Phase Index displayed)
  • Resources implementing the PhasedResource interface are automatically routed through the phased orchestrator

Motivation

Between some cloud resources requiring multiple steps to remove and those steps becoming asynchronous we need a way to properly handle it. Previously all steps had to be synchronous within the Remove method, but due to the asynchronous nature, this was causing the need for more resources to implement HandleWait, but that meant doing actual removes in HandleWait method, which isn’t a natural place to think a remove should take place.

Known Limitation

If you implement a phased method wrong it can get stuck in a wait state forever, need to ensure that all phased functions properly return properly and check the async status of the cloud resource properly.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.47%. Comparing base (673acf2) to head (a4bd490).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #148      +/-   ##
==========================================
+ Coverage   99.32%   99.47%   +0.14%     
==========================================
  Files          20       20              
  Lines        1785     1516     -269     
==========================================
- Hits         1773     1508     -265     
+ Misses          9        5       -4     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ekristen ekristen force-pushed the feat/phased-resource branch from 482fba3 to a4bd490 Compare March 27, 2026 17:03
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.

1 participant