Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

deprecate resource names not supported by microgenerators#3016

Merged
yihanzhen merged 8 commits intogoogleapis:masterfrom
yihanzhen:deprecated-resource
Nov 7, 2019
Merged

deprecate resource names not supported by microgenerators#3016
yihanzhen merged 8 commits intogoogleapis:masterfrom
yihanzhen:deprecated-resource

Conversation

@yihanzhen
Copy link
Copy Markdown
Contributor

@yihanzhen yihanzhen commented Nov 4, 2019

Deprecate resource names that will not exist in microgenerator/proto annotation world.

  • add a deprecated_collections field in gapic config V2. Resource names specified here will continue to be generated the same way gapic generator treats collections in gapic config v1, but the helper functions will be marked deprecated.

  • Add two deprecated resource names in baseline tests, project_book to test the case where a deprecated resource name has the same name as a non-deprecated one, and book_from_archive to test the case where a deprecated resource has a unique name.

  • Node.js change: add a deprecation warning to all resource name helpers related to project_book and book_from_archive ===> PTAL @alexander-fenster

  • Ruby: add a deprecation warning to all resource name helpers related to book_from_archive and project_book ===> PTAL @dazuma

  • Python: add a deprecation warning to all resource names. ===> PTAL @software-dov @busunkim96 (Fix Python: Deprecate resource name helper functions #3012)

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 4, 2019
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 4, 2019

Codecov Report

Merging #3016 into master will increase coverage by <.01%.
The diff coverage is 95.45%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3016      +/-   ##
============================================
+ Coverage     87.09%   87.09%   +<.01%     
+ Complexity     5949     5946       -3     
============================================
  Files           491      490       -1     
  Lines         23681    23678       -3     
  Branches       2547     2546       -1     
============================================
- Hits          20625    20623       -2     
+ Misses         2210     2209       -1     
  Partials        846      846
Impacted Files Coverage Δ Complexity Δ
.../codegen/viewmodel/FormatResourceFunctionView.java 100% <100%> (ø) 2 <1> (ø) ⬇️
...oogle/api/codegen/config/GapicInterfaceConfig.java 80.88% <100%> (+1.03%) 49 <2> (+2) ⬆️
...i/codegen/transformer/PathTemplateTransformer.java 98.8% <100%> (+0.01%) 35 <0> (ø) ⬇️
...i/codegen/viewmodel/ParseResourceFunctionView.java 100% <100%> (ø) 2 <1> (ø) ⬇️
...e/api/codegen/config/SingleResourceNameConfig.java 85.71% <90%> (+0.86%) 10 <2> (+1) ⬆️
...rmer/csharp/CSharpStandaloneSampleTransformer.java 97.72% <0%> (-0.46%) 6% <0%> (-1%)
...le/api/codegen/viewmodel/SampleEntryPointView.java
...transformer/StaticLangGapicSamplesTransformer.java 90.14% <0%> (+0.27%) 24% <0%> (-3%) ⬇️
...oogle/api/codegen/util/java/JavaRenderingUtil.java 100% <0%> (+12.5%) 5% <0%> (+1%) ⬆️

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 f656fa5...8065708. Read the comment docs.

@software-dov
Copy link
Copy Markdown
Contributor

Python generated warnings look good.

@yihanzhen
Copy link
Copy Markdown
Contributor Author

@vam-google for implementation review.

@yihanzhen yihanzhen changed the title WIP: deprecate resources not supported by microgenerators deprecate resource names not supported by microgenerators Nov 4, 2019
Comment thread src/main/resources/com/google/api/codegen/nodejs/main.snip Outdated
@yihanzhen
Copy link
Copy Markdown
Contributor Author

Hi @vam-google @dazuma
I need to get this merged soon to catch an artman release (this is unrelated to the unsettled discussions for Java). Feel free to take a look and drop comments if you want to and I am happy to address any concerns in coming PRs.

@# @@return [String]
def self.{@function.name} {@createResourceFunctionParams(function.resourceIdParams)}
@if function.isResourceNameDeprecated
warn "This helper function will be deleted in the next major version."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please omit this. Ruby devs do not like warnings printed to stderr with no way of disabling it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@yihanzhen
Copy link
Copy Markdown
Contributor Author

PTAL

Copy link
Copy Markdown
Contributor

@dazuma dazuma left a comment

Choose a reason for hiding this comment

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

Okay for Ruby

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Deprecate resource name helper functions

6 participants