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

[C++] Use same regex code at ZTSClient #11323

Merged
merged 1 commit into from
Jul 19, 2021

Conversation

equanz
Copy link
Contributor

@equanz equanz commented Jul 15, 2021

Motivation

#9533 causes some degraded behaviors at ZTSClient.

  1. when using boost::regex
    • can't set path at file scheme
  2. when using std::regex
    • can't set relative path like file:./path/to/private.key

I'd like to fix this issue.

Modifications

  • Use same regex code between boost and std like this
  • Fix regex to be able to capture relative path like file:./

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Add unit tests for ZTSClientWrapper::parseUri with relative path

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

For contributor

For this PR, do we need to update docs?

No. Because this is one of the bug fixes.

For committer

For this PR, do we need to update docs?

  • If yes,
    • if you update docs in this PR, label this PR with the doc label.
    • if you plan to update docs later, label this PR with the doc-required label.
    • if you need help on updating docs, create a follow-up issue with the doc-required label.
  • If no, label this PR with the no-need-doc label and explain why.

@nkurihar nkurihar added component/c++ area/client type/bug The PR fixed a bug or issue reported a bug labels Jul 15, 2021
@equanz
Copy link
Contributor Author

equanz commented Jul 15, 2021

/pulsarbot run-failure-checks

1 similar comment
@equanz
Copy link
Contributor Author

equanz commented Jul 15, 2021

/pulsarbot run-failure-checks

@Anonymitaet
Copy link
Member

Thanks for your contribution. For this PR, do we need to update docs?

(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc info in future PR descriptions? Thanks)

@equanz
Copy link
Contributor Author

equanz commented Jul 16, 2021

@Anonymitaet

(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc info in future PR descriptions? Thanks)

I understand. I updated the description.

@Anonymitaet Anonymitaet added the doc-not-needed Your PR changes do not impact docs label Jul 16, 2021
@Anonymitaet
Copy link
Member

@equanz many thanks!

@sijie sijie added this to the 2.9.0 milestone Jul 19, 2021
@sijie sijie merged commit 7cce8e3 into apache:master Jul 19, 2021
@equanz equanz deleted the fix_zts_client_regex branch July 19, 2021 07:21
lhotari added a commit to lhotari/pulsar that referenced this pull request Jul 21, 2021
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Jul 22, 2021
### Motivation
apache#9533 causes some degraded behaviors at [ZTSClient](https://github.com/apache/pulsar/pull/9533/files#diff-41a90a5ec7937b5e2151752843621d6acfe8963077dc04c285842a09a4e45ecc).

1. when using boost::regex
   - can't set `path` at file scheme
2. when using std::regex
   - can't set relative path like `file:./path/to/private.key`

I'd like to fix this issue.

### Modifications

* Use same regex code between boost and std like [this](https://github.com/apache/pulsar/pull/9533/files#diff-a67e917f5f42f3337507a69a4e0f13e286238dc759b4048cb5141290cf445b38)
* Fix regex to be able to capture relative path like `file:./`
codelipenghui pushed a commit that referenced this pull request Jul 23, 2021
### Motivation
#9533 causes some degraded behaviors at [ZTSClient](https://github.com/apache/pulsar/pull/9533/files#diff-41a90a5ec7937b5e2151752843621d6acfe8963077dc04c285842a09a4e45ecc).

1. when using boost::regex
   - can't set `path` at file scheme
2. when using std::regex
   - can't set relative path like `file:./path/to/private.key`

I'd like to fix this issue.

### Modifications

* Use same regex code between boost and std like [this](https://github.com/apache/pulsar/pull/9533/files#diff-a67e917f5f42f3337507a69a4e0f13e286238dc759b4048cb5141290cf445b38)
* Fix regex to be able to capture relative path like `file:./`

(cherry picked from commit 7cce8e3)
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jul 23, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
### Motivation
apache#9533 causes some degraded behaviors at [ZTSClient](https://github.com/apache/pulsar/pull/9533/files#diff-41a90a5ec7937b5e2151752843621d6acfe8963077dc04c285842a09a4e45ecc).

1. when using boost::regex
   - can't set `path` at file scheme
2. when using std::regex
   - can't set relative path like `file:./path/to/private.key`

I'd like to fix this issue.

### Modifications

* Use same regex code between boost and std like [this](https://github.com/apache/pulsar/pull/9533/files#diff-a67e917f5f42f3337507a69a4e0f13e286238dc759b4048cb5141290cf445b38)
* Fix regex to be able to capture relative path like `file:./`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.1 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants