Skip to content

feat(core): add generic StateMachine base class for typed state transitions#811

Closed
ryuwd wants to merge 1 commit intoDIRACGrid:mainfrom
ryuwd:feat/state-machine
Closed

feat(core): add generic StateMachine base class for typed state transitions#811
ryuwd wants to merge 1 commit intoDIRACGrid:mainfrom
ryuwd:feat/state-machine

Conversation

@ryuwd
Copy link
Copy Markdown
Contributor

@ryuwd ryuwd commented Feb 27, 2026

Reusable declarative state machine utility for diracx. Each system subclasses StateMachine with StrEnum states and a transitions dict. Validation runs at class creation via init_subclass.

Reusable declarative state machine utility for diracx. Each system
subclasses StateMachine with StrEnum states and a transitions dict.
Validation runs at class creation via __init_subclass__.
@aldbr
Copy link
Copy Markdown
Contributor

aldbr commented Mar 2, 2026

Is there any github issue linked to your PR?
Can you briefly explain why you need that, and why now please?

@aldbr
Copy link
Copy Markdown
Contributor

aldbr commented Mar 4, 2026

Given that:

  • this is not an urgent or straightforward fix,
  • it is not part of the current sprint planning,
  • it is not backed by a documented user story (I understand the intention, but the use case is not documented here for people outside LHCb),
  • it may require a broader discussion about the approach (for instance, there are existing Python libraries dealing with state machines, such as https://github.com/fgmacedo/python-statemachine),

I'm closing this PR for now.

Please feel free to reopen it once a proper GitHub issue describing the use case has been created and the topic has been discussed in a ddev meeting.

Thank you for your understanding.

@aldbr aldbr closed this Mar 4, 2026
@ryuwd
Copy link
Copy Markdown
Contributor Author

ryuwd commented Mar 4, 2026

I understand the reasons for closing, particularly since more discussion and design is needed, but it's clear that a more modern solution and cleanup will eventually be needed for DiracX as from my experience moving the job routes (including job status transitions) we shoot ourselves in the foot by continuing to rely on the legacy impl and behaviours.

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.

2 participants