Skip to content

chore: migrate google-devtools-containeranalysis to librarian#8522

Draft
suztomo wants to merge 1 commit into
googleapis:mainfrom
jskeet:scripted-migrate-google-devtools-containeranalysis
Draft

chore: migrate google-devtools-containeranalysis to librarian#8522
suztomo wants to merge 1 commit into
googleapis:mainfrom
jskeet:scripted-migrate-google-devtools-containeranalysis

Conversation

@suztomo

@suztomo suztomo commented Jun 10, 2026

Copy link
Copy Markdown
Member

Migrate google-devtools-containeranalysis to Librarian.

What is Grafeas?

Grafeas is an open-source artifact metadata API designed to audit, govern, and secure software supply chains. In Google Cloud, Container Analysis is the managed service implementation of Grafeas, used for storing vulnerability scans, build provenance, and attestations (which are verified by Binary Authorization at deployment time).

Customer-Facing Changes (Breaking Changes)

This migration separates the Grafeas client and protos from the Container Analysis package, delegating them to the dedicated @google-cloud/grafeas package. This introduces the following breaking changes:

  1. Grafeas Client Export Removed:
    GrafeasV1Beta1Client is no longer exported from @google-cloud/containeranalysis/build/src/v1beta1.

    • Before:
      import { v1beta1 } from '@google-cloud/containeranalysis';
      const client = new v1beta1.GrafeasV1Beta1Client();
    • After: Use @google-cloud/grafeas instead:
      import { v1beta1 } from '@google-cloud/grafeas';
      const client = new v1beta1.GrafeasV1Beta1Client();
  2. Grafeas Path Helpers Removed from ContainerAnalysisClient (v1):
    The helper methods for constructing and parsing note and occurrence resource paths have been removed from the ContainerAnalysisClient class in v1 because they are Grafeas-specific resources.

    • Removed Methods: notePath, matchProjectFromNoteName, matchNoteFromNoteName, occurrencePath, matchProjectFromOccurrenceName, matchOccurrenceFromOccurrenceName.
    • Workaround: Customers should construct these paths manually (e.g., `projects/${project}/notes/${note}`) or obtain them from the GrafeasClient instance (which can be retrieved via client.getGrafeasClient() at runtime).

@suztomo suztomo requested a review from a team as a code owner June 10, 2026 19:49

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request removes the Grafeas service client and its associated proto files (both v1 and v1beta1) from the google-devtools-containeranalysis package. This includes deleting the corresponding proto definitions, generated clients, samples, path templates, and tests. Additionally, timeout configurations are added to the IAM methods (SetIamPolicy, GetIamPolicy, TestIamPermissions), and metadata is updated in .repo-metadata.json. As there are no review comments provided, I have no additional feedback to offer on these changes.

@suztomo suztomo marked this pull request as draft June 10, 2026 19:53
@suztomo

suztomo commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

https://github.com/googleapis/googleapis/blob/d8daa97972d091191898915589335cef66fcdc8a/google/devtools/containeranalysis/v1/BUILD.bazel#L258

nodejs_gapic_assembly_pkg(
    name = "devtools-containeranalysis-v1-nodejs",
    deps = [
        ":containeranalysis_nodejs_gapic",
        ":containeranalysis_proto",
        ## DO NOT CHANGE: must include Grafeas protos
        "//grafeas/v1:grafeas_proto",

@suztomo

suztomo commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

The grafeas classes are available via the dependency in packages/google-devtools-containeranalysis/package.json: "@google-cloud/grafeas": "^6.0.0"
npm test succeeds in packages/google-devtools-containeranalysis folder.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants