Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

docs(samples): added samples and tests for BigQuery export RPCs #782

Merged
merged 18 commits into from
May 4, 2022

Conversation

Sita04
Copy link
Contributor

@Sita04 Sita04 commented Mar 15, 2022

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

If you write sample code, please follow the samples format.

@Sita04 Sita04 requested a review from a team as a code owner March 15, 2022 08:43
@generated-files-bot
Copy link

generated-files-bot bot commented Mar 15, 2022

Warning: This pull request is touching the following templated files:

  • .kokoro/presubmit/samples.cfg
  • samples/snapshot/pom.xml
  • samples/snippets/pom.xml

@snippet-bot
Copy link

snippet-bot bot commented Mar 15, 2022

Here is the summary of changes.

You are about to add 5 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added api: securitycenter Issues related to the googleapis/java-securitycenter API. samples Issues that are directly related to samples. labels Mar 15, 2022
Copy link

@catherinerosesantos catherinerosesantos left a comment

Choose a reason for hiding this comment

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

Looks good! Just a few comments.

Copy link
Member

@Shabirmean Shabirmean left a comment

Choose a reason for hiding this comment

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

I've reviewed this PR as part of the onboarding process to become a java-samples reviewer. @kurtisvg can you shadow review my reviews on this PR?

Copy link
Member

@Shabirmean Shabirmean left a comment

Choose a reason for hiding this comment

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

Thank you for the changes. It seems like some tests are failing. PTAL!

@Sita04 Sita04 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 24, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 24, 2022
@Sita04 Sita04 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 25, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 25, 2022
@Sita04 Sita04 added the owlbot:ignore instruct owl-bot to ignore a PR label Mar 25, 2022
@suztomo
Copy link
Member

suztomo commented Apr 4, 2022

Memo:

com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: The caller does not have permission
	at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:53)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
	at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
	at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1133)
	at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
	at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1277)
	at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1038)
	at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:808)
	at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:564)
	at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:534)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at com.google.api.gax.grpc.ChannelPool$ReleasingClientCall$1.onClose(ChannelPool.java:455)
	at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:463)
	at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:427)
	at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:460)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:562)
	at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:743)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:722)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)
	Suppressed: com.google.api.gax.rpc.AsyncTaskException: Asynchronous task failed
		at com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:57)
		at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
		at com.google.cloud.securitycenter.v1.SecurityCenterClient.createBigQueryExport(SecurityCenterClient.java:4167)
		at com.google.cloud.examples.securitycenter.snippets.bigqueryexport.CreateBigQueryExport.createBigQueryExport(CreateBigQueryExport.java:83)
		at com.google.cloud.examples.securitycenter.snippets.BigQueryExportIT.setUp(BigQueryExportIT.java:76)
		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)

From .kokoro/presubmit/samples.cfg :

  • GOOGLE_CLOUD_PROJECT: java-docs-samples-testing
  • GOOGLE_APPLICATION_CREDENTIALS: secret_manager/java-docs-samples-service-account
  • SECRET_MANAGER_KEYS: java-docs-samples-service-account,java-scc-samples-secrets

@suztomo
Copy link
Member

suztomo commented Apr 4, 2022

