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: Match all whitespace and non-whitespace for Pub/Sub subscription filter validation #11676

Merged
merged 4 commits into from
Sep 12, 2024

Conversation

michaelpri10
Copy link
Contributor

@michaelpri10 michaelpri10 commented Sep 11, 2024

This change the regular expression validation for Pub/Sub subscriptions to use [\s\S] instead of . when matching characters to match both whitespace and non-whitespace characters. Because we allow empty filters (see this issue), having only whitespace characters (which would be matched by this filter) is valid as well. This will not introduce any breaking changes as it only expands the character set for subscription filters.

This fixes this issue.

Release Note Template for Downstream PRs (will be copied)

pubsub: allowed `google_pubsub_subscription` `filter` field to contain line breaks

Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))
google-beta provider: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 51
Passed tests: 50
Skipped tests: 1
Affected tests: 0

Click here to see the affected service packages
  • pubsub

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Can you add a test that uses a whitespace character so we can ensure this use case works in the future?

@github-actions github-actions bot requested a review from slevenick September 11, 2024 14:20
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))
google-beta provider: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 51
Passed tests: 50
Skipped tests: 1
Affected tests: 0

Click here to see the affected service packages
  • pubsub

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

You need to add an example block to the YAML file that references the new example that you've written

@michaelpri10
Copy link
Contributor Author

You need to add an example block to the YAML file that references the new example that you've written

I've added the examples blocks. Thank you for catching this!

@github-actions github-actions bot requested a review from slevenick September 11, 2024 15:12
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 79 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 3 files changed, 79 insertions(+), 1 deletion(-))
Open in Cloud Shell: Diff ( 4 files changed, 120 insertions(+))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 79 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 3 files changed, 79 insertions(+), 1 deletion(-))
Open in Cloud Shell: Diff ( 4 files changed, 120 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 52
Passed tests: 50
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • pubsub

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccPubsubSubscription_pubsubSubscriptionPullFilterExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccPubsubSubscription_pubsubSubscriptionPullFilterExample[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pubsub subscription filters with newlines are no longer allowed by validator
3 participants