iam/api-client should be rewritten - Cloud Resource manager API practices are awkward at best.
PR #2245 shows multiple bad practices, iam/api-client sample should be rewritten.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still needs to happen.
The client has moved from v1 -> v2, so should the sample. https://github.com/GoogleCloudPlatform/java-docs-samples/pull/3129
Some fields need to be renamed.
v1 and v2 are distinct APIs that don't share any RPCs :(
@averikitsch Can you find someone to look at this?
Is this ask for creating new V2 samples or to update the old V1 samples? The QuickstartV2.java does include multiple snippets similar to the V1 snippets.
I don't think there was a v2 quickstart when I wrote this.
v1's specific samples aren't in the standard format and aren't in a form that is easy to run directly.
Both v1 & v2 are needed (also a bad practice), we might wish to focus on fixing it.
(That said, I know very little about either v1 or v2, so my comments are just as a viewer)
I would suggest asking the IAM PM about this as it's unclear to me how urgent this should be. I'm going to mark this as a P3 for now until we get some data.
Beyond changes sample rubric/format changes, what are the major bad practices you see?
Unassigning myself as there are larger efforts to update docs and client libraries.
Found in #4005
Java 8 - flaky tests
------------------------------------------------------------
- testing iam/api-client
------------------------------------------------------------
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.746 s <<< FAILURE! - in iam.snippets.QuickstartTests
[ERROR] iam.snippets.QuickstartTests.testQuickstart Time elapsed: 1.735 s <<< ERROR!
java.lang.NullPointerException
at iam.snippets.Quickstart.setPolicy(Quickstart.java:170)
at iam.snippets.Quickstart.addBinding(Quickstart.java:122)
at iam.snippets.QuickstartTests.testQuickstart(QuickstartTests.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:364)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:272)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:237)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:158)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
[ERROR] Errors:
[ERROR] QuickstartTests.testQuickstart:126 » NullPointer
[ERROR] Tests run: 16, Failures: 0, Errors: 1, Skipped: 0
@averikitsch I'm raising this to a P1, 'caus it's causing me problems today. Who can I discuss these "larger issues" with, and why is it an issue 3 months later?
@JustinBeckwith FYI @tequilarista PTAL
The tests are still flaky and there is a new team forming to address this in the new year.
@JustinBeckwith Bu-Sun suggested giving this to you - perhaps you can find an owner.
TL;DR; this may just go away after GAPIC v3 lib releases.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@eaball35 Since we have the updated IAM GAPIC libraries, I am guessing this issue is not valid?