Would "SECRET_MANAGER_KEYS" work for multiple keys? (The environment variable is plural but I'm not sure)

Screen Shot 2022-04-04 at 11 11 57 AM

@Neenu1995
Copy link
Contributor

The kokoro configuration looks correct. It will work with multiple keys.

@Sita04 Sita04 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 26, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 26, 2022
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Apr 27, 2022
@Sita04 Sita04 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 27, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 27, 2022
Copy link
Member

@Shabirmean Shabirmean left a comment

Choose a reason for hiding this comment

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

LGTM!

@Sita04 Sita04 added the automerge Merge the pull request once unit tests and other checks pass. label Apr 29, 2022
@gcf-merge-on-green
Copy link

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Apr 30, 2022
@Sita04 Sita04 merged commit 279624f into main May 4, 2022
@Sita04 Sita04 deleted the bigquery-export-samples branch May 4, 2022 14:19
gcf-merge-on-green bot pushed a commit that referenced this pull request May 24, 2022
🤖 I have created a release *beep* *boop*
---


## [2.6.0](v2.5.6...v2.6.0) (2022-05-19)


### Features

* add build scripts for native image testing in Java 17 ([#1440](https://github.com/googleapis/java-securitycenter/issues/1440)) ([#831](#831)) ([c9e86b6](c9e86b6))
* Add connection and description field to finding's list of attributes ([eddf09a](eddf09a))
* Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state ([eddf09a](eddf09a))
* Add next_steps field to finding's list of attributes ([eddf09a](eddf09a))
* AuditConfig for IAM v1 ([eddf09a](eddf09a))


### Documentation

* **samples:** added samples and tests for BigQuery export RPCs ([#782](#782)) ([279624f](279624f))


### Dependencies

* update dependency com.google.cloud:google-cloud-bigquery to v2.10.10 ([#823](#823)) ([033d05a](033d05a))
* update dependency com.google.cloud:google-cloud-bigquery to v2.11.0 ([#824](#824)) ([6cb75b3](6cb75b3))
* update dependency com.google.cloud:google-cloud-bigquery to v2.11.1 ([#827](#827)) ([794bd01](794bd01))
* update dependency com.google.cloud:google-cloud-bigquery to v2.11.2 ([#828](#828)) ([4b4b2df](4b4b2df))
* update dependency com.google.cloud:google-cloud-pubsub to v1.117.0 ([#825](#825)) ([6685899](6685899))
* update dependency com.google.cloud:google-cloud-pubsub to v1.118.0 ([#829](#829)) ([1af1799](1af1799))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.12.0 ([#830](#830)) ([602eb69](602eb69))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
github-actions bot pushed a commit to meltsufin/monorepo-experiments that referenced this pull request May 24, 2022
🤖 I have created a release *beep* *boop*
---


## [2.6.0](googleapis/java-securitycenter@v2.5.6...v2.6.0) (2022-05-19)


### Features

* add build scripts for native image testing in Java 17 ([#1440](https://github.com/googleapis/java-securitycenter/issues/1440)) ([#831](googleapis/java-securitycenter#831)) ([228f74c](googleapis/java-securitycenter@228f74c))
* Add connection and description field to finding's list of attributes ([76cfbce](googleapis/java-securitycenter@76cfbce))
* Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state ([76cfbce](googleapis/java-securitycenter@76cfbce))
* Add next_steps field to finding's list of attributes ([76cfbce](googleapis/java-securitycenter@76cfbce))
* AuditConfig for IAM v1 ([76cfbce](googleapis/java-securitycenter@76cfbce))


### Documentation

* **samples:** added samples and tests for BigQuery export RPCs ([#782](googleapis/java-securitycenter#782)) ([3bbab26](googleapis/java-securitycenter@3bbab26))


### Dependencies

* update dependency com.google.cloud:google-cloud-bigquery to v2.10.10 ([#823](googleapis/java-securitycenter#823)) ([3e053aa](googleapis/java-securitycenter@3e053aa))
* update dependency com.google.cloud:google-cloud-bigquery to v2.11.0 ([#824](googleapis/java-securitycenter#824)) ([a3e7c36](googleapis/java-securitycenter@a3e7c36))
* update dependency com.google.cloud:google-cloud-bigquery to v2.11.1 ([#827](googleapis/java-securitycenter#827)) ([a33d75a](googleapis/java-securitycenter@a33d75a))
* update dependency com.google.cloud:google-cloud-bigquery to v2.11.2 ([#828](googleapis/java-securitycenter#828)) ([244d0b3](googleapis/java-securitycenter@244d0b3))
* update dependency com.google.cloud:google-cloud-pubsub to v1.117.0 ([#825](googleapis/java-securitycenter#825)) ([4b7697f](googleapis/java-securitycenter@4b7697f))
* update dependency com.google.cloud:google-cloud-pubsub to v1.118.0 ([#829](googleapis/java-securitycenter#829)) ([4a06182](googleapis/java-securitycenter@4a06182))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.12.0 ([#830](googleapis/java-securitycenter#830)) ([e568092](googleapis/java-securitycenter@e568092))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: securitycenter Issues related to the googleapis/java-securitycenter API. owlbot:ignore instruct owl-bot to ignore a PR samples Issues that are directly related to samples. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants