-
Notifications
You must be signed in to change notification settings - Fork 51
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: support for checks of rollback and restart #204
Conversation
1f3ecb7
to
7c45cdd
Compare
@@ -1759,6 +1778,66 @@ func (g *clusterGitopsRepo) readFile(ctx context.Context, application, cluster, | |||
return g.gitlabLib.GetFile(ctx, pid, GitOpsBranch, fileName) | |||
} | |||
|
|||
// for internal usage | |||
// manifestVersionChanged determines whether manifest version is changed | |||
func (g *clusterGitopsRepo) manifestVersionChanged(ctx context.Context, application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method clusterGitopsRepo.manifestVersionChanged
has 5 return statements (exceeds 4 allowed).
return &service{ | ||
applicationService: applicationSvc, | ||
clusterManager: manager.ClusterMgr, | ||
func (s service) SyncDBWithGitRepo(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method service.SyncDBWithGitRepo
has 6 return statements (exceeds 4 allowed).
return nil | ||
} | ||
|
||
func (c *controller) executeRollback(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method controller.executeRollback
has 17 return statements (exceeds 4 allowed).
return nil | ||
} | ||
|
||
func (c *controller) executeRestart(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method controller.executeRestart
has 7 return statements (exceeds 4 allowed).
} | ||
} | ||
|
||
func (c *controller) executeDeploy(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method controller.executeDeploy
has 9 return statements (exceeds 4 allowed).
return nil | ||
} | ||
|
||
func (c *controller) executeRollback(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method controller.executeRollback
has 94 lines of code (exceeds 50 allowed). Consider refactoring.
} | ||
} | ||
|
||
func (c *controller) executeDeploy(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method controller.executeDeploy
has 71 lines of code (exceeds 50 allowed). Consider refactoring.
} | ||
} | ||
|
||
func (c *controller) executeDeploy(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method controller.executeDeploy
has 5 arguments (exceeds 4 allowed). Consider refactoring.
2c688de
to
a8f5d16
Compare
3dfe398
to
036c679
Compare
Signed-off-by: xu.zhu <[email protected]>
Signed-off-by: xu.zhu <[email protected]>
Signed-off-by: xu.zhu <[email protected]>
Signed-off-by: xu.zhu <[email protected]>
Signed-off-by: xu.zhu <[email protected]>
Signed-off-by: xu.zhu <[email protected]>
036c679
to
3fcae73
Compare
return nil | ||
} | ||
|
||
func (c *controller) executeRollback(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method controller.executeRollback
has 88 lines of code (exceeds 50 allowed). Consider refactoring.
} | ||
} | ||
|
||
func (c *controller) executeDeploy(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method controller.executeDeploy
has 67 lines of code (exceeds 50 allowed). Consider refactoring.
Signed-off-by: xu.zhu <[email protected]>
c5dcc23
to
7b78016
Compare
return nil | ||
} | ||
|
||
func (c *controller) executeRollback(ctx context.Context, application *appmodels.Application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method controller.executeRollback
has 87 lines of code (exceeds 50 allowed). Consider refactoring.
Code Climate has analyzed commit 7b78016 and detected 16 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 48.6% (60% is the threshold). This pull request will bring the total coverage in the repository to 66.2% (0.2% change). View more on Code Climate. |
Description of your changes
Fixes #
I have:
make build && make lint
to ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer