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 deep_caching_type validator regex #1800

Merged
merged 1 commit into from
Feb 6, 2018

Conversation

rawlinp
Copy link
Contributor

@rawlinp rawlinp commented Jan 26, 2018

The regex is missing parentheses which allows any string starting with
NEVER or ending with ALWAYS to be considered valid, but it would be
disallowed at the DB level because it's an enum type.

Thanks, @dangogh, for finding this!

@@ -1387,7 +1387,7 @@ sub is_deliveryservice_valid {
active => [ is_required("is required") ],
cdnId => [ is_required("is required"), \&is_valid_int_or_undef ],
ccrDnsTtl => [ \&is_valid_int_or_undef ],
deepCachingType => [ is_like( qr/^NEVER|ALWAYS$/, "must be NEVER or ALWAYS" ) ],
deepCachingType => [ is_like( qr/^(NEVER|ALWAYS)$/, "must be NEVER or ALWAYS" ) ],
Copy link
Member

Choose a reason for hiding this comment

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

really minor nit.. looks like current code is using TABs to align the arrows.. can you match?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, but if it were up to me everything would be using spaces :)

The regex is missing parentheses which allows any string starting with
NEVER or ending with ALWAYS to be considered valid, but it would be
disallowed at the DB level because it's an enum type.
@asfgit
Copy link
Contributor

asfgit commented Jan 26, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR/935/
Test FAILed.

@asfgit
Copy link
Contributor

asfgit commented Jan 26, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR/936/
Test PASSed.

@dangogh dangogh added bug something isn't working as intended Traffic Ops API labels Jan 27, 2018
@dangogh dangogh added this to the 2.2.0 milestone Jan 27, 2018
Copy link
Member

@dangogh dangogh left a comment

Choose a reason for hiding this comment

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

tested in dev environment

@dangogh dangogh merged commit f65852f into apache:master Feb 6, 2018
@rawlinp rawlinp deleted the fix-dct-validation branch April 13, 2018 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants