-
Notifications
You must be signed in to change notification settings - Fork 128
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: validate presence of flags and args in file patch command #1342
Conversation
4cc9b6b
to
47ab479
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me!
Nit: can you please make sure commit messages follow the convention even for body length? e.g. The body of your message should not contain lines longer than 72 characters
This makes everything more readable.
For example:
commit a0388610ea9dc259e14c205e85811aac8bd7ed10
Author: Gabriele Gerbino <gabrielegerbino@gmail.com>
Date: Fri Mar 15 12:57:02 2024 +0100
fix: do not fetch kong version when running `validate`
decK used to fetch the running Kong version in order to gate
route regex patterns validation. This is problematic in
the case users don't have access to the `/` endpoint, which
is the one used to fetch the version of the runtime.
This commit removes the need of fetching the Kong version
entirely by relying on the `_format_version` field from the
config file instead.
vs.
commit 47ab479635509980b1ba7ca6b42e5e28bc443789
Author: Prashansa Kulshrestha <prashkulshrestha@gmail.com>
Date: Thu Jul 18 10:47:17 2024 +0530
fix: validate presence of flags and args in file patch command
The command intends to patch input files either via selector-value flags or patch file arguments. The change ensures that at least one of these is present, but not both at the same time. Till now, the command accepted patches from flags and patch files at the same time, but igno
red the patches passed via flags. This was a confusing behaviour for customers.
Fix #1130
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1342 +/- ##
==========================================
+ Coverage 22.39% 22.43% +0.04%
==========================================
Files 54 54
Lines 4515 4520 +5
==========================================
+ Hits 1011 1014 +3
- Misses 3404 3407 +3
+ Partials 100 99 -1 ☔ View full report in Codecov by Sentry. |
The command intends to patch input files either via selector-value flags or patch file arguments. The change ensures that at least one of these is present, but not both at the same time. Till now, the command accepted patches from flags and patch files at the same time, but ignored the patches passed via flags. This was a confusing behaviour for customers. Fix #1130
062612c
to
cbe47e0
Compare
Updated the commit message. |
The command intends to patch input files either via selector-value flags or patch file arguments. The change ensures that at least one of these is present, but not both at the same time. Till now, the command accepted patches from flags and patch files at the same time, but ignored the patches passed via flags. This was a confusing behaviour for customers.
Fix #1130
@rspurgeon I have created a new issue for patch file validation here.
We can discuss its feasibility and usecase there. For this particular issue (#1130), I felt erroring out with a proper reasoning given to user should be the best way to move forward.