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: enhance addon init #4370

Merged
merged 1 commit into from
Jul 18, 2022
Merged

Conversation

charlie0129
Copy link
Member

@charlie0129 charlie0129 commented Jul 13, 2022

Signed-off-by: Charlie Chiang charlie_c_0129@outlook.com

Description of your changes

  • Make blue color clearer on black backgrounds
  • Generate sample files by default to get user started (can be skipped)
  • Support --url to add a ref-objects component (use yaml files from URLs)
  • Rename existing readme to README
  • Refactor code structure

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Unit-tests.

Manually tested with several possible combinations of parameters.

Special notes for your reviewer

Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
@wonderflow
Copy link
Collaborator

Rename existing readme to README

Please make sure API is compatible with this change.

@charlie0129
Copy link
Member Author

charlie0129 commented Jul 13, 2022

Please make sure API is compatible with this change.

This should work just fine:

  1. Before this change, the existing addons have both readme.md and README.md. They all worked, meaning changing case should not breaking anything.
  2. This change should only affect the process of reading README.md from disk (internal logic don't use this). While most filesystems are case-insensitive, so it should read the right file.

We can wait to see the e2e test result to check if it breaks anything.

@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #4370 (9a52d65) into master (5de7904) will decrease coverage by 2.10%.
The diff coverage is 82.45%.

@@            Coverage Diff             @@
##           master    #4370      +/-   ##
==========================================
- Coverage   60.62%   58.51%   -2.11%     
==========================================
  Files         343      338       -5     
  Lines       33772    33775       +3     
==========================================
- Hits        20473    19764     -709     
- Misses      10617    11416     +799     
+ Partials     2682     2595      -87     
Flag Coverage Δ
apiserver-unittests 34.55% <0.00%> (+0.15%) ⬆️
core-unittests 55.48% <82.45%> (+0.16%) ⬆️
e2e-multicluster-test ?
e2e-rollout-tests 22.28% <ø> (-0.07%) ⬇️
e2etests 28.41% <ø> (-0.35%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/addon/addon.go 65.52% <ø> (+<0.01%) ⬆️
pkg/addon/init.go 82.45% <82.45%> (ø)
pkg/controller/utils/actions.go 0.00% <0.00%> (-80.00%) ⬇️
pkg/resourcekeeper/containsresources.go 0.00% <0.00%> (-71.43%) ⬇️
pkg/auth/identity.go 6.12% <0.00%> (-69.39%) ⬇️
pkg/client/delegating_handler_client.go 0.00% <0.00%> (-66.67%) ⬇️
pkg/utils/json.go 0.00% <0.00%> (-60.00%) ⬇️
pkg/resourcetracker/tree.go 17.89% <0.00%> (-57.37%) ⬇️
pkg/policy/envbinding/placement.go 35.00% <0.00%> (-55.00%) ⬇️
pkg/oam/auxiliary.go 30.00% <0.00%> (-53.34%) ⬇️
... and 64 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5de7904...9a52d65. Read the comment docs.

err = cmd.Execute()
assert.ErrorContains(t, err, "required")

cmd.SetArgs([]string{"test-addon", "--chart", "a", "--helm-repo-url", "https://some.com", "--version", "c"})
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this a break change?

Copy link
Member Author

@charlie0129 charlie0129 Jul 13, 2022

Choose a reason for hiding this comment

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

Yes, the parameters are adjusted. But this function is for humans, there are no automation tools or other things that uses this, so it won't affect much.

The examples in CLI help have been updated, so the user can refer to help.

Copy link
Collaborator

Choose a reason for hiding this comment

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

well, we're not release it in a formal release, so we can change it for now. But next time, we should keep the consistence

Copy link
Collaborator

@wonderflow wonderflow left a comment

Choose a reason for hiding this comment

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

does any docs need to change after this PR?

@charlie0129
Copy link
Member Author

charlie0129 commented Jul 13, 2022

does any docs need to change after this PR?

I don't think there is any documentation that used these parameters. (Only uses addon init without parameters)
So it doesn't affect existing documentations.

The only doc that includes these usages are in CLI help, which has been updated.

Copy link
Collaborator

@wonderflow wonderflow left a comment

Choose a reason for hiding this comment

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

good job! ping @wangyikewxgm

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.

None yet

4 participants