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

refactor: merge pkg operation/models to operation/types #198

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

howieyuen
Copy link
Collaborator

@howieyuen howieyuen commented Dec 15, 2022

Pkg operation has two sub pkg, models and types, they are written for same usages, so merge them to one pkg.

For avoiding import path collision, takes types as the final choice.

This PR changes 20+ files, mostly changes are import path and format.

@coveralls
Copy link

coveralls commented Dec 15, 2022

Pull Request Test Coverage Report for Build 3739387346

  • 32 of 45 (71.11%) changed or added relevant lines in 12 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 72.547%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/engine/operation/models/operation_context.go 0 3 0.0%
pkg/kusionctl/cmd/apply/options.go 4 7 57.14%
pkg/engine/operation/graph/resource_node.go 8 15 53.33%
Totals Coverage Status
Change from base Build 3701897865: 0.4%
Covered Lines: 4614
Relevant Lines: 6360

💛 - Coveralls

@howieyuen howieyuen added the kind/optimization Code optimization label Dec 15, 2022
@howieyuen howieyuen changed the title refactor: merge pkg operation/models and operation/types refactor: merge pkg operation/models to operation/types Dec 16, 2022
markliby
markliby previously approved these changes Dec 19, 2022
@SparkYuan
Copy link
Member

models and types are deliberately designed as two pkgs to follow the old driver's advice.... More details can be found here.

#57 (comment)

@howieyuen
Copy link
Collaborator Author

models and types are deliberately designed as two pkgs to follow the old driver's advice.... More details can be found here.

#57 (comment)

Yeah, I read this comment, but still confused about the differences between package models and types.

First, pkg/engine/operation/types has two Definition:

  • ActionType, one of ChangeStep's fields, it's for marking ChangeStep kind, can be Create/Update/Unchanged/Delete
  • OperationType, one of Operation's fields, it's for marking Operation's kind, can be Apply/ApplyPreview/Destroy/DestroyPreview

why split them into 2 packages?

@howieyuen
Copy link
Collaborator Author

howieyuen commented Dec 20, 2022

for better understanding, merge into pkg/engine/operation/models

@howieyuen howieyuen merged commit 3378e6a into KusionStack:main Dec 21, 2022
@howieyuen howieyuen deleted the operation-types branch December 21, 2022 03:47
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/optimization Code optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants