Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

[Discogapic] Parse ResourceName when it contains a service address #2477

Conversation

andreamlin
Copy link
Contributor

@andreamlin andreamlin commented Dec 10, 2018

This would fix googleapis/google-cloud-java#3604.

Problem: When a resource comes back from the server, its resource path is something like

instance.zone = https://www.googleapis.com/compute/v1/projects/project-123/zones/europe-west3-c

And that string won't be parseable against a PathTemplate of form {project}/zones/{zone}.

Proposed solution: Optionally ignore the leading service address, which for Compute is https://www.googleapis.com/compute/v1/projects/.

See googleapis/google-cloud-java#4208 for resulting changes.

@codecov-io
Copy link

codecov-io commented Dec 10, 2018

Codecov Report

Merging #2477 into fix_compute_resource_parsing will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@                        Coverage Diff                        @@
##             fix_compute_resource_parsing   #2477      +/-   ##
=================================================================
+ Coverage                            86.8%   86.8%   +<.01%     
  Complexity                           5365    5365              
=================================================================
  Files                                 459     459              
  Lines                               21175   21176       +1     
  Branches                             2308    2308              
=================================================================
+ Hits                                18381   18382       +1     
  Misses                               1972    1972              
  Partials                              822     822
Impacted Files Coverage Δ Complexity Δ
...degen/viewmodel/StaticLangApiResourceNameView.java 75% <ø> (ø) 2 <0> (ø) ⬇️
...degen/discogapic/transformer/DiscoGapicParser.java 92.72% <ø> (ø) 22 <0> (ø) ⬇️
...a/JavaDiscoGapicResourceNameToViewTransformer.java 100% <100%> (ø) 15 <0> (ø) ⬇️

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 d78306f...c19acda. Read the comment docs.

@andreamlin andreamlin changed the base branch from master to fix_compute_resource_parsing December 11, 2018 00:02
@andreamlin andreamlin closed this Dec 11, 2018
@andreamlin
Copy link
Contributor Author

ci/circleci: compute-discovery-test is going to fail because googleapis/discovery-artifact-manager#102 isn't merged yet.

@andreamlin
Copy link
Contributor Author

PTAL

@andreamlin andreamlin requested a review from pongad December 11, 2018 00:51
@andreamlin andreamlin merged commit 543efd5 into googleapis:fix_compute_resource_parsing Dec 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants