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

Merge plugin-group manifest automatically when building individual plugins with the builder plugin #644

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

anujc25
Copy link
Contributor

@anujc25 anujc25 commented Jan 11, 2024

What this PR does / why we need it

  • Before this change, when a user tried to build plugins individually the content of the plugin_group_manifest.yaml file was getting overwritten with each plugin build command.

  • After this change, if the plugin_group_manifest.yaml file already exists under the artifacts directory, building a new plugin will merge the plugin information into the existing plugin_group_manifest.yaml file. And if a user is building a plugin that exists in the plugin_group_manifest.yaml file with a different version, the content of the plugin_group_manifest.yaml will get updated with the newer version of the plugin.

Note: As part of #454, This issue was resolved for plugin_bundle creation along with plugin_manifest.yaml. However, that change was not handling the updates to the plugin_group_manifest.yaml correctly.

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

## Try building the builder plugin individually
$ make plugin-build-local PLUGIN_NAME=builder

$ cat artifacts/plugins/plugin_group_manifest.yaml
created: 2024-01-11T12:03:17.663867-08:00
plugins:
    - name: builder
      target: global
      isContextScoped: false
      version: v1.2.0-dev

## Now try building the test plugin individually. The plugin_group_manifest.yaml should be merged containing info of builder and test plugins
$ make plugin-build-local PLUGIN_NAME=test

$ cat artifacts/plugins/plugin_group_manifest.yaml
created: 2024-01-11T12:04:24.036255-08:00
plugins:
    - name: test
      target: global
      isContextScoped: false
      version: v1.2.0-dev
    - name: builder
      target: global
      isContextScoped: false
      version: v1.2.0-dev
## Set PLUGIN_BUNDLE_OVERWRITE=true to overwrite the plugin bundle and generate a fresh plugin_group_manifest.yaml file
$ make plugin-build-local PLUGIN_NAME=test PLUGIN_BUNDLE_OVERWRITE=true

$ cat artifacts/plugins/plugin_group_manifest.yaml
created: 2024-01-11T12:06:11.563163-08:00
plugins:
    - name: test
      target: global
      isContextScoped: false
      version: v1.2.0-dev
## Try to build all plugins for all supported architecture and verify that the correct plugin group manifest gets generated
$ make plugin-build

$ cat artifacts/plugins/plugin_group_manifest.yaml
created: 2024-01-11T12:08:48.147526-08:00
plugins:
    - name: builder
      target: global
      isContextScoped: false
      version: v1.2.0-dev
    - name: test
      target: global
      isContextScoped: false
      version: v1.2.0-dev

Release note

Merge `plugin_group_manifest.yaml` automatically when building individual plugins with the builder plugin

Additional information

Special notes for your reviewer

… plugins

Before this change, when user tries to build plugins individually the
content of the plugin_group_manifest.yaml file was getting overwritten
with each plugin build command.

After this change, if the plugin_group_manifest.yaml file already exists
under the artifacts directory, while building a new plugin with merge
the plugin information into the existing plugin_group_manifest.yaml
file. And if user is building a plugin which exists in the
plugin_group_manifest.yaml file with different version, the content of
the plugin_group_manifest.yaml will get updated with newer version of
the plugin.
@anujc25 anujc25 requested a review from a team as a code owner January 11, 2024 20:10
@marckhouzam marckhouzam added this to the v1.2.0 milestone Jan 16, 2024
Copy link
Contributor

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!
One nit about warnings.

cmd/plugin/builder/command/cli_compile_test.go Outdated Show resolved Hide resolved
@anujc25 anujc25 merged commit af5d92d into vmware-tanzu:main Jan 16, 2024
7 checks passed
vuil pushed a commit to vuil/tanzu-cli that referenced this pull request Jan 23, 2024
…ugins with the `builder` plugin (vmware-tanzu#644)

* Automatically merge the plugin_group_manifest if exists when building plugins

Before this change, when user tries to build plugins individually the
content of the plugin_group_manifest.yaml file was getting overwritten
with each plugin build command.

After this change, if the plugin_group_manifest.yaml file already exists
under the artifacts directory, while building a new plugin with merge
the plugin information into the existing plugin_group_manifest.yaml
file. And if user is building a plugin which exists in the
plugin_group_manifest.yaml file with different version, the content of
the plugin_group_manifest.yaml will get updated with newer version of
the plugin.
vuil pushed a commit that referenced this pull request Jan 23, 2024
…ugins with the `builder` plugin (#644)

* Automatically merge the plugin_group_manifest if exists when building plugins

Before this change, when user tries to build plugins individually the
content of the plugin_group_manifest.yaml file was getting overwritten
with each plugin build command.

After this change, if the plugin_group_manifest.yaml file already exists
under the artifacts directory, while building a new plugin with merge
the plugin information into the existing plugin_group_manifest.yaml
file. And if user is building a plugin which exists in the
plugin_group_manifest.yaml file with different version, the content of
the plugin_group_manifest.yaml will get updated with newer version of
the plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants