Repository navigation
fix: COPILOT_INSTRUCTIONS example drops kubectl get subcommand - #2642
Closed
amitmishra11 wants to merge 2 commits into
Closed
amitmishra11 wants to merge 2 commits into
amitmishra11 wants to merge 2 commits into
Conversation
The mapping example table mapped "kubectl get pods" to "rtk kubectl pods", silently dropping the "get" subcommand. This mirrors the actual rewrite rule in src/discover/rules.rs (rtk_cmd: "rtk kubectl"), which preserves the subcommand correctly — only the doc example was wrong. Fixes rtk-ai#2471
…UCTIONS Pins the exact "kubectl get pods -> rtk kubectl get pods" mapping and asserts the buggy "rtk kubectl pods" string is absent, so a future edit to the example table can't silently reintroduce rtk-ai#2471.
1 of 2 tasks
Collaborator
|
Thank you for the contribution. Unfortunately, #2472 fixed the issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
COPILOT_INSTRUCTIONStemplate generated byrtk initfor GitHub Copilot mappedkubectl get pods→rtk kubectl pods, silently dropping thegetsubcommand.src/discover/rules.rs,rtk_cmd: "rtk kubectl") correctly preserves subcommands viastrip_word_prefix— only this doc example insrc/hooks/init.rswas wrong, so users following the example would run an incorrect command.Change
src/hooks/init.rs:kubectl get pods rtk kubectl pods→kubectl get pods rtk kubectl get podstest_copilot_instructions_kubectl_example_preserves_subcommand: pins the correct mapping string and asserts the buggyrtk kubectl podsstring is absent fromCOPILOT_INSTRUCTIONS, so this can't silently regress.Test plan
src/hooks/init.rs) following the existing test style in this file (plain&str::containsassertions against the const, same pattern astest_init_mentions_all_top_level_commands).docker ps, are correct).test_init_mentions_all_top_level_commandsasserts againstRTK_INSTRUCTIONS(a separate const), notCOPILOT_INSTRUCTIONS, so it's unaffected by this change.cargo test— could not run locally: my sandbox has a 32-bit MinGW only and no MSVC Build Tools / working 64-bit linker (tried MSVC toolchain 1.91 —link.exe not found/wronglink.exepicked up from PATH; tried GNU toolchain 1.91 —dlltool32-bit/64-bit bfd-target mismatch). Didn't want to install VS Build Tools without checking first. Would appreciate CI confirming, or happy to address review feedback if the test needs adjusting.