java-docs-samples icon indicating copy to clipboard operation
java-docs-samples copied to clipboard

iam/api-client should be rewritten - Cloud Resource manager API practices are awkward at best.

Open lesv opened this issue 5 years ago • 17 comments

PR #2245 shows multiple bad practices, iam/api-client sample should be rewritten.

lesv avatar Mar 12 '20 22:03 lesv

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.

stale[bot] avatar Jun 02 '20 22:06 stale[bot]

Still needs to happen.

lesv avatar Jun 02 '20 22:06 lesv

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.

lesv avatar Jun 10 '20 21:06 lesv

v1 and v2 are distinct APIs that don't share any RPCs :(

chingor13 avatar Jun 10 '20 21:06 chingor13

@averikitsch Can you find someone to look at this?

lesv avatar Jul 10 '20 17:07 lesv

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.

averikitsch avatar Jul 10 '20 22:07 averikitsch

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.

lesv avatar Jul 10 '20 22:07 lesv

Beyond changes sample rubric/format changes, what are the major bad practices you see?

averikitsch avatar Jul 11 '20 00:07 averikitsch

Unassigning myself as there are larger efforts to update docs and client libraries.

averikitsch avatar Jul 14 '20 21:07 averikitsch

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

lesv avatar Oct 14 '20 19:10 lesv

@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?

lesv avatar Oct 14 '20 19:10 lesv

@JustinBeckwith FYI @tequilarista PTAL

lesv avatar Oct 14 '20 20:10 lesv

The tests are still flaky and there is a new team forming to address this in the new year.

lesv avatar Dec 09 '20 23:12 lesv

@JustinBeckwith Bu-Sun suggested giving this to you - perhaps you can find an owner.

lesv avatar Jun 01 '21 19:06 lesv

TL;DR; this may just go away after GAPIC v3 lib releases.

lesv avatar Jun 02 '21 22:06 lesv

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.

stale[bot] avatar Apr 16 '22 15:04 stale[bot]

@eaball35 Since we have the updated IAM GAPIC libraries, I am guessing this issue is not valid?

Sita04 avatar Sep 01 '22 08:09 Sita04