Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming and API Refinements: Current / Desired (Goal) States and Commands #131

Closed
7 tasks done
azriel91 opened this issue Jun 7, 2023 · 0 comments · Fixed by #132
Closed
7 tasks done

Naming and API Refinements: Current / Desired (Goal) States and Commands #131

azriel91 opened this issue Jun 7, 2023 · 0 comments · Fixed by #132

Comments

@azriel91
Copy link
Owner

azriel91 commented Jun 7, 2023

In 0.0.10 and earlier:

  • StatesCurrent is stored as states_saved.yaml, and StatesDesired is stored as states_desired.yaml.
  • It is a surprise / hard to discover when one wants to read the previously stored StatesCurrent, and has to remember to use StatesSavedReadCmd instead of StatesCurrent..Cmd.
  • It is additional effort when one has StatesCurrent, and needs to pass in StatesSaved to EnsureCmd -- they have to map the data type (related: ApplyCmd should only execute if StatesPrevious and StatesCurrent are in sync #59).
  • "desired" doesn't capture the meaning that that is the state when the automation ensures.

To address these:

  • "desired" should be renamed to "goal".

    • StatesDesired*Cmd renamed to StatesGoal*Cmd
    • states_desired.yaml renamed to states_goal.yaml
    • Update docs.

    Name bikeshedding:

    • leave as is
    • built / created (some things aren't built / created, and a bit obscure)
    • complete / finished this? (may confuse user that it is "done")
    • done (overloaded / hard to search / confusing)
    • formed (overloaded term)
    • forged (obscure)
    • goal this? (semantic overlap with "target"?)
    • manufactured (too long)
  • Rename StatesSaved* to StatesCurrentStored.

  • Add StatesGoalStored* to distinguish between StatesGoal and what was saved.

  • Make sure it is easy to go from States*Stored to States*.


Out of scope:

  • Rename DiffCmd to StatesDiffCmd (?) -- what about diffing parameters or specs.

  • Store state for each item, even if it was not discovered.

    • Current states.
    • Goal states.
    • State diffs.

    Fixes the ordering in stored files.

  • StatesDiffCmd API to make it obvious whether we are diffing:

    Single profile, single flow:

    • Discovered current and discovered goal states.
    • Discovered current and discovered goal states.
    • Saved current and discovered goal states.
    • Discovered current and saved goal states.

    Multi profile, single flow:

    • Current states of both profiles.
    • Goal states of both profiles.

    Arbitrary two states.

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 a pull request may close this issue.

1 participant