Skip to content

feat: skip default injection in entities before sync#391

Open
Prashansa-K wants to merge 2 commits intorefactor/schema-managementfrom
feat/skip-default-injection
Open

feat: skip default injection in entities before sync#391
Prashansa-K wants to merge 2 commits intorefactor/schema-managementfrom
feat/skip-default-injection

Conversation

@Prashansa-K
Copy link
Collaborator

@Prashansa-K Prashansa-K commented Mar 3, 2026

Summary

This PR allows deck to sync/diff/apply changes for entities without
injecting defaults.

Defaults are stripped from the dumped state - current state.
For target state, defaults are not injected at all. Further, defaults that
may already be present in the target content are stripped as well.

To ensure that diffing works correctly, we are allowing the differ
to use the schema and default caches to utilise them before generating
a diff.

Issues resolved

For Kong/deck#1842

Documentation

Testing

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

@Prashansa-K Prashansa-K changed the title Feat/skip default injection feat: skip default injection in entities before sync Mar 3, 2026
@Prashansa-K Prashansa-K marked this pull request as ready for review March 3, 2026 14:45
@Prashansa-K
Copy link
Collaborator Author

This is ready to review. Konnect testing is completed here: https://github.com/Kong/deck/actions/runs/22627365616/job/65567998858

@Prashansa-K Prashansa-K force-pushed the feat/skip-default-injection branch from ed9ab21 to b2e87f1 Compare March 3, 2026 14:55
@Prashansa-K Prashansa-K force-pushed the refactor/schema-management branch from c8b395f to 9fa8bcd Compare March 3, 2026 14:55
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 6.99301% with 133 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.53%. Comparing base (9fa8bcd) to head (b2e87f1).

Files with missing lines Patch % Lines
pkg/diff/diff.go 0.00% 35 Missing ⚠️
pkg/diff/diff_helpers.go 3.33% 28 Missing and 1 partial ⚠️
pkg/file/builder.go 31.81% 14 Missing and 1 partial ⚠️
pkg/types/plugin.go 0.00% 15 Missing ⚠️
pkg/types/core.go 0.00% 10 Missing ⚠️
pkg/file/reader.go 20.00% 8 Missing ⚠️
pkg/schema/registry.go 0.00% 8 Missing ⚠️
pkg/types/partial.go 0.00% 7 Missing ⚠️
pkg/utils/defaulter.go 0.00% 5 Missing ⚠️
pkg/dump/dump.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           refactor/schema-management     #391      +/-   ##
==============================================================
- Coverage                       28.67%   28.53%   -0.15%     
==============================================================
  Files                             121      121              
  Lines                           16374    16477     +103     
==============================================================
+ Hits                             4695     4701       +6     
- Misses                          11063    11159      +96     
- Partials                          616      617       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Prashansa-K
Copy link
Collaborator Author

Tests and changes for dual flows - default injection and without are added here: Kong/deck#1904

client *kong.Client
ctx context.Context

schemasCache map[string]map[string]interface{}
Copy link
Contributor

Choose a reason for hiding this comment

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

out of curiosity - since this is a private member of this struct, and the struct itself is a private member of this package, I couldn't find any instance if this being used in the past within this package - please correct me if I'm wrong.

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