GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bigtable: clean up the public surface by igorbernstein2 · Pull Request #5034 · googleapis/google-cloud-java

Conversation

@igorbernstein2

@igorbernstein2 igorbernstein2 commented Apr 29, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Exclude autogenerated files that aren't used
  • Internal implementation details are now package private
  • Internal implementation details are now @internalapi
  • package-info.java documents the public surface instead of the autogen one
  • EnhancedBigtableStubSetting is now public api
  • synth.py is responsible for the transformations

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@igorbernstein2
Bigtable: clean up the public surface
f32cdcf
* Exclude autogenerated files that aren't used
* Internal implementation details are now package private
* Internal implementation details that are needed by other pacakges are now @internalapi (ie. pagination wrappers in Client)
* package-info.java not document the public surface instead of the autogen one
* EnhancedBigtableStubSetting are now public api
* synth.py is responsible for the transformations
@igorbernstein2
igorbernstein2 requested a review from a team April 29, 2019 15:43
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 29, 2019
@igorbernstein2 igorbernstein2 added api: bigtable Issues related to the Bigtable API. and removed cla: yes This human has signed the Contributor License Agreement. labels Apr 29, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 29, 2019
@igorbernstein2 igorbernstein2 added type: cleanup An internal cleanup or hygiene concern. and removed cla: yes This human has signed the Contributor License Agreement. labels Apr 29, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 29, 2019
@kolea2

kolea2 commented Apr 29, 2019

Copy link
Copy Markdown
Contributor

Can/should this be done on the proto level instead?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@igorbernstein

igorbernstein commented Apr 29, 2019

Copy link
Copy Markdown

I don’t know of a way. Do you have a recommendation?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@igorbernstein2 igorbernstein2 mentioned this pull request Apr 29, 2019
Fix move excludes googleapis/synthtool#232
Merged
igorbernstein2 added 3 commits April 29, 2019 13:34
@igorbernstein2
exclude gradle build files
427d166
@igorbernstein2
fix whitespace
90a9f52
@igorbernstein2
Fix tests by making things InternalApi instead of package-private.
f11cacc
Mockito can't mock classes which have package-private parents
@igorbernstein2

igorbernstein2 commented Apr 29, 2019

Copy link
Copy Markdown
Contributor Author

Updated PR to only mark things as InternalApi instead of marking things as package private, which broke tests using Mockito to mock the stubs

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chingor13
chingor13 reviewed Apr 29, 2019
View reviewed changes

@chingor13 chingor13 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Ideally any search/replacing we do with synthtool is temporary and can be fixed upstream in the Gapic generator. Perhaps we need another annotation/config for marking a class as internal api in the Gapic generator. Relying on finding the internal api comment is bound to fail at some point.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...gtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java
* </code>
* </pre>
*/
@Generated("by gapic-generator")

@chingor13 chingor13 Apr 29, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Should we preserve this annotation so we mark the class as generated.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@igorbernstein2 igorbernstein2 Apr 29, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I was debating this myself. As far as I know nothing uses that annotation and I decided to keep it simple until its needed. If you feel strongly, I can try to retain it

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
igorbernstein2 added 3 commits April 29, 2019 18:41
@igorbernstein2
add todo to simplify synth.py
e51783a
@igorbernstein2
Add tests to make sure that the gapic api is @InternalOnly
2c8d026
@igorbernstein2
Keep @autogenerated annotations
2652323
@codecov

codecov Bot commented Apr 29, 2019

Copy link
Copy Markdown

Codecov Report

Merging #5034 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #5034      +/-   ##
============================================
+ Coverage     50.33%   50.33%   +<.01%     
+ Complexity    23676    23662      -14     
============================================
  Files          2238     2236       -2     
  Lines        226057   225941     -116     
  Branches      24961    24954       -7     
