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

fix: populate missing 'enabled' service field from file #677

Merged
merged 3 commits into from
May 10, 2022

Conversation

GGabriele
Copy link
Collaborator

@GGabriele GGabriele commented May 9, 2022

Without this decK is failing at parsing the 'enabled' field
for services entities.

@GGabriele GGabriele requested a review from a team as a code owner May 9, 2022 20:46
@codecov-commenter
Copy link

codecov-commenter commented May 9, 2022

Codecov Report

Merging #677 (d225235) into main (f73967a) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #677      +/-   ##
==========================================
+ Coverage   44.31%   44.32%   +0.01%     
==========================================
  Files          74       74              
  Lines        8790     8792       +2     
==========================================
+ Hits         3895     3897       +2     
  Misses       4532     4532              
  Partials      363      363              
Impacted Files Coverage Δ
file/types.go 63.55% <100.00%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f73967a...d225235. Read the comment docs.

@GGabriele GGabriele force-pushed the fix-missing-enabled branch from 69897a5 to d225235 Compare May 9, 2022 20:54
Copy link
Contributor

@rainest rainest left a comment

Choose a reason for hiding this comment

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

For reference, Kong/kong@1339494

@rainest rainest self-requested a review May 9, 2022 21:34
Copy link
Contributor

@rainest rainest left a comment

Choose a reason for hiding this comment

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

Code 👍, can you add a pending release changelog entry for this?

@hbagdi
Copy link
Member

hbagdi commented May 9, 2022

Please add a test.

Without this decK is failing at parsing the 'enabled' field
for services entities.
@GGabriele GGabriele force-pushed the fix-missing-enabled branch from d225235 to 9d3d39a Compare May 10, 2022 08:58
@GGabriele
Copy link
Collaborator Author

Code 👍, can you add a pending release changelog entry for this?

I still need to get used to that :( added now

Please add a test.

done

assert.Equal(kong.Target{
Target: kong.String("198.51.100.11:80"),
},
c.Upstreams[0].Targets[0].Target)
Copy link
Member

Choose a reason for hiding this comment

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

I'll recommend writing a targetted test that reads a file which only has a single service and doing appropriate assertions.
I also recommend having a sub-test t.Run("enabled field for service is read", ... under the test. That provides:

  • a description of what is being tested
  • a narrow unit test that can be read and fixed later on easily
  • ability for future sub-tests to be added here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sounds good

882c513

@GGabriele GGabriele force-pushed the fix-missing-enabled branch from 9d3d39a to 76ff616 Compare May 10, 2022 17:48
@GGabriele GGabriele force-pushed the fix-missing-enabled branch from 76ff616 to ab9ef4a Compare May 10, 2022 17:50
@rainest rainest merged commit 7e0570b into main May 10, 2022
@rainest rainest deleted the fix-missing-enabled branch May 10, 2022 20:49
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