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: returning a validation error in case of wrong configuration. #157

Merged
merged 7 commits into from
Jan 13, 2025

Conversation

Prashansa-K
Copy link
Collaborator

As of now, while using deck to create a
route-scoped plugin with a service field
defined, the sync goes through the first
time but errors out subsequently. Under a
route, we do not want the user to add the
service field for a plugin. Thus, we are
checking for this specific scenario and
erroring out, instead of letting the sync
action go through.

For: Kong/deck#1353

Documentation

Testing

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

@Prashansa-K Prashansa-K marked this pull request as draft January 6, 2025 10:09
@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 0% with 30 lines in your changes missing coverage. Please review.

Project coverage is 28.67%. Comparing base (1f4216e) to head (c2be37c).

Files with missing lines Patch % Lines
pkg/file/builder.go 0.00% 30 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #157      +/-   ##
==========================================
- Coverage   28.72%   28.67%   -0.05%     
==========================================
  Files         106      106              
  Lines       15888    15915      +27     
==========================================
  Hits         4564     4564              
- Misses      10842    10869      +27     
  Partials      482      482              

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

@Prashansa-K Prashansa-K marked this pull request as ready for review January 6, 2025 11:59
@Prashansa-K Prashansa-K requested a review from pmalek January 6, 2025 11:59
Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

Looks good. Just 1 minor nit.

Can we also add the changelog entry with this PR?

pkg/file/builder.go Outdated Show resolved Hide resolved
As of now, while using deck to create a
route-scoped plugin with a `service` field
defined, the sync goes through the first
time but errors out subsequently. Under a
route, we do not want the user to add the
`service` field for a plugin. Thus, we are
checking for this specific scenario and
erroring out, instead of letting the sync
action go through.

For: Kong/deck#1353
A foreign key nested under a plugin of a different
scope would error out. This would make sure that a
sync does not go through when wrong configurations
are passed via deck. An example would be adding a
`service` field in a plugin, nested under a route.
This change ensures more such issues do not come up.
@Prashansa-K Prashansa-K force-pushed the fix/nested-service-route-plugin branch from 42059b2 to c2be37c Compare January 9, 2025 08:02
@Prashansa-K
Copy link
Collaborator Author

Looks good. Just 1 minor nit.

Can we also add the changelog entry with this PR?

Thank you!
I will add a changelog in deck in the changelog.md file. Here, we add the changelog in release time, on the release page itself. Do I need to add it somewhere beforehand too?

@Prashansa-K Prashansa-K requested a review from pmalek January 10, 2025 05:18
@pmalek
Copy link
Member

pmalek commented Jan 10, 2025

Here, we add the changelog in release time, on the release page itself. Do I need to add it somewhere beforehand too?

Sorry. I get these mixed up as those repos have different approaches to handling changelog.

👍

@Prashansa-K Prashansa-K merged commit ae9c42b into main Jan 13, 2025
19 checks passed
@Prashansa-K Prashansa-K deleted the fix/nested-service-route-plugin branch January 13, 2025 06:39
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