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: add topic existing validation #32465

Merged
merged 10 commits into from
Sep 25, 2024

Conversation

proost
Copy link
Contributor

@proost proost commented Sep 15, 2024

Please add a meaningful description for your change here
fix: #18027

adding validation to check topic exist or not for PubsubIO


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@proost proost changed the title feat: add topic existing validation fix: add topic existing validation Sep 15, 2024
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @m-trieu for label java.
R: @ahmedabu98 for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

@ahmedabu98 ahmedabu98 left a comment

Choose a reason for hiding this comment

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

This looks great! can you add a comment on CHANGES.md calling out this new addition?

@proost
Copy link
Contributor Author

proost commented Sep 16, 2024

@ahmedabu98
I update "CHANGES.md".

can you review again? because i notice that Write doesn't validate topic. when topic is given statically, check topic is valid or not.

Copy link
Contributor

@ahmedabu98 ahmedabu98 left a comment

Choose a reason for hiding this comment

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

Thanks! left some comments

Copy link
Contributor

Reminder, please take a look at this pr: @m-trieu @ahmedabu98

Copy link
Contributor

@ahmedabu98 ahmedabu98 left a comment

Choose a reason for hiding this comment

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

Looks great! thanks for adding this

Will merge when that last workflow passes

@ahmedabu98 ahmedabu98 merged commit 380ed7b into apache:master Sep 25, 2024
19 checks passed
@Abacn
Copy link
Contributor

Abacn commented Sep 26, 2024

This is breaking Java presubmit:

testPubsubSinkOverride (org.apache.beam.runners.dataflow.DataflowRunnerTest) failed

java.lang.RuntimeException: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
GET https://pubsub.googleapis.com/v1/projects/project/topics/topic
{
  "code": 403,
  "errors": [
    {
      "domain": "global",
      "message": "Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API.",
      "reason": "forbidden"
    }
  ],
  "message": "Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API.",
  "status": "PERMISSION_DENIED"
}
	at org.apache.beam.sdk.io.gcp.pubsub.PubsubIO$Write.validate(PubsubIO.java:1658)

#18027 was a very old Issue. Is it still needed here?

return false;
}

throw e;
Copy link
Contributor

@Abacn Abacn Sep 26, 2024

Choose a reason for hiding this comment

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

This is a breaking change. Pipeline construction environment may not have access to the PubSub. Here it should either be fail safe or not enabled by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Abacn
Oh, I missed that point. How about disabled as default? Checking topic existence is needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about disabled as default?

sounds good

@Abacn
Copy link
Contributor

Abacn commented Sep 26, 2024

Well, I am going to revert the change for now, as introducing a required field in IO connector specification would generally breaks upgrade compatibility of pipelines (unless tested not to be the case).

Abacn added a commit that referenced this pull request Sep 26, 2024
Abacn added a commit that referenced this pull request Sep 26, 2024
@proost proost deleted the enh-pubsub-topic-validation branch September 27, 2024 14:10
@proost proost mentioned this pull request Sep 27, 2024
3 tasks
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.

Validate Pubsub Topic exists when reading
3 participants