-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
#683 Validate placeholder duplicates in path templates #1927
Conversation
@raman-m Draft for a better exception handling in upstreamcreator |
@raman-m if we agree on the first solution which is failing gracefully, then this PR should do exactly that |
@AlyHKafoury I'm not sure that simple exception throwing is right... But, yes, technically we provide information about invalid route. Let's discuss more with the team... |
@raman-m I reproduced with the included unit test. the line that fails is this line
the reason is indexOfPlaceholder is -1 because instead of matching the first place holder in the line it matches the last 1 causing a whole set of unexpected behaviors to happen. Even if we like fix this part and allow duplicate placer-holders this will cause alot of issues down the line |
Ok, got it! You've reproduced the bug by unit test. Please, postpone work on this. Or review related acceptance tests, if there is no something similar then write a new acceptance test to repro the bug too. Need to discuss final design with the team. |
@raman-m Other issues to work on ? |
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.
Hi Aly!
I've marked the PR as ready for reviews, so we can continue development, because the author replied to us.
So, please read new requirements of linked issue #683 and let's get started active development once again.
src/Ocelot/Configuration/Creator/UpstreamTemplatePatternCreator.cs
Outdated
Show resolved
Hide resolved
test/Ocelot.UnitTests/Configuration/UpstreamTemplatePatternCreatorTests.cs
Outdated
Show resolved
Hide resolved
@raman-m this is strange there is already a validator in here :
and a test for it in here : Ocelot/test/Ocelot.UnitTests/Configuration/Validation/FileConfigurationFluentValidatorTests.cs Line 1476 in f4803c2
The point is the current rule now checks for upstream only should I add also downstream check for this and a unit test for it or are we good with the only checking the upstream |
Yes the current problem is with downstream path only being duplicate, so I will add rule for that and add unit test for it |
Please, add user scenario of bug #683 into a test. Also, I'd ask you to check the following... |
test/Ocelot.UnitTests/Configuration/Validation/FileConfigurationFluentValidatorTests.cs
Show resolved
Hide resolved
test/Ocelot.UnitTests/Configuration/Validation/FileConfigurationFluentValidatorTests.cs
Show resolved
Hide resolved
src/Ocelot/Configuration/Validator/FileConfigurationFluentValidator.cs
Outdated
Show resolved
Hide resolved
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.
Please, work more and independently 😉
When you request code review, the build should be passed. Seems your code is not complete.
src/Ocelot/Configuration/Validator/FileConfigurationFluentValidator.cs
Outdated
Show resolved
Hide resolved
src/Ocelot/Configuration/Validator/FileConfigurationFluentValidator.cs
Outdated
Show resolved
Hide resolved
test/Ocelot.UnitTests/Configuration/Validation/FileConfigurationFluentValidatorTests.cs
Outdated
Show resolved
Hide resolved
@AlyHKafoury Please resolve the merge conflict! |
On it |
And merge develop to feature branch plz! |
@AlyHKafoury Hi Aly! |
…favor of the collection one
@AlyHKafoury The feature branch has been rebased today ❗ TODO: Tomorrow I will continue fixing of failed Acceptance tests... |
Aly, where are you? Seems you live in Egypt... So, your time zone is +2 with 1-2 hours shift. |
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.
Fixes #683
foo/{bar}/{bar}
#683