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

chore: refactor code to decrease complexity #554

Merged
merged 8 commits into from
Nov 22, 2023

Conversation

odubajDT
Copy link
Contributor

@odubajDT odubajDT commented Nov 20, 2023

Fixes #533

Changes

  • refactor code to remove nolint comments (where it makes sense)
  • move common/constants package to common right next to the rest of constants
  • increase test coverage for common package
  • increase test coverage for FlagdProxyHandler
  • polish flagdinjector

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Merging #554 (09ae2ee) into main (ccc0471) will increase coverage by 3.63%.
The diff coverage is 94.59%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #554      +/-   ##
==========================================
+ Coverage   84.27%   87.91%   +3.63%     
==========================================
  Files          10       10              
  Lines         935      927       -8     
==========================================
+ Hits          788      815      +27     
+ Misses        121       89      -32     
+ Partials       26       23       -3     
Files Coverage Δ
apis/core/v1beta1/featureflagsource_types.go 96.59% <100.00%> (ø)
common/common.go 100.00% <ø> (ø)
common/flagdproxy/flagdproxy.go 86.98% <100.00%> (+2.05%) ⬆️
common/utils/utils.go 100.00% <ø> (+61.90%) ⬆️
webhooks/common.go 100.00% <100.00%> (ø)
webhooks/pod_webhook.go 85.85% <100.00%> (ø)
controllers/core/featureflagsource/controller.go 51.31% <83.33%> (+4.93%) ⬆️
common/flagdinjector/flagdinjector.go 92.06% <94.91%> (+1.83%) ⬆️
Flag Coverage Δ
unit-tests 87.91% <94.59%> (+3.63%) ⬆️

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

@odubajDT odubajDT marked this pull request as ready for review November 20, 2023 11:04
@odubajDT odubajDT requested a review from a team as a code owner November 20, 2023 11:04
Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

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

There are a few variables that use improper casing of flagd. It would be nice to address them either in this PR or in a follow up.

common/common.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
common/flagdinjector/flagdinjector.go Outdated Show resolved Hide resolved
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
common/types/envconfig.go Outdated Show resolved Hide resolved
Co-authored-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com>
@odubajDT odubajDT merged commit 17a547f into open-feature:main Nov 22, 2023
12 checks passed
This was referenced Nov 22, 2023
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.

Refactor code and increase test coverage
5 participants