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: collect app status from all envs #745

Merged
merged 2 commits into from
Apr 7, 2023
Merged

Conversation

wangyikewxgm
Copy link
Collaborator

@wangyikewxgm wangyikewxgm commented Apr 4, 2023

Description of your changes

collect app status from all envs

Fixes #

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 yarn lint to ensure the frontend changes are ready for review.
  • Run make reviewableto ensure the server changes are ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

Special notes for your reviewer

@@ -315,6 +316,35 @@ func (c *applicationServiceImpl) GetApplicationStatus(ctx context.Context, appmo
return &app.Status, nil
}

// GetApplicationStatusFromAllEnvs get applications status from all envs
func (c *applicationServiceImpl) GetApplicationStatusFromAllEnvs(ctx context.Context, appmodel *model.Application) ([]*apisv1.ApplicationStatusResponse, error) {
envBindings, err := c.EnvBindingService.GetEnvBindings(ctx, appmodel)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we reuse the GetApplicationCR function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

GetApplicationCR only return all applications that will loss env info.

Filter(c.RbacService.CheckPerm("envBinding", "detail")).
Filter(c.appCheckFilter).
Param(ws.PathParameter("appName", "identifier of the application ").DataType("string")).
Returns(200, "OK", []*apis.ApplicationStatusResponse{}).
Copy link
Collaborator

Choose a reason for hiding this comment

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

The response data is imperfection. Can't distinguish between different environments.

Copy link
Collaborator Author

@wangyikewxgm wangyikewxgm Apr 6, 2023

Choose a reason for hiding this comment

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

This struct is as follows, it contain a filed envName:

type ApplicationStatusResponse struct {
	EnvName string            `json:"envName"`
	Status  *common.AppStatus `json:"status"`
}

@codecov
Copy link

codecov bot commented Apr 4, 2023

Codecov Report

Patch coverage: 21.27% and project coverage change: -11.36 ⚠️

Comparison is base (6b33036) 61.09% compared to head (fc95873) 49.73%.

❗ Current head fc95873 differs from pull request most recent head bba0079. Consider uploading reports for the commit bba0079 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #745       +/-   ##
===========================================
- Coverage   61.09%   49.73%   -11.36%     
===========================================
  Files         106      106               
  Lines       18543    18590       +47     
===========================================
- Hits        11328     9245     -2083     
- Misses       5823     8137     +2314     
+ Partials     1392     1208      -184     
Flag Coverage Δ
apiserver-unittests ?
server-e2e-tests 49.73% <21.27%> (-0.16%) ⬇️

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

Impacted Files Coverage Δ
pkg/server/domain/service/application.go 43.17% <0.00%> (-18.64%) ⬇️
pkg/server/interfaces/api/application.go 60.67% <47.61%> (-0.23%) ⬇️

... and 42 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
@wangyikewxgm wangyikewxgm force-pushed the app-application-status branch 2 times, most recently from 089d697 to 52c59ab Compare April 6, 2023 08:00
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

debug

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
Copy link
Collaborator

@barnettZQG barnettZQG left a comment

Choose a reason for hiding this comment

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

LGTM

@barnettZQG barnettZQG merged commit 5fbb791 into main Apr 7, 2023
@barnettZQG barnettZQG deleted the app-application-status branch April 7, 2023 06:34
mujinhuakai pushed a commit to mujinhuakai/velaux that referenced this pull request Apr 8, 2023
* collect app status from all envs

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

debug

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix test

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

---------

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
Signed-off-by: liyanfang <liyanfang@cmss.chinamobile.com>
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

2 participants