Skip to content

refactor(application): centralize Sync* calls in Create[T]/Update[T]#403

Draft
TheCrabe wants to merge 1 commit into
masterfrom
refactor/370-centralize-sync
Draft

refactor(application): centralize Sync* calls in Create[T]/Update[T]#403
TheCrabe wants to merge 1 commit into
masterfrom
refactor/370-centralize-sync

Conversation

@TheCrabe
Copy link
Copy Markdown
Collaborator

Summary

Closes #370.

SyncNetworkGroups, SyncExposedVariables and SyncDependencies were
called identically in all 16 runtime crud.go files. They are now invoked
once from the generic Create[T] / Update[T] functions, like VHosts and
Environment already are.

  • centralize the 3 Sync* calls into Create[T] / Update[T], removing
    ~6 duplicated lines from each runtime crud.go
  • remove the now-redundant second state save in each runtime Update — its
    secondary block held only the Sync* calls, and the calls do not mutate
    plan
  • no RuntimePlan interface change: contrary to the issue's estimate,
    Networkgroups / ExposedEnvironment / Dependencies already live on the
    shared Runtime struct, reachable via the existing GetRuntimePtr()

- move SyncNetworkGroups/SyncExposedVariables/SyncDependencies into the
  generic Create[T]/Update[T], dropping ~6 duplicated lines per runtime
- remove the now-redundant second state save in each Update (its secondary
  block held only the Sync* calls)
- no RuntimePlan interface change: the 3 fields already live on Runtime

Closes #370
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: centralize Sync* calls in application Create[T]/Update[T]

1 participant