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 the application synchronizer #5299

Merged
merged 3 commits into from
Jan 11, 2023

Conversation

barnettZQG
Copy link
Collaborator

@barnettZQG barnettZQG commented Jan 10, 2023

Signed-off-by: barnettZQG barnett.zqg@gmail.com

Description of your changes

Before, we use the generation number as the cache key. If users only change the publish version to rerun the workflow, the application spec does not change, the generation does not change, so the revision and the workflow record can not be synced.

In PR #5282 try to use the resource version as the cache key. The resource version changes constantly When the application workflow running. We did not need to sync the record status in the application synchronizer, so, this resulted in excessive database requests.

Now, we use the revision as the cache key. When the new revision is generated the app synchronizer should resync the application.

This PR makes the API server use the unitive auth client to request the kube API.

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

Special notes for your reviewer

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Base: 47.12% // Head: 61.05% // Increases project coverage by +13.92% 🎉

Coverage data is based on head (c3e896f) compared to base (b71a8a3).
Patch coverage: 87.50% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5299       +/-   ##
===========================================
+ Coverage   47.12%   61.05%   +13.92%     
===========================================
  Files         305      308        +3     
  Lines       46427    46572      +145     
===========================================
+ Hits        21881    28436     +6555     
+ Misses      21805    15189     -6616     
- Partials     2741     2947      +206     
Flag Coverage Δ
apiserver-e2etests 32.42% <78.57%> (-0.08%) ⬇️
apiserver-unittests 36.31% <62.26%> (+0.11%) ⬆️
core-unittests 55.11% <100.00%> (?)
e2e-multicluster-test 19.01% <16.66%> (-0.06%) ⬇️
e2e-rollout-tests 21.10% <25.00%> (+0.37%) ⬆️
e2etests 26.35% <25.00%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
pkg/apiserver/interfaces/api/target.go 40.76% <0.00%> (ø)
pkg/apiserver/event/collect/system_info_collect.go 63.59% <50.00%> (+1.37%) ⬆️
pkg/apiserver/event/sync/cache.go 68.00% <63.63%> (-5.47%) ⬇️
...server/infrastructure/datastore/kubeapi/migrate.go 55.55% <75.00%> (+1.70%) ⬆️
pkg/addon/addon.go 64.32% <100.00%> (+26.53%) ⬆️
pkg/apiserver/event/sync/convert.go 85.36% <100.00%> (+1.25%) ⬆️
pkg/apiserver/event/sync/cr2ux.go 48.31% <100.00%> (-1.69%) ⬇️
pkg/apiserver/event/sync/worker.go 72.30% <100.00%> (-4.62%) ⬇️
...server/infrastructure/datastore/kubeapi/kubeapi.go 63.30% <100.00%> (-0.69%) ⬇️
pkg/apiserver/server.go 62.80% <100.00%> (+0.73%) ⬆️
... and 146 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@barnettZQG barnettZQG added this to the KubeVela-v1.7 milestone Jan 10, 2023
@barnettZQG barnettZQG added the backport release-1.7 add this label will automatically backport this PR to release-1.7 branch label Jan 10, 2023
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
@barnettZQG barnettZQG force-pushed the enhange-sync branch 2 times, most recently from 1954fbf to ad43fb5 Compare January 11, 2023 03:27
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
@github-actions
Copy link

Successfully created backport PR #5305 for release-1.7.

barnettZQG added a commit to barnettZQG/kubevela that referenced this pull request Jan 30, 2023
* Feat: enhance the application synchronizer

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: the unit test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
zhaohuiweixiao pushed a commit to zhaohuiweixiao/kubevela that referenced this pull request Mar 7, 2023
* Feat: enhance the application synchronizer

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: e2e test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

* Fix: the unit test case

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-1.7 add this label will automatically backport this PR to release-1.7 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants