Skip to content

Check copyright - #230

Merged
Syspretor merged 3 commits into
sgl-project:mainfrom
cheyang:check_copyright
Mar 23, 2026
Merged

Syspretor merged 3 commits into
sgl-project:mainfrom
cheyang:check_copyright

Conversation

@cheyang

@cheyang cheyang commented Mar 21, 2026

Copy link
Copy Markdown
Collaborator

Ⅰ. Motivation

Ⅱ. Modifications

Ⅲ. Does this pull request fix one issue?

fixes #XXXX

Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅴ. Describe how to verify it

VI. Special notes for reviews

Checklist

  • Format your code make fmt.
  • Add unit tests or integration tests.
  • Update the documentation related to the change.

Copilot AI review requested due to automatic review settings March 21, 2026 12:21
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, 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 introduces automated tooling and updated documentation to ensure all Go source files within the repository adhere to the Apache 2.0 copyright header standard. It provides developers with new make commands to easily check for missing headers and automatically add them, thereby streamlining compliance with licensing requirements and maintaining consistency across the codebase.

Highlights

  • Automated Copyright Header Management: New shell scripts (add-copyright-to-pr-go-files.sh and check-copyright-on-pr-go-files.sh) were introduced to automate the management of Apache 2.0 copyright headers in Go files.
  • Makefile Integration: New copyright-check and copyright-fix targets were added to the Makefile, providing convenient commands for developers to verify and apply copyright headers.
  • Documentation Updates: The CONTRIBUTING.md and README.md files were updated to inform contributors about the new copyright header requirement for Go files and how to utilize the new make commands.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/copyright-check.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation 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.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays 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 found here.

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 up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

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

Copy link
Copy Markdown

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 introduces helpful tooling for checking and adding copyright headers to Go files, along with corresponding documentation updates. The changes are well-structured. My review provides suggestions to improve the robustness of the argument parsing in the new shell scripts to make them more user-friendly.

Comment thread tools/add-copyright-to-pr-go-files.sh
Comment thread tools/check-copyright-on-pr-go-files.sh

Copilot AI 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.

Pull request overview

Adds tooling and CI to ensure changed Go files in PRs include a standard Apache 2.0 copyright header, plus make targets and docs pointing contributors to the workflow.

Changes:

  • Add scripts to check/fix copyright headers on Go files changed against a base ref.
  • Add Makefile targets and contributor docs for running the checks locally.
  • Add a GitHub Actions workflow to run the check on PRs and pushes to main.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/check-copyright-on-pr-go-files.sh New script to detect missing headers in changed Go files.
tools/add-copyright-to-pr-go-files.sh New script to automatically insert the Apache 2.0 header into changed Go files.
Makefile Adds make copyright-check / make copyright-fix targets.
.github/workflows/copyright-check.yml Adds CI job to run the header check on PRs/pushes.
README.md Documents the new make targets for contributors.
CONTRIBUTING.md Adds guidance for Go PRs to run/check/fix headers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/add-copyright-to-pr-go-files.sh
Comment thread tools/check-copyright-on-pr-go-files.sh
Comment thread tools/check-copyright-on-pr-go-files.sh
Comment thread Makefile
@Syspretor
Syspretor merged commit 2fe2c81 into sgl-project:main Mar 23, 2026
13 checks passed
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.

3 participants