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

Feat: CPF Merge #703

Merged
merged 36 commits into from
Jan 29, 2025
Merged

Feat: CPF Merge #703

merged 36 commits into from
Jan 29, 2025

Conversation

isc-shuliu
Copy link
Collaborator

Implement #631

Copy link
Collaborator

@isc-kiyer isc-kiyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isc-shuliu I know this is still a draft but was curious so took a look and left a few comments

src/cls/IPM/ResourceProcessor/CPF.cls Outdated Show resolved Hide resolved
src/cls/IPM/Lifecycle/Base.cls Outdated Show resolved Hide resolved
src/cls/IPM/Lifecycle/Base.cls Outdated Show resolved Hide resolved
src/cls/IPM/Lifecycle/Base.cls Outdated Show resolved Hide resolved
src/cls/IPM/ResourceProcessor/CPF.cls Outdated Show resolved Hide resolved
src/cls/IPM/ResourceProcessor/CPF.cls Outdated Show resolved Hide resolved
src/cls/IPM/ResourceProcessor/CPF.cls Outdated Show resolved Hide resolved
src/cls/IPM/ResourceProcessor/CPF.cls Outdated Show resolved Hide resolved
src/cls/IPM/Lifecycle/Base.cls Outdated Show resolved Hide resolved
src/cls/IPM/ResourceProcessor/CPF.cls Outdated Show resolved Hide resolved
@isc-shuliu isc-shuliu marked this pull request as ready for review January 15, 2025 23:17
@isc-eneil
Copy link
Collaborator

isc-eneil commented Jan 16, 2025

HSDevOps was discussing today and along the lines of #633, we want to make sure that it is possible for HS to merge CPF resources only during deployment (and not during build-time). In both cases, we call zpm "load" or zpm "install", which means in both cases the initialize phase would run and merge the file.

We had spoken about a CustomScope attribute in #633 but another option is to support just running the merge during a CustomPhase. @isc-shuliu @isc-tleavitt Thoughts on supporting this instead of adding the initialize lifecycle phase? And my apologies for not thinking of this before you implemented it, Shuheng!

Update after Keshav reminded me of an important use case: we still want the CPF merge file to be merged by default during the initialize phase but would also like to additionally support it being merged during a custom phase.

cc @isc-kiyer @isc-jlechtne @isc-jili

@isc-shuliu
Copy link
Collaborator Author

isc-shuliu commented Jan 16, 2025

@isc-eneil
In that case, shall we do this

  • <CPF Name="merge.cpf"> will by default merge the CPF during the new Initialize phase,
  • <CPF Name="merge.cpf" Phase="MakeDeployed" When="Before/After"> will merge the CPF before/after the MakeDeployed phase. The phase name is customizable.
  • <CPF Name="merge.cpf" CustomPhase="MyPhaseName"> will merge the CPF during the MyPhaseName custom phase

Copy link
Contributor

@isc-tleavitt isc-tleavitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move of loading /preload in initialize instead of reload should be noted as a possible compatibility-breaking change (really would be an edge case). But I think this looks good otherwise.

@isc-shuliu
Copy link
Collaborator Author

Move of loading /preload in initialize instead of reload should be noted as a possible compatibility-breaking change (really would be an edge case). But I think this looks good otherwise.

@isc-tleavitt When would it break compatibility? Is it only when running <package> reload -only?

Copy link
Collaborator

@isc-kiyer isc-kiyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isc-shuliu Looks great! Few questions/comments

src/cls/IPM/DataType/PhaseName.cls Outdated Show resolved Hide resolved
src/cls/IPM/DataType/ResourceDirectory.cls Show resolved Hide resolved
src/cls/IPM/ResourceProcessor/CPF.cls Outdated Show resolved Hide resolved
src/cls/IPM/ResourceProcessor/CPF.cls Outdated Show resolved Hide resolved
src/cls/IPM/Storage/Module.cls Outdated Show resolved Hide resolved
@isc-eneil
Copy link
Collaborator

@isc-shuliu I left just a couple of comments but it looks good to me too!

@isc-shuliu isc-shuliu changed the title V0.10.x feat init cpf merge Feat: CPF Merge Jan 22, 2025
Copy link
Collaborator

@isc-kiyer isc-kiyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isc-shuliu few more small comments/thoughts

src/cls/IPM/Storage/Module.cls Outdated Show resolved Hide resolved
src/cls/IPM/ResourceProcessor/Abstract.cls Outdated Show resolved Hide resolved
src/cls/IPM/Storage/Module.cls Outdated Show resolved Hide resolved
Copy link
Collaborator

@isc-kiyer isc-kiyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isc-shuliu one very minor comment. Approving

src/cls/IPM/ResourceProcessor/CPF.cls Outdated Show resolved Hide resolved
@isc-shuliu isc-shuliu merged commit f2c631f into v0.10.x Jan 29, 2025
15 checks passed
@isc-shuliu isc-shuliu deleted the v0.10.x-feat-init-cpf-merge branch January 29, 2025 16:51
If $IsObject(tProcessor) && tProcessor.%Extends("%IPM.ResourceProcessor.CustomPhaseMixin") {
Set cp = tProcessor.CustomPhase
If cp '= "" {
Set pPhases($$$lcase(cp)) = cp
Copy link
Collaborator

@isc-eneil isc-eneil Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isc-shuliu Apologies for the late review on this.

Should there be an additional check to make sure the custom phase hasn't already been added (since an Invoke and a CPF resource could technically give the same custom phase)?

cc @isc-kiyer

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.

Add support for performing module-specified namespace or system configuration at installation/load time
4 participants