============================================
- Hits         113775   113728      -47     
+ Misses       103678   103613      -65     
+ Partials       8604     8600       -4
Impacted Files Coverage Δ Complexity Δ
...able/admin/v2/stub/GrpcBigtableTableAdminStub.java 94.48% <ø> (ø) 20 <0> (ø) ⬇️
...stub/GrpcBigtableInstanceAdminCallableFactory.java 50% <ø> (ø) 4 <0> (ø) ⬇️
...able/data/v2/stub/GrpcBigtableCallableFactory.java 37.5% <ø> (ø) 3 <0> (ø) ⬇️
...table/admin/v2/stub/BigtableInstanceAdminStub.java 3.84% <ø> (ø) 1 <0> (ø) ⬇️
...v2/stub/GrpcBigtableTableAdminCallableFactory.java 50% <ø> (ø) 4 <0> (ø) ⬇️
...ud/bigtable/data/v2/stub/BigtableStubSettings.java 82.01% <ø> (-2.16%) 14 <0> (-1)
.../cloud/bigtable/data/v2/stub/GrpcBigtableStub.java 93.79% <ø> (-0.69%) 12 <0> (-1)
...igtable/gaxx/retrying/ApiResultRetryAlgorithm.java 30.76% <ø> (ø) 6 <0> (ø) ⬇️
...ble/data/v2/stub/EnhancedBigtableStubSettings.java 98.61% <ø> (ø) 17 <0> (ø) ⬇️
...bigtable/admin/v2/stub/BigtableTableAdminStub.java 5.26% <ø> (ø) 1 <0> (ø) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac0084f...2652323. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@igorbernstein2

igorbernstein2 commented Apr 29, 2019

Copy link
Copy Markdown
Contributor Author

As discussed offline:

  • created a gapic-generator feature request: Add ability to suppress unwanted autogenerated code for clients that use the gapic as a implementation detail gapic-generator#2742
  • inserted Autogenerated annotations
  • added unit tests to make sure that the InternalApi annotations stick
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chingor13
chingor13 approved these changes Apr 29, 2019
View reviewed changes

@chingor13 chingor13 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Add a link to the feature request in the gapic generator. Otherwise LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-clients/google-cloud-bigtable/synth.py
s.copy(admin_library / 'grpc-google-cloud-bigtable-admin-v2/src', '../../google-api-grpc/grpc-google-cloud-bigtable-admin-v2/src')
s.copy(admin_library / 'proto-google-cloud-bigtable-admin-v2/src', '../../google-api-grpc/proto-google-cloud-bigtable-admin-v2/src')
# Replace javadoc and annotations before every public class with InternalApi
# javadoc and annotation

@chingor13 chingor13 Apr 29, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can you add the link to the feature request issue for the gapic generator?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@igorbernstein2 igorbernstein2 Apr 29, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It's at the top of the file

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@igorbernstein2 igorbernstein2 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 29, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 29, 2019
@igorbernstein2
igorbernstein2 merged commit 71733ab into googleapis:master Apr 29, 2019
@igorbernstein2
igorbernstein2 deleted the visibility-1 branch April 29, 2019 23:46
@JesseLovelace JesseLovelace mentioned this pull request May 1, 2019
Release v0.90.0 #5047
Merged
benjaminp pushed a commit to benjaminp/google-cloud-java that referenced this pull request Jul 13, 2026
@igorbernstein2
Bigtable: clean up the public surface (googleapis#5034)
2e6d84e
* Bigtable: clean up the public surface

* Exclude autogenerated files that aren't used
* Internal implementation details are now package private
* Internal implementation details that are needed by other pacakges are now @internalapi (ie. pagination wrappers in Client)
* package-info.java not document the public surface instead of the autogen one
* EnhancedBigtableStubSetting are now public api
* synth.py is responsible for the transformations

* exclude gradle build files

* fix whitespace

* Fix tests by making things InternalApi instead of package-private.

Mockito can't mock classes which have package-private parents

* add todo to simplify synth.py

* Add tests to make sure that the gapic api is @InternalOnly

* Keep @autogenerated annotations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chingor13 chingor13 chingor13 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: bigtable Issues related to the Bigtable API. cla: yes This human has signed the Contributor License Agreement. type: cleanup An internal cleanup or hygiene concern.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@igorbernstein2 @kolea2 @igorbernstein @chingor13 @googlebot @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.