sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.8k stars 304 forks source link

Fetch standard prompts from remote prompts API #6150

Closed vovakulikov closed 5 days ago

vovakulikov commented 1 week ago

Part of SRCH-1181

This PR checks the SG version and tries to fetch built-in prompts from the prompt library rather than using local hardcoded commands. Later prompts query will be unified and all custom/built-in prompts will be fetched with one query

Test plan

sourcegraph-release-bot commented 5 days ago

The backport to v1.46.x failed at https://github.com/sourcegraph/cody/actions/runs/11940463989:

The process '/usr/bin/git' failed with exit code 128

To backport this PR manually, you can either:

Via the sg tool Use the `sg backport` command to backport your commit to the release branch. ```bash sg backport -r v1.46.x -p 6150 ```
Via your terminal To backport manually, run these commands in your terminal: ```bash # Fetch latest updates from GitHub git fetch # Create a new working tree git worktree add .worktrees/backport-v1.46.x v1.46.x # Navigate to the new working tree cd .worktrees/backport-v1.46.x # Create a new branch git switch --create backport-6150-to-v1.46.x # Cherry-pick the merged commit of this pull request and resolve the conflicts git cherry-pick -x --mainline 1 224ef27ccec297988b45fb0f769188ef4fb6ab1b # Push it to GitHub git push --set-upstream origin backport-6150-to-v1.46.x # Go back to the original working tree cd ../.. # Delete the working tree git worktree remove .worktrees/backport-v1.46.x ``` If you encouter conflict, first resolve the conflict and stage all files, then run the commands below: ```bash git cherry-pick --continue # Push it to GitHub git push --set-upstream origin backport-6150-to-v1.46.x # Go back to the original working tree cd ../.. # Delete the working tree git worktree remove .worktrees/backport-v1.46.x ``` - [ ] Follow above instructions to backport the commit. - [ ] Create a pull request where the `base` branch is `v1.46.x` and the `compare`/`head` branch is `backport-6150-to-v1.46.x`., [click here to create the pull request](https://github.com/sourcegraph/sourcegraph/compare/v1.46.x...backport-6150-to-v1.46.x?expand=1).

Once the pull request has been created, please ensure the following:

sourcegraph-release-bot commented 5 days ago

The backport to vscode-v1.46.x failed at https://github.com/sourcegraph/cody/actions/runs/11941446594:

Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the sourcegraph/cody repository.

To backport this PR manually, you can either:

Via the sg tool Use the `sg backport` command to backport your commit to the release branch. ```bash sg backport -r vscode-v1.46.x -p 6150 ```
Via your terminal To backport manually, run these commands in your terminal: ```bash # Fetch latest updates from GitHub git fetch # Create a new working tree git worktree add .worktrees/backport-vscode-v1.46.x vscode-v1.46.x # Navigate to the new working tree cd .worktrees/backport-vscode-v1.46.x # Create a new branch git switch --create backport-6150-to-vscode-v1.46.x # Cherry-pick the merged commit of this pull request and resolve the conflicts git cherry-pick -x --mainline 1 224ef27ccec297988b45fb0f769188ef4fb6ab1b # Push it to GitHub git push --set-upstream origin backport-6150-to-vscode-v1.46.x # Go back to the original working tree cd ../.. # Delete the working tree git worktree remove .worktrees/backport-vscode-v1.46.x ``` If you encouter conflict, first resolve the conflict and stage all files, then run the commands below: ```bash git cherry-pick --continue # Push it to GitHub git push --set-upstream origin backport-6150-to-vscode-v1.46.x # Go back to the original working tree cd ../.. # Delete the working tree git worktree remove .worktrees/backport-vscode-v1.46.x ``` - [ ] Follow above instructions to backport the commit. - [ ] Create a pull request where the `base` branch is `vscode-v1.46.x` and the `compare`/`head` branch is `backport-6150-to-vscode-v1.46.x`., [click here to create the pull request](https://github.com/sourcegraph/sourcegraph/compare/vscode-v1.46.x...backport-6150-to-vscode-v1.46.x?expand=1).

Once the pull request has been created, please ensure the following: