Skip to content

Fix undefined method detached? for String#2662

Merged
aramprice merged 1 commit intomainfrom
fix_detached_method_used_on_string
Feb 5, 2026
Merged

Fix undefined method detached? for String#2662
aramprice merged 1 commit intomainfrom
fix_detached_method_used_on_string

Conversation

@neddp
Copy link
Member

@neddp neddp commented Feb 4, 2026

Following on PR #2659 which broke the integration tests for BOSH:
instance.state.detached? is called, but instance.state returns a String (not a StringInquirer), so it doesn't have the .detached? method.

Changes

  • Add state constants to DeploymentPlan::Instance:
    • STATE_STARTED, STATE_STOPPED, STATE_DETACHED
  • Add predicate methods to DeploymentPlan::Instance:
    • started?, stopped?, detached?
  • Refactor all state checks to use predicate methods across:
  • Fix lint warning
  • Remove duplicate attr_accessor declarations in instance_group.rb

aramprice
aramprice previously approved these changes Feb 4, 2026
@github-project-automation github-project-automation bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Feb 4, 2026
@aramprice aramprice force-pushed the fix_detached_method_used_on_string branch 2 times, most recently from c6d4667 to 742f265 Compare February 4, 2026 23:31
- Remove unnecessary check in already_detached? method
- Fix instance state checks to use constants instead of methods
- Hoist constants out to Bosh::Director
- resurrect attr_accessor's in instance_group.rb
- replace magic array's of strings with arrays of constants
@aramprice aramprice force-pushed the fix_detached_method_used_on_string branch from 742f265 to 5b7d500 Compare February 4, 2026 23:48
@aramprice
Copy link
Member

@neddp - thank you for catching the cases I missed, apologies for the noise!

I pushed some additional changes - mostly moving the constants up to Bosh::Director so that both deployment_plan/instance, and models/instance can use them, and then replaced a few more magic strings.

@aramprice aramprice merged commit 88e21e7 into main Feb 5, 2026
19 checks passed
@github-project-automation github-project-automation bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Feb 5, 2026
@aramprice aramprice deleted the fix_detached_method_used_on_string branch February 5, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants