Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update CreateNote.java to use attestations instead of vulnerabilities#10177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lvoelz wants to merge1 commit intoGoogleCloudPlatform:main
base:main
Choose a base branch
Loading
fromlvoelz:main

Conversation

@lvoelz
Copy link

Update custom note creation code samples (as seen inhttps://cloud.google.com/artifact-analysis/docs/create-notes-occurrences#artifact-analysis-create-note-java) to use attestations instead of vulnerabilities, to align with the changes needed for go/aa-deprecate-3p-metadata.

Update custom note creation code samples (as seen inhttps://cloud.google.com/artifact-analysis/docs/create-notes-occurrences#artifact-analysis-create-note-java) to use attestations instead of vulnerabilities, to align with the changes needed for go/aa-deprecate-3p-metadata.
@lvoelzlvoelz requested review froma team andyoshi-approver ascode ownersOctober 8, 2025 17:19
@product-auto-labelproduct-auto-labelbot added samplesIssues that are directly related to samples. api: containeranalysisIssues related to the Container Analysis API. labelsOct 8, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello@lvoelz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates a Java code sample (CreateNote.java) to reflect a change in how notes are created in Artifact Analysis. It switches from using vulnerability-based note creation to attestation-based note creation, aligning with a planned deprecation of third-party metadata.

Highlights

  • Intent: This PR updates theCreateNote.java code sample to use 'attestations' instead of 'vulnerabilities' when creating notes. This change aligns with upcoming deprecations related to third-party metadata in Artifact Analysis (go/aa-deprecate-3p-metadata).
  • Changes: TheCreateNote.java file was modified. Specifically, theNote creation logic was updated to replace thesetVulnerability method call and its associatedVulnerabilityNote builder withsetAttestation and anAttestationNote builder. TheAttestationNote is initialized with aHint containing ahumanReadableName.
  • Reviewer Activity: No specific reviewer activity was provided in the context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on ourdocumentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either/gemini <command> or@gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

FeatureCommandDescription
Code Review/gemini reviewPerforms a code review for the current pull request in its current state.
Pull Request Summary/gemini summaryProvides a summary of the current pull request in its current state.
Comment@gemini-code-assistResponds in comments when explicitly tagged, both in pull request comments and review comments.
Help/gemini helpDisplays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a.gemini/ folder in the base of the repository. Detailed instructions can be foundhere.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on@gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign uphere.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with theGemini Code Assist IDE Extension.

Footnotes

  1. Review thePrivacy Notices,Generative AI Prohibited Use Policy,Terms of Service, and learn how to configure Gemini Code Assist in GitHubhere. Gemini can make mistakes, so double check it anduse code with caution.

@gemini-code-assist
Copy link
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting/gemini review.

@iennae
Copy link
Contributor

/gemini review

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

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 updates theCreateNote.java code sample to useAttestationNote instead ofVulnerabilityNote, which aligns with the stated goal. The code change itself is correct. However, I've noticed that a related code comment was not updated, creating an inconsistency. My review includes a suggestion to fix this for better code clarity.

.setKind(Version.VersionKind.MINIMUM))
.setAffectedVersionEnd(Version.newBuilder()
.setKind(Version.VersionKind.MAXIMUM))))
.setAttestation(AttestationNote.newBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The code has been updated to useAttestationNote, but the comment on the preceding line (43) is now outdated as it still refers to 'vulnerability'. To maintain code clarity and prevent confusion, please update the comment to reflect that an 'attestation' note is being created.

Suggested change for line 43:

// Here, we use the type "attestation"

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

Reviewers

@yoshi-approveryoshi-approverAwaiting requested review from yoshi-approveryoshi-approver is a code owner

1 more reviewer

@gemini-code-assistgemini-code-assist[bot]gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

api: containeranalysisIssues related to the Container Analysis API.samplesIssues that are directly related to samples.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@lvoelz@iennae

[8]ページ先頭

©2009-2025 Movatter.jp