Skip to content

Merge push-suxtktroxqux Into main#86

Merged
dclong merged 3 commits into
mainfrom
push-suxtktroxqux
Jun 20, 2026
Merged

Merge push-suxtktroxqux Into main#86
dclong merged 3 commits into
mainfrom
push-suxtktroxqux

Conversation

@dclong

@dclong dclong commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@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 introduces support for managing GitHub secrets at both the repository and organization levels. It adds dependencies on pynacl for encrypting secrets using LibSodium sealed boxes, refactors URL construction to use a centralized URL_API constant, and implements methods to get public keys, create/update secrets, and delete secrets. Feedback on the changes suggests adding a type annotation to the url parameter in _put for type safety, simplifying a multiline f-string in upload_release_asset to improve readability, and adding validation for the visibility and selected_repository_ids parameters in Organization.create_or_update_secret to prevent invalid API requests.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread github_rest_api/github.py Outdated
Comment thread github_rest_api/github.py
Comment thread github_rest_api/github.py
@dclong dclong force-pushed the push-suxtktroxqux branch from f4a77be to 4f67411 Compare June 20, 2026 21:53
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@dclong dclong force-pushed the push-suxtktroxqux branch 2 times, most recently from ee1c83f to 679a2fc Compare June 20, 2026 22:16
@dclong

dclong commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini reveiew

@gemini-code-assist

Copy link
Copy Markdown
Contributor

The implementation for managing GitHub secrets is well-structured and follows the existing patterns in the codebase. The use of pynacl for encryption correctly aligns with GitHub's requirements for secret management. I have a few minor suggestions to improve efficiency and robustness:

1. Caching the Public Key

In create_or_update_secret, the public key is fetched from the API on every call. If you intend to create or update multiple secrets in a single execution, this will result in redundant API calls. You might consider adding an optional public_key parameter or a simple caching mechanism to the Repository and Organization classes.

2. Input Validation

In _encrypt_secret, while the current implementation is correct, you could add a check to ensure the public_key is a valid base64 string before attempting to decode it, which would provide a more descriptive error message if the key is malformed.

3. Type Hinting

In github_rest_api/github.py, the _put method now accepts **kwargs. This is a great improvement for flexibility. Ensure that the docstrings for methods using _put are updated to reflect that additional keyword arguments (like json or params) are supported.

Overall, the code is clean and the addition of the roundtrip test in tests/test_github.py is excellent for verifying the encryption logic.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@dclong dclong force-pushed the push-suxtktroxqux branch from 679a2fc to b3290b1 Compare June 20, 2026 22:57
@dclong

dclong commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini reveiew

@gemini-code-assist

Copy link
Copy Markdown
Contributor

It looks like you're requesting a review of the current pull request. I have reviewed the latest changes, and they look excellent. You have successfully integrated pynacl for secret encryption and added the necessary methods to manage repository and organization secrets. The implementation is robust, and the addition of the roundtrip test in tests/test_github.py provides good verification of the encryption logic. The code is clean, follows the existing patterns, and correctly handles the new functionality. Great work on addressing the requirements.

@dclong dclong merged commit 12b774f into main Jun 20, 2026
8 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.

1 participant