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

Logging Cleanup - Part 3 #414

Merged
merged 6 commits into from
Sep 27, 2023
Merged

Logging Cleanup - Part 3 #414

merged 6 commits into from
Sep 27, 2023

Conversation

xWink
Copy link
Member

@xWink xWink commented Sep 27, 2023

What type of PR is this?

cleanup

Which issue does this PR fix:
#126 partially

What does this PR do / Why do we need it:

  • Removes unused generated code
  • Replace glog with Zap logger and improve logging clarity in service network and target group manager and service synthesizer
  • Removes some instances of log n throw and unnecessary logs
  • Adds check for errors before logging errors

If an issue # is not available please add repro steps and logs from aws-gateway-controller showing the issue:

Testing done on this change:

Ran 32 of 32 Specs in 2185.271 seconds
SUCCESS! -- 32 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestIntegration (2186.22s)
PASS
ok      github.com/aws/aws-application-networking-k8s/test/suites/integration   2186.939s

Automation added to e2e:

Will this PR introduce any new dependencies?:

No

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
No

Does this PR introduce any user-facing change?:

Only logging changes


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@xWink xWink changed the title Logging Cleanup - Part 2 Logging Cleanup - Part 3 Sep 27, 2023
@xWink
Copy link
Member Author

xWink commented Sep 27, 2023

Not sure why make presubmit keeps failing here when it passes locally. Am I missing a step?

aws-application-networking-k8s % make presubmit
?       github.com/aws/aws-application-networking-k8s/pkg/apis/applicationnetworking/v1alpha1   [no test files]
ok      github.com/aws/aws-application-networking-k8s/pkg/aws   0.339s  coverage: 24.2% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/aws/services  0.358s  coverage: 5.8% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/config        0.538s  coverage: 32.9% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/deploy        0.708s  coverage: 20.6% of statements
?       github.com/aws/aws-application-networking-k8s/pkg/k8s   [no test files]
?       github.com/aws/aws-application-networking-k8s/pkg/model/lattice [no test files]
ok      github.com/aws/aws-application-networking-k8s/pkg/deploy/externaldns    1.083s  coverage: 75.6% of statements
?       github.com/aws/aws-application-networking-k8s/pkg/runtime       [no test files]
?       github.com/aws/aws-application-networking-k8s/pkg/utils [no test files]
?       github.com/aws/aws-application-networking-k8s/pkg/utils/gwlog   [no test files]
?       github.com/aws/aws-application-networking-k8s/pkg/utils/retry   [no test files]
?       github.com/aws/aws-application-networking-k8s/pkg/utils/ttime   [no test files]
ok      github.com/aws/aws-application-networking-k8s/pkg/deploy/lattice        0.843s  coverage: 85.0% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/gateway       1.471s  coverage: 77.3% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/latticestore  0.847s  coverage: 64.1% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/model/core    1.689s  coverage: 61.7% of statements
ok      github.com/aws/aws-application-networking-k8s/pkg/model/core/graph      1.693s  coverage: 17.2% of statements
ok      github.com/aws/aws-application-networking-k8s/controllers       0.700s  coverage: 0.0% of statements
ok      github.com/aws/aws-application-networking-k8s/controllers/eventhandlers 1.027s  coverage: 53.5% of statements
aws-application-networking-k8s % git status
On branch logging-3
nothing to commit, working tree clean

@coveralls
Copy link

coveralls commented Sep 27, 2023

Pull Request Test Coverage Report for Build 6330198666

  • 71 of 91 (78.02%) changed or added relevant lines in 6 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 46.003%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/deploy/lattice/service_network_manager.go 0 1 0.0%
pkg/deploy/stack_deployer.go 1 6 16.67%
pkg/deploy/lattice/service_synthesizer.go 8 15 53.33%
pkg/deploy/lattice/target_group_manager.go 40 47 85.11%
Files with Coverage Reduction New Missed Lines %
pkg/deploy/lattice/target_group_manager.go 1 83.97%
Totals Coverage Status
Change from base Build 6329510097: -0.3%
Covered Lines: 3896
Relevant Lines: 8469

💛 - Coveralls

Comment on lines 49 to 50
if ret != "" {
return errors.New(ret)
Copy link
Contributor

Choose a reason for hiding this comment

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

do you mind to cleanup this error handling too?

Copy link
Member Author

Choose a reason for hiding this comment

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

I gave this a try, but after a couple of hours of dealing with e2e test failures, reverted it for the sake of timeboxing. It seems as though we have some reliance on this error handling logic, which I'd like to keep outside the scope of the logging changes

@@ -1,64 +0,0 @@
package main
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add these more gomock_reflect_ in the gitignore in passing?

pkg/aws/services/gomock_reflect_*

Copy link
Member Author

@xWink xWink Sep 27, 2023

Choose a reason for hiding this comment

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

This shouldn't exist at all, it was an artifact from a previous build issue that accidentally got checked in

@xWink xWink merged commit 231bb09 into aws:main Sep 27, 2023
5 checks passed
@xWink xWink deleted the logging-3 branch September 27, 2023 20:58
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.

4 participants