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

Test/avoid filling defaults in config for kong #135

Conversation

randmonkey
Copy link
Contributor

@randmonkey randmonkey commented Aug 27, 2024

Summary

SUMMARY_GOES_HERE

Add tests for changes in #133.

Full changelog

  • [Implement ...]
  • [Fix ...]

Issues resolved

Fix #XXX

Documentation

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

@randmonkey randmonkey force-pushed the test/avoid-filling-defaults-in-config-for-kong branch from 2e3d206 to 2b957ff Compare August 27, 2024 10:26
@codecov-commenter
Copy link

codecov-commenter commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.74%. Comparing base (1d85e9c) to head (774672c).

Additional details and impacted files
@@                              Coverage Diff                               @@
##           fix/avoid-filling-defaults-in-config-for-kong     #135   +/-   ##
==============================================================================
  Coverage                                          42.74%   42.74%           
==============================================================================
  Files                                                 75       75           
  Lines                                               8809     8809           
==============================================================================
  Hits                                                3765     3765           
  Misses                                              4581     4581           
  Partials                                             463      463           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samugi samugi changed the base branch from main to fix/avoid-filling-defaults-in-config-for-kong August 27, 2024 11:07
@samugi
Copy link
Member

samugi commented Aug 27, 2024

I replaced otel with another plugin that can be tested in 2.8 as well (and that likely will be less subject to schema changes in the future)

@samugi samugi merged commit 9a81082 into fix/avoid-filling-defaults-in-config-for-kong Aug 27, 2024
18 checks passed
@samugi samugi deleted the test/avoid-filling-defaults-in-config-for-kong branch August 27, 2024 12:15
samugi added a commit that referenced this pull request Aug 27, 2024
* add tests for plugin filling default values

---------

Co-authored-by: samugi <[email protected]>
samugi added a commit that referenced this pull request Aug 27, 2024
* fix(diff+file): avoid filling defaults in config for kong

the previous logic was filling defaults in the configuration that was
passed to Kong. This was  problematic, especially where nils were
populated as defaults, e.g. if a shorthand_field was passed with some
value and the corresponding new field is auto-populated as `nil` by decK
, the auto-populated nil value would take precedence in Kong thus causing
the shorthand_field to be ignored
(https://konghq.atlassian.net/browse/KAG-5157).

This change applies the default values only to configurations used for
diff, the original configuration is always passed to Kong as is.

* Test/avoid filling defaults in config for kong (#135)

* add tests for plugin filling default values

---------

Co-authored-by: samugi <[email protected]>

---------

Co-authored-by: Tao Yi <[email protected]>
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.

3 participants