You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "fatih-acar (via GitHub)" <gi...@apache.org> on 2023/08/23 14:00:11 UTC
[GitHub] [trafficcontrol] fatih-acar opened a new pull request, #7741: fix(t3c): regex for pparam should check end of path
fatih-acar opened a new pull request, #7741:
URL: https://github.com/apache/trafficcontrol/pull/7741
According to the comments in the code, we should check if the filename is ending with specific extensions. Fix the regex to match this behavior.
Otherwise it prevents t3c from using pparams such as
@plugin=conf_remap.so @pparam=proxy.config.http.cache.required_headers=0
<!--
Thank you for contributing! Please be sure to read our contribution guidelines: https://github.com/apache/trafficcontrol/blob/master/CONTRIBUTING.md
If this closes or relates to an existing issue, please reference it using one of the following:
Closes: #ISSUE
Related: #ISSUE
If this PR fixes a security vulnerability, DO NOT submit! Instead, contact
the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
guidelines at https://apache.org/security regarding vulnerability disclosure.
-->
<!-- **^ Add meaningful description above** --><hr/>
## Which Traffic Control components are affected by this PR?
<!-- Please delete all components from this list that are NOT affected by this PR.
Feel free to add the name of a tool or script that is affected but not on the list.
-->
- Traffic Control Cache Config (`t3c`, formerly ORT)
## What is the best way to verify this PR?
<!-- Please include here ALL the steps necessary to test your PR.
If your PR has tests (and most should), provide the steps needed to run the tests.
If not, please provide step-by-step instructions to test the PR manually and explain why your PR does not need tests. -->
## If this is a bugfix, which Traffic Control versions contained the bug?
<!-- Delete this section if the PR is not a bugfix, or if the bug is only in the master branch.
Examples:
- 5.1.2
- 5.1.3 (RC1)
-->
## PR submission checklist
- No test since this is a trivial change
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] fatih-acar commented on a diff in pull request #7741: fix(t3c): regex for pparam should check end of path
Posted by "fatih-acar (via GitHub)" <gi...@apache.org>.
fatih-acar commented on code in PR #7741:
URL: https://github.com/apache/trafficcontrol/pull/7741#discussion_r1316219342
##########
cache-config/t3c-check-refs/t3c-check-refs.go:
##########
@@ -115,7 +115,7 @@ func checkConfigLine(line string, lineNumber int, filesAdding map[string]struct{
// are assumed to be configuration files and are checked that they
// exist in the filesystem at the absolute location in the name
// or relative to the ATS configuration files directory.
- m := regexp.MustCompile(`^*(\.config|\.cfg|\.txt|\.yml|\.yaml|\.lua)+`)
+ m := regexp.MustCompile(`^*(\.config|\.cfg|\.txt|\.yml|\.yaml|\.lua)$`)
Review Comment:
Indeed, the beginning of the regex is not valid too and it seems the Go regexp lib is not complaining
I have fixed that too with your suggestion, thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] jpappa200 commented on a diff in pull request #7741: fix(t3c): regex for pparam should check end of path
Posted by "jpappa200 (via GitHub)" <gi...@apache.org>.
jpappa200 commented on code in PR #7741:
URL: https://github.com/apache/trafficcontrol/pull/7741#discussion_r1316170660
##########
cache-config/t3c-check-refs/t3c-check-refs.go:
##########
@@ -115,7 +115,7 @@ func checkConfigLine(line string, lineNumber int, filesAdding map[string]struct{
// are assumed to be configuration files and are checked that they
// exist in the filesystem at the absolute location in the name
// or relative to the ATS configuration files directory.
- m := regexp.MustCompile(`^*(\.config|\.cfg|\.txt|\.yml|\.yaml|\.lua)+`)
+ m := regexp.MustCompile(`^*(\.config|\.cfg|\.txt|\.yml|\.yaml|\.lua)$`)
Review Comment:
this looks we introduced a typo. (probably me) while we're changing it we should change the beginning to `^.+` regex101 tool doesn't like the `*`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(t3c): regex for pparam should check end of path [trafficcontrol]
Posted by "ocket8888 (via GitHub)" <gi...@apache.org>.
ocket8888 merged PR #7741:
URL: https://github.com/apache/trafficcontrol/pull/7741
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] codecov[bot] commented on pull request #7741: fix(t3c): regex for pparam should check end of path
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7741:
URL: https://github.com/apache/trafficcontrol/pull/7741#issuecomment-1691844862
## [Codecov](https://app.codecov.io/gh/apache/trafficcontrol/pull/7741?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#7741](https://app.codecov.io/gh/apache/trafficcontrol/pull/7741?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (ee6643f) into [master](https://app.codecov.io/gh/apache/trafficcontrol/commit/b3df7d21477697905fd765535548842672698522?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (b3df7d2) will **decrease** coverage by `3.16%`.
> Report is 4 commits behind head on master.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #7741 +/- ##
============================================
- Coverage 44.20% 41.04% -3.16%
Complexity 98 98
============================================
Files 274 298 +24
Lines 13780 15277 +1497
Branches 90 90
============================================
+ Hits 6091 6271 +180
- Misses 7197 8502 +1305
- Partials 492 504 +12
```
| [Flag](https://app.codecov.io/gh/apache/trafficcontrol/pull/7741/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [grove_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/7741/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `12.02% <ø> (?)` | |
| [traffic_monitor_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/7741/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.33% <ø> (ø)` | |
| [unit_tests](https://app.codecov.io/gh/apache/trafficcontrol/pull/7741/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `23.59% <ø> (-2.75%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
[see 24 files with indirect coverage changes](https://app.codecov.io/gh/apache/trafficcontrol/pull/7741/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #7741: fix(t3c): regex for pparam should check end of path
Posted by "zrhoffman (via GitHub)" <gi...@apache.org>.
zrhoffman commented on PR #7741:
URL: https://github.com/apache/trafficcontrol/pull/7741#issuecomment-1697615264
r? @jpappa200 @traeak
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org