Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🗝️ #1172

Merged
merged 1 commit into from
Mar 4, 2025
Merged

🗝️ #1172

merged 1 commit into from
Mar 4, 2025

Conversation

vorburger
Copy link
Member

Relates to #254.

Copy link
Contributor

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

Choose a reason for hiding this comment

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

Hello @vorburger, 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!

Summary of Changes

This pull request addresses issue #254 and focuses on configuring the Bazel Steward workflow. The changes involve modifying the workflow's permissions, adding a condition to prevent execution in forks, and setting the github-personal-token using a secret.

Highlights

  • Permissions: The pull-requests: write permission has been removed from the Bazel Steward workflow, likely due to security concerns as noted in the comments.
  • Fork Prevention: A condition has been added to prevent the workflow from running on forks of the repository, enhancing security.
  • Token Configuration: The github-personal-token is now configured using the secrets.BAZEL_STEWARD secret, improving security and maintainability.

Changelog

  • .github/workflows/bazel-steward.yaml
    • Removed pull-requests: write permission.
    • Added a condition to prevent workflow execution on forks.
    • Configured github-personal-token using secrets.BAZEL_STEWARD.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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


Did you know?

Bazel is named after a fictional character from Isaac Asimov's Foundation series, specifically Hari Seldon's home planet of Helicon, whose capital city is Terminus, and Terminus's encyclopedia is called the Encyclopedia Galactica. Bazel is a play on the word 'bezel', which is the frame that holds a gemstone in place.

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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot 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 the Bazel Steward workflow. The changes include removing the pull-requests: write permission, adding a condition to prevent the workflow from running on forks, and configuring the github-personal-token with a secret. These changes seem reasonable for improving security and controlling workflow execution.

Summary of Findings

  • Hardcoded repository name: The workflow uses a hardcoded repository name to prevent execution on forks. While this achieves the desired effect, it might be better to use a more generic approach that doesn't require modification when the repository name changes.
  • TODO comment: The update.bash script contains a TODO comment related to committing changes. It would be beneficial to implement this step to fully automate the update process.

Merge Readiness

The pull request appears to be in good shape for merging. The changes address security concerns and improve workflow control. However, consider addressing the hardcoded repository name and the TODO comment in update.bash for further improvement. I am unable to directly approve the pull request, and recommend that others review and approve this code before merging.

@@ -40,5 +46,5 @@ jobs:
# NB: Cannot use hash instead of version here due to
# https://github.com/VirtusLab/bazel-steward/issues/414.
with:
# github-personal-token: 'TODO'
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The TODO comment has been removed and replaced with a secret. Ensure that the BAZEL_STEWARD secret is properly configured in the repository settings.

Comment on lines +22 to +24
contents: write # OK!
# See https://github.com/VirtusLab/bazel-steward/issues/420:
# NOK: pull-requests: write
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change removes the pull-requests: write permission. Can you elaborate on the security implications and why this permission is no longer needed?

# #restrictions-on-repository-forks
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
# if: github.event.pull_request.head.repo.full_name == github.repository
if: github.repository == 'enola-dev/enola' # Don't do this in forks
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This condition prevents the workflow from running on forks. While this is a valid approach, consider using github.event.pull_request.head.repo.full_name == github.repository for a more robust solution that automatically adapts to repository name changes. This would avoid hardcoding the repository name.

if: github.event.pull_request.head.repo.full_name == github.repository

@vorburger vorburger merged commit 7f04b15 into enola-dev:main Mar 4, 2025
7 checks passed
@vorburger vorburger deleted the bazel-steward6 branch March 4, 2025 01:09
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.

1 participant