Conversation
|
Hi @wewang58. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
WalkthroughAdds Gemini CLI synchronization: documentation updates in README.md and AGENTS.md, a Makefile target Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (5 passed)
✨ Finishing touches
Comment |
1e4850b to
e6cdab0
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
README.md (2)
40-44: Specify language for code block and address markdown style issues.The fenced code block on line 40 is missing a language specifier, and lines 41-43 use dollar signs without context (per MD014 convention, commands should indicate output or use proper context).
Apply this diff to align with markdown best practices:
-``` +```bash $ mkdir -p ~/.gemini/commands $ git clone git@github.com:openshift-eng/ai-helpers.git -$ cp -r ./ai-helpers/.gemini/commands/* ~/.gemini/commands/ +$ cp -r ./ai-helpers/.gemini/commands/* ~/.gemini/commands/This ensures consistent formatting with the "Using Cursor" section above (which also uses bash code blocks).
37-37: Consider using "can" instead of "is able to".Line 37 uses "is able to find," which can be more concisely expressed as "can find" for better readability.
Apply this diff:
-Gemini cli is able to find the various commands defined in this repo by +Gemini cli can find the various commands defined in this repo by
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
.gemini/commands/jira/solve.toml(1 hunks)README.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md
[style] ~37-~37: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...s ``` ### Using Gemini Cli Gemini cli is able to find the various commands defined in th...
(BE_ABLE_TO)
🪛 markdownlint-cli2 (0.18.1)
README.md
40-40: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
41-41: Dollar signs used before commands without showing output
(MD014, commands-show-output)
42-42: Dollar signs used before commands without showing output
(MD014, commands-show-output)
43-43: Dollar signs used before commands without showing output
(MD014, commands-show-output)
| - The command uses curl to fetch JIRA data via REST API: https://issues.redhat.com/rest/api/2/issue/{$1} | ||
| - Parses JSON response using jq or text processing | ||
| - Extracts key fields: summary, description, components, labels | ||
| - No authentication required for public Red Hat JIRA issues |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, examine the file context around line 23
cat -n .gemini/commands/jira/solve.toml | head -40Repository: openshift-eng/ai-helpers
Length of output: 192
🌐 Web query:
Red Hat JIRA authentication requirements public issues
💡 Result:
Short answer: You do not need a Red Hat account to view and search public issues on Red Hat’s Jira (issues.redhat.com). Some projects/pages are public-read only; actions beyond browsing (creating, commenting, or accessing restricted projects) require a Red Hat Customer Portal / SSO account (or Red Hat employee SSO) and follow Red Hat’s authentication (SSO) rules. (spaces.redhat.com)
Citations:
🏁 Script executed:
#!/bin/bash
# Try to search for JIRA-related files and documentation
rg -i "jira" --type toml --type md -A 3 -B 3 2>/dev/null | head -100Repository: openshift-eng/ai-helpers
Length of output: 192
🌐 Web query:
Red Hat JIRA API authentication required write operations
💡 Result:
Short answer: Yes — any Jira write operation against Red Hat’s Jira (Atlassian Jira) requires an authenticated request. How you authenticate depends on the Jira deployment (Cloud vs Server/Data Center) and the integration type:
What to use
-
Jira Cloud
- Preferred: API token (use email:APIToken as HTTP Basic auth, Base64-encoded in Authorization: Basic ...). Write calls require authenticated requests. [1][2]
- Alternative for user-scoped access: OAuth 2.0 (3LO) or OAuth 2.0 service tokens for app integration — ensure you call the correct cloud/external endpoint (api.atlassian.com/ex/jira//...) when using OAuth. [3][4]
-
Jira Server / Data Center
- Options: Basic auth with username/password (or PAT if enabled), OAuth 1.0(a) application links, or Personal Access Tokens (if your instance supports them). Use the method your admin has enabled. [5]
Implementation notes (common pitfalls)
- Read-only GETs may work anonymously on some endpoints; any create/update/delete requires authentication and appropriate permissions. [1][5]
- For file uploads include the required Jira header X-Atlassian-Token: no-check and authenticate the request. [6]
- If you get “You are not authenticated / Authentication required,” verify: correct auth method for that endpoint (Basic vs OAuth), correct endpoint URL for OAuth tokens, token scope/expiry, and that the authenticating user has permissions. Community guidance and Atlassian docs show Basic+API token is the usual quick fix for write operations on Cloud. [3][4][5]
If you want, tell me: (a) whether your Red Hat Jira is Cloud or Server/DC, and (b) an example request you’re trying — I’ll give the exact curl/headers you need.
Sources:
[1] Jira REST auth docs and examples (python-jira client docs). (jira.readthedocs.io)
[2] Atlassian guidance: use API tokens for Cloud (Basic auth with email:APIToken). (community.atlassian.com)
[3] “Client must be authenticated” and correct api.atlassian.com/ex/jira// URL requirement for OAuth. (community.developer.atlassian.com)
[4] OAuth / OAuth2 integration notes for Jira Server/DC. (confluence.atlassian.com)
[5] Server/DC authentication options and SDK notes (basic, token, oauth). (jira.readthedocs.io)
[6] Attachment upload example requiring X-Atlassian-Token header. (community.atlassian.com)
Citations:
- 1: https://jira.readthedocs.io/api.html?utm_source=openai
- 2: https://community.atlassian.com/forums/Confluence-questions/quot-You-are-not-authenticated-Authentication-required-to/qaq-p/1113833?utm_source=openai
- 3: https://community.developer.atlassian.com/t/error-client-must-be-authenticated-to-access-this-resource/85652?utm_source=openai
- 4: https://confluence.atlassian.com/display/ADMINJIRASERVER0821/Integrating%2Bwith%2BOAuth%2B2.0?utm_source=openai
- 5: https://jira.readthedocs.io/api.html?utm_source=openai
- 6: https://community.atlassian.com/forums/Jira-questions/Attachment-upload-rest-API/qaq-p/1535917?utm_source=openai
Clarify Red Hat JIRA authentication requirements—write operations require credentials.
The statement "No authentication required for public Red Hat JIRA issues" is incomplete and misleading. While read-only access to public issues does not require authentication, any write operations (creating, updating, or closing issues) require authentication via API token, Basic auth, OAuth, or Personal Access Tokens. Since this command's name ("solve.toml") implies resolving/modifying issues, authentication is necessary. Update the documentation to clarify: (1) read-only access does not require authentication, and (2) any modifications require credentials configured via environment variables (e.g., JIRA_TOKEN) or .netrc.
🤖 Prompt for AI Agents
.gemini/commands/jira/solve.toml around line 23: the current note "No
authentication required for public Red Hat JIRA issues" is incomplete and
misleading for a command that implies modifying issues; update the text to state
that read-only access to public issues requires no auth, but any write
operations (create/update/close) require authentication and specify how to
provide credentials (e.g., JIRA API token, Basic auth, OAuth, or Personal Access
Token via environment variables like JIRA_TOKEN or via .netrc); keep the wording
concise and add a short example pointer to where to configure the token.
| - Optional | ||
| - Steps to reproduce (for bugs) | ||
| - Expected vs actual behavior | ||
| - Ask the user for further issue grooming if the requried sections are missing |
There was a problem hiding this comment.
Fix typo: "requried" → "required".
Line 39 contains a spelling error.
Apply this diff:
- - Context
- - Acceptance criteria
- - Optional
- - Steps to reproduce (for bugs)
- - Expected vs actual behavior
- - Ask the user for further issue grooming if the requried sections are missing
+ - Ask the user for further issue grooming if the required sections are missing📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - Ask the user for further issue grooming if the requried sections are missing | |
| - Ask the user for further issue grooming if the required sections are missing |
🤖 Prompt for AI Agents
.gemini/commands/jira/solve.toml around line 39: fix the spelling mistake
"requried" to "required" in the sentence so it reads "Ask the user for further
issue grooming if the required sections are missing"; update only that word and
keep punctuation/spacing unchanged.
| - **You must ensure verification passes** before proceeding to "Commit Creation" | ||
|
|
||
| 4. **Commit Creation**: | ||
| - Create feature branch using the jira-key $1 as the branch name. For example: "git checkout -b fix-{jira-key}" |
There was a problem hiding this comment.
Clarify git branch naming convention.
Line 79 uses fix-{jira-key} as a placeholder, but earlier lines reference $1 for the JIRA issue key. The placeholder is ambiguous—should this be fix-$1 to match the argument variable naming?
Apply this diff for clarity:
- - Create feature branch using the jira-key $1 as the branch name. For example: "git checkout -b fix-{jira-key}"
+ - Create feature branch using the jira-key $1 as the branch name. For example: "git checkout -b fix-$1"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - Create feature branch using the jira-key $1 as the branch name. For example: "git checkout -b fix-{jira-key}" | |
| - Create feature branch using the jira-key $1 as the branch name. For example: "git checkout -b fix-$1" |
🤖 Prompt for AI Agents
.gemini/commands/jira/solve.toml around line 79: the branch name example uses
the ambiguous placeholder "fix-{jira-key}" while the script earlier uses the
positional argument $1 for the JIRA key; update the example to use the same
variable format (e.g., "git checkout -b fix-$1") so the placeholder matches the
script's argument and remove the curly-braced placeholder to avoid confusion.
| - Create pull request with: | ||
| - Clear title referencing JIRA issue as a prefix. For example: "OCPBUGS-12345: ..." | ||
| - The PR description should satisfy the template within .github/PULL_REQUEST_TEMPLATE.md if the file exists | ||
| - The "🤖 Generated with Gemini cli" sentence should include a reference to the slash command that triggered the execution, for example "via /jira-solve OCPBUGS-12345 origin" |
There was a problem hiding this comment.
Fix command reference: "/jira-solve" → "/jira:solve".
Line 106 references the command as /jira-solve, but the correct syntax per the usage examples is /jira:solve (with a colon, not a dash).
Apply this diff:
- - The "🤖 Generated with Gemini cli" sentence should include a reference to the slash command that triggered the execution, for example "via /jira-solve OCPBUGS-12345 origin"
+ - The "🤖 Generated with Gemini cli" sentence should include a reference to the slash command that triggered the execution, for example "via /jira:solve OCPBUGS-12345 origin"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - The "🤖 Generated with Gemini cli" sentence should include a reference to the slash command that triggered the execution, for example "via /jira-solve OCPBUGS-12345 origin" | |
| - The "🤖 Generated with Gemini cli" sentence should include a reference to the slash command that triggered the execution, for example "via /jira:solve OCPBUGS-12345 origin" |
🤖 Prompt for AI Agents
.gemini/commands/jira/solve.toml around line 106: the generated message
references the slash command as "/jira-solve" but the correct command syntax is
"/jira:solve"; update the sentence to use "/jira:solve" (for example "via
/jira:solve OCPBUGS-12345 origin") so the generated footer correctly matches the
slash command that triggers execution.
|
I am concerned about duplicating a bunch of stuff for both Claude and Gemini that are 99% the same except for formatting. Because we enforce a pretty strict style for our Claude commands, it would probably be scriptable or claudeable to have it migrate everything to gemini commands automatically, so you wouldn't need to try to keep 2 copies of the same instructions. WDYT? |
|
/ok-to-test |
|
If you join the github org your PR's will get tested automatically |
e6cdab0 to
8e10b48
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
README.md (1)
35-44: LGTM! Clear documentation for Gemini CLI setup.The new section follows the same pattern as the Cursor integration and provides clear setup instructions.
Optionally, consider this minor style improvement:
-Gemini cli is able to find the various commands defined in this repo by +Gemini cli can find the various commands defined in this repo byscripts/sync_gemini_commands.py (1)
143-170: Consider adding error handling for file operations.The script lacks error handling for file I/O operations. If a markdown file is malformed or cannot be read/written, the script will crash without a helpful error message.
Consider wrapping file operations in try-except blocks:
# Read MD try: with open(md_path, 'r') as f: md_content = f.read() except IOError as e: print(f"Error reading {md_path}: {e}") continue # Convert data = parse_markdown_command(md_content) # Ensure directory exists os.makedirs(dest_dir, exist_ok=True) # Write TOML try: with open(dest_file, 'w') as f: f.write(f'description = """{data["description"]}"""\n\n') f.write(f'prompt = """\n{data["prompt"]}\n"""\n') print(f"Generated {dest_file}") except IOError as e: print(f"Error writing {dest_file}: {e}")
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (4)
AGENTS.md(2 hunks)Makefile(1 hunks)README.md(1 hunks)scripts/sync_gemini_commands.py(1 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile
[warning] 31-31: Missing required phony target "all"
(minphony)
[warning] 31-31: Missing required phony target "clean"
(minphony)
[warning] 31-31: Missing required phony target "test"
(minphony)
🪛 LanguageTool
README.md
[style] ~37-~37: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...s ``` ### Using Gemini Cli Gemini cli is able to find the various commands defined in th...
(BE_ABLE_TO)
🪛 Ruff (0.14.8)
scripts/sync_gemini_commands.py
125-125: Loop control variable dirs not used within loop body
Rename unused dirs to _dirs
(B007)
151-151: Local variable toml_content is assigned to but never used
Remove assignment to unused variable toml_content
(F841)
🔇 Additional comments (7)
scripts/sync_gemini_commands.py (4)
1-5: LGTM! Appropriate imports for the conversion task.
7-44: LGTM! Solid parsing logic with proper error handling.The front matter and section extraction logic correctly handles the Markdown structure with appropriate error handling for YAML parsing.
46-80: LGTM! Well-structured conversion logic.The description extraction and prompt construction appropriately combines the relevant Markdown sections into the Gemini format.
82-88: The "enxebre" → "origin" replacement is intentional and justified—no change needed.The hardcoded replacement on line 88 is not arbitrary or brittle. "enxebre" is a repository owner (listed in OWNERS file) whose username appears in example command usage (
/jira:solve OCPBUGS-12345 enxebre). The replacement converts personal examples to generic ones by substituting with "origin" (a standard git remote reference), which aligns with how command documentation uses "origin" consistently across other files (e.g.,plugins/jira/commands/solve.mdline 23). This is a documented, one-time pattern conversion as part of the Claude-to-Gemini sync, not a fragile generic text replacement.Likely an incorrect or invalid review comment.
Makefile (1)
31-35: LGTM! Clean Makefile target integration.The new
sync-geminitarget follows the existing pattern and provides clear feedback during execution.AGENTS.md (2)
288-310: LGTM! Comprehensive documentation for the Gemini sync workflow.The new section clearly explains when and how to sync Gemini CLI commands, and appropriately emphasizes committing the generated files to keep both formats synchronized.
345-346: LGTM! Appropriate addition to best practices.Adding the Gemini sync step to the best practices checklist ensures developers remember to keep both command formats in sync.
| print(f"Error: {plugins_dir} not found.") | ||
| return | ||
|
|
||
| for root, dirs, files in os.walk(plugins_dir): |
There was a problem hiding this comment.
Remove unused loop variable.
The dirs variable in the os.walk() loop is not used.
Apply this diff:
- for root, dirs, files in os.walk(plugins_dir):
+ for root, _dirs, files in os.walk(plugins_dir):📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for root, dirs, files in os.walk(plugins_dir): | |
| for root, _dirs, files in os.walk(plugins_dir): |
🧰 Tools
🪛 Ruff (0.14.8)
125-125: Loop control variable dirs not used within loop body
Rename unused dirs to _dirs
(B007)
🤖 Prompt for AI Agents
In scripts/sync_gemini_commands.py around line 125, the os.walk loop declares an
unused variable `dirs`; change the loop to use a throwaway name for that element
(e.g., replace `dirs` with `_`) so only `root` and `files` are used, keeping
semantics the same and eliminating the unused variable warning.
| toml_content = { | ||
| "description": data['description'], | ||
| "prompt": data['prompt'] | ||
| } |
There was a problem hiding this comment.
Remove unused variable.
The toml_content dictionary is created but never used. The code manually formats the TOML output on lines 167-168 instead of using this variable.
Apply this diff to remove the unused variable:
- # Prepare TOML content
- toml_content = {
- "description": data['description'],
- "prompt": data['prompt']
- }
-
# Ensure directory exists📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| toml_content = { | |
| "description": data['description'], | |
| "prompt": data['prompt'] | |
| } |
🧰 Tools
🪛 Ruff (0.14.8)
151-151: Local variable toml_content is assigned to but never used
Remove assignment to unused variable toml_content
(F841)
🤖 Prompt for AI Agents
In scripts/sync_gemini_commands.py around lines 151 to 154, remove the unused
toml_content dictionary creation (the toml_content = { "description":
data['description'], "prompt": data['prompt'] }) since the code manually formats
the TOML output later; delete these lines and ensure no other references to
toml_content remain so the later manual formatting at lines ~167-168 remains the
single source of TOML output.
@stbenjam Good idea! how about use "make sync-gemini", so it's simple & flexible, it give options for some people can use it. |
|
@stbenjam Can you help to review my new update? thanks. |
8e10b48 to
47dd474
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wewang58 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 35-44: Update the "Using Gemini Cli" section in README.md: change
the code fence to include a language tag (use "bash"), remove the leading shell
prompt characters ("$") from the three commands so they are plain commands, and
normalize the header capitalization to "Using Gemini CLI" for consistency;
locate the section by the header text "Using Gemini Cli" and update the fenced
block accordingly.
In `@scripts/sync_gemini_commands.py`:
- Around line 117-163: The sync currently only writes/overwrites .toml files but
never removes stale files in gemini_dir, causing orphaned Gemini command files;
update main() to either clear the target directory before regenerating or prune
files not produced: e.g., compute the set of generated dest_file paths while
walking plugins_dir (using plugin_name/command_name logic), then remove any
existing files under gemini_dir that are not in that set (or simpler, if safe,
remove gemini_dir entirely with shutil.rmtree and recreate it before writing).
Ensure you reference and update gems under the existing variables/functions:
plugins_dir, gemini_dir, dest_dir, dest_file, and keep os.makedirs(dest_dir,
exist_ok=True) behavior for generation.
| ### Using Gemini Cli | ||
|
|
||
| Gemini cli is able to find the various commands defined in this repo by | ||
| making it available inside your `~/.gemini/commands` directory. | ||
|
|
||
| ``` | ||
| $ mkdir -p ~/.gemini/commands | ||
| $ git clone git@github.com:openshift-eng/ai-helpers.git | ||
| $ cp -r ./ai-helpers/.gemini/commands/* ~/.gemini/commands/ | ||
| ``` |
There was a problem hiding this comment.
Add language tag and remove shell prompts in the Gemini CLI snippet.
This block trips markdownlint (MD040/MD014). Also consider consistent “CLI” capitalization.
📝 Proposed doc fix
-### Using Gemini Cli
+### Using Gemini CLI
-Gemini cli is able to find the various commands defined in this repo by
+Gemini CLI can find the various commands defined in this repo by
making it available inside your `~/.gemini/commands` directory.
-```
-$ mkdir -p ~/.gemini/commands
-$ git clone git@github.com:openshift-eng/ai-helpers.git
-$ cp -r ./ai-helpers/.gemini/commands/* ~/.gemini/commands/
-```
+```bash
+mkdir -p ~/.gemini/commands
+git clone git@github.com:openshift-eng/ai-helpers.git
+cp -r ./ai-helpers/.gemini/commands/* ~/.gemini/commands/
+```🧰 Tools
🪛 LanguageTool
[style] ~37-~37: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...s ``` ### Using Gemini Cli Gemini cli is able to find the various commands defined in th...
(BE_ABLE_TO)
🪛 markdownlint-cli2 (0.18.1)
40-40: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
41-41: Dollar signs used before commands without showing output
(MD014, commands-show-output)
42-42: Dollar signs used before commands without showing output
(MD014, commands-show-output)
43-43: Dollar signs used before commands without showing output
(MD014, commands-show-output)
🤖 Prompt for AI Agents
In `@README.md` around lines 35 - 44, Update the "Using Gemini Cli" section in
README.md: change the code fence to include a language tag (use "bash"), remove
the leading shell prompt characters ("$") from the three commands so they are
plain commands, and normalize the header capitalization to "Using Gemini CLI"
for consistency; locate the section by the header text "Using Gemini Cli" and
update the fenced block accordingly.
| def main(): | ||
| plugins_dir = "plugins" | ||
| gemini_dir = ".gemini/commands" | ||
|
|
||
| if not os.path.exists(plugins_dir): | ||
| print(f"Error: {plugins_dir} not found.") | ||
| return | ||
|
|
||
| for root, dirs, files in os.walk(plugins_dir): | ||
| for file in files: | ||
| if file.endswith(".md"): | ||
| md_path = os.path.join(root, file) | ||
|
|
||
| # Determine relative path structure | ||
| # plugins/jira/commands/solve.md -> jira/solve.toml | ||
| rel_path = os.path.relpath(md_path, plugins_dir) | ||
| path_parts = rel_path.split(os.sep) | ||
|
|
||
| # We expect plugins/<plugin_name>/commands/<command_name>.md | ||
| if len(path_parts) >= 3 and path_parts[1] == 'commands': | ||
| plugin_name = path_parts[0] | ||
| command_name = os.path.splitext(path_parts[-1])[0] | ||
|
|
||
| dest_dir = os.path.join(gemini_dir, plugin_name) | ||
| dest_file = os.path.join(dest_dir, f"{command_name}.toml") | ||
|
|
||
| # Read MD | ||
| with open(md_path, 'r') as f: | ||
| md_content = f.read() | ||
|
|
||
| # Convert | ||
| data = parse_markdown_command(md_content) | ||
|
|
||
| # Prepare TOML content | ||
| toml_content = { | ||
| "description": data['description'], | ||
| "prompt": data['prompt'] | ||
| } | ||
|
|
||
| # Ensure directory exists | ||
| os.makedirs(dest_dir, exist_ok=True) | ||
|
|
||
| # Write TOML | ||
| with open(dest_file, 'w') as f: | ||
| toml.dump(toml_content, f) | ||
|
|
||
| print(f"Generated {dest_file}") |
There was a problem hiding this comment.
Sync should remove stale Gemini command files.
Right now, deleted/renamed Claude commands leave old .toml files behind, so Gemini commands can drift. Consider clearing the generated directory before regenerating (or pruning files not in the generated set).
🧹 Proposed fix (clear generated outputs)
import os
import re
+import shutil
import toml
import yaml
@@
def main():
plugins_dir = "plugins"
gemini_dir = ".gemini/commands"
@@
if not os.path.exists(plugins_dir):
print(f"Error: {plugins_dir} not found.")
return
+
+ # Fresh sync to avoid stale Gemini commands
+ if os.path.exists(gemini_dir):
+ shutil.rmtree(gemini_dir)
+ os.makedirs(gemini_dir, exist_ok=True)
for root, dirs, files in os.walk(plugins_dir):🧰 Tools
🪛 Ruff (0.14.13)
125-125: Loop control variable dirs not used within loop body
Rename unused dirs to _dirs
(B007)
🤖 Prompt for AI Agents
In `@scripts/sync_gemini_commands.py` around lines 117 - 163, The sync currently
only writes/overwrites .toml files but never removes stale files in gemini_dir,
causing orphaned Gemini command files; update main() to either clear the target
directory before regenerating or prune files not produced: e.g., compute the set
of generated dest_file paths while walking plugins_dir (using
plugin_name/command_name logic), then remove any existing files under gemini_dir
that are not in that set (or simpler, if safe, remove gemini_dir entirely with
shutil.rmtree and recreate it before writing). Ensure you reference and update
gems under the existing variables/functions: plugins_dir, gemini_dir, dest_dir,
dest_file, and keep os.makedirs(dest_dir, exist_ok=True) behavior for
generation.
|
@wewang58 A lot of slash commands refer to Skills (they are mostly think wrappers around skills, telling claude to use the skill). The latest Gemini CLI seems to support skills, could we migrate those too? |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@wewang58: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What this PR does / why we need it:
Automate jira analysis and PR.
/jira:solve OCPBUGS-12345 origin
Which issue(s) this PR fixes:
Special notes for your reviewer:
Add the ai agent for our options
Checklist:
Summary by CodeRabbit
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.