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

feat(pubsublite): Pub/Sub Lite admin client #3036

Merged
merged 16 commits into from Oct 26, 2020
Merged

Conversation

@tmdiep
Copy link
Contributor

@tmdiep tmdiep commented Oct 16, 2020

Implements pubsublite.Client, which wraps the Pub/Sub Lite Admin Service.
Includes integration tests for admin operations.

@tmdiep tmdiep requested a review from googleapis/yoshi-go-admins as a code owner Oct 16, 2020
@google-cla google-cla bot added the cla: yes label Oct 16, 2020
@tmdiep tmdiep requested a review from hongalex Oct 16, 2020
@tmdiep
Copy link
Contributor Author

@tmdiep tmdiep commented Oct 16, 2020

Unit tests will be in a future PR, as they would make this one too large and I figured integration tests are more worthwhile.

pubsublite/integration_test.go Outdated Show resolved Hide resolved
pubsublite/integration_test.go Outdated Show resolved Hide resolved
pubsublite/pubsublite.go Outdated Show resolved Hide resolved
pubsublite/integration_test.go Show resolved Hide resolved
pubsublite/integration_test.go Outdated Show resolved Hide resolved
pubsublite/pubsublite.go Outdated Show resolved Hide resolved
pubsublite/pubsublite.go Outdated Show resolved Hide resolved
pubsublite/pubsublite.go Outdated Show resolved Hide resolved
pubsublite/pubsublite.go Outdated Show resolved Hide resolved
pubsublite/pubsublite.go Outdated Show resolved Hide resolved
pubsublite/pubsublite.go Outdated Show resolved Hide resolved
@tmdiep
Copy link
Contributor Author

@tmdiep tmdiep commented Oct 20, 2020

Thanks both, all comments addressed.
But I'd like to get Manu to review as well, once it's possible!

@tmdiep tmdiep requested a review from manuelmenzella-google Oct 20, 2020
@tmdiep
Copy link
Contributor Author

@tmdiep tmdiep commented Oct 21, 2020

Manu will be OOO the next couple of days, so I'll get this committed to unblock dependent PRs. This is ready for approval and merge now.

@tmdiep tmdiep requested review from codyoss and hongalex Oct 21, 2020
Copy link
Member

@codyoss codyoss left a comment

No need to block on these as more iteration can happen later. Just some thoughts.

pubsublite/config.go Show resolved Hide resolved
}

// DeleteTopic deletes a topic.
func (ac *AdminClient) DeleteTopic(ctx context.Context, topic TopicPath) error {

This comment has been minimized.

@codyoss

codyoss Oct 22, 2020
Member

Here, and with other methods, XXXPath does not seems like a meaningful name. It makes sense if you know that it is used to build a resource name, but if you don't know that the name is confusing in my opinion. I wonder if there is a way to refactor this so that all you need to pass to the method is a context and TopicID.

This comment has been minimized.

@tmdiep

tmdiep Oct 22, 2020
Author Contributor

The topic is uniquely identified by its {project, zone, topic id}. I didn't store the project in the client because we can have cross-project subscriptions, where the topic and subscription resources are not necessarily owned by the same project. So having a default project set for the client could cause some confusion for, e.g. Create/Update Subscription (i.e. is the default project used for the topic or the subscription?).

I also saw that pubsub.Client had evolved to support multiple variants Topic/TopicInProject, Subscription/SubscriptionInProject, so wanted to avoid this, as it seems multi-project admin does occur.

Similar remarks for zone, as the admin server is regional. Users can use the same client to manage all resources within the region.

For these reasons, I thought it would be best to give the client more flexibility with projects and zones; minimizing the number of methods.

This comment has been minimized.

@tmdiep

tmdiep Oct 22, 2020
Author Contributor

I forgot to mention: we have planned regional replication for topics (b/171412217), so the admin client could end up dealing with multiple zones within the same region, so storing a default zone could cause confusion and/or proliferation of method variants.

@tmdiep tmdiep force-pushed the tmdiep:admin_client branch from 6e94fb6 to 04abefd Oct 22, 2020
@gcf-merge-on-green
Copy link
Contributor

@gcf-merge-on-green gcf-merge-on-green bot commented Oct 23, 2020

Your PR has attempted to merge for 3 hours. Please check that all required checks have passed, you have an automerge label, and that all your reviewers have approved the PR

@tmdiep tmdiep removed the request for review from manuelmenzella-google Oct 23, 2020
@gcf-merge-on-green
Copy link
Contributor

@gcf-merge-on-green gcf-merge-on-green bot commented Oct 23, 2020

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, or one of your required reviews was not approved. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

1 similar comment
@gcf-merge-on-green
Copy link
Contributor

@gcf-merge-on-green gcf-merge-on-green bot commented Oct 23, 2020

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, or one of your required reviews was not approved. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

tmdiep added 2 commits Oct 23, 2020
@tmdiep tmdiep merged commit 749473e into googleapis:master Oct 26, 2020
3 checks passed
3 checks passed
@google-cla
cla/google All necessary CLAs are signed
@conventional-commit-lint-gcf
conventionalcommits.org
Details
@kokoro-team
kokoro Kokoro CI build successful
Details
@tmdiep tmdiep deleted the tmdiep:admin_client branch Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants