-
Notifications
You must be signed in to change notification settings - Fork 713
claude: add update-seastar-sha skill command #29475
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
Draft
travisdowns
wants to merge
2
commits into
redpanda-data:dev
Choose a base branch
from
travisdowns:td-update-seastar-sha-skill
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+97
−0
Draft
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| --- | ||
| description: Update Seastar SHA to latest commit from v26.1.x branch | ||
| --- | ||
|
|
||
| # Update Seastar SHA | ||
|
|
||
| Update the Seastar dependency in `bazel/repositories.bzl` to the latest commit from the `v26.1.x` branch of the Redpanda Seastar fork, then open a PR. | ||
|
|
||
| ## Instructions | ||
|
|
||
| 1. **Get the latest SHA from the v26.1.x branch** | ||
| ```bash | ||
| gh api repos/redpanda-data/seastar/commits/v26.1.x --jq '.sha' | ||
| ``` | ||
| Store this as `NEW_SHA`. | ||
|
|
||
| 2. **Read the current configuration** | ||
| - Use the Read tool to read `bazel/repositories.bzl` | ||
| - Find the current Seastar SHA in the `strip_prefix` line (format: `seastar-<SHA>`) | ||
| - Store this as `OLD_SHA` | ||
|
|
||
| 3. **Check if update is needed** | ||
| - If `NEW_SHA` equals `OLD_SHA`, inform the user: "Seastar is already at the latest SHA: `<SHA>`" | ||
| - Exit without changes | ||
|
|
||
| 4. **Compute the sha256 hash of the new archive** | ||
| ```bash | ||
| curl -sL "https://github.com/redpanda-data/seastar/archive/<NEW_SHA>.tar.gz" | openssl dgst -sha256 | awk '{print $2}' | ||
| ``` | ||
| Store this as `NEW_HASH`. | ||
|
|
||
| 5. **Update `bazel/repositories.bzl`** | ||
| Use the Edit tool to update the seastar `http_archive` block: | ||
| - Add or update the comment line immediately before `http_archive(` to read: `# branch: v26.1.x` | ||
| - Update `sha256 = "<NEW_HASH>"` | ||
| - Update `strip_prefix = "seastar-<NEW_SHA>"` | ||
| - Update `url = "https://github.com/redpanda-data/seastar/archive/<NEW_SHA>.tar.gz"` | ||
|
|
||
| 6. **Run buildifier to format the file (this also updates MODULE.bazel.lock)** | ||
travisdowns marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ```bash | ||
| bazel run //tools:buildifier.fix | ||
| ``` | ||
|
|
||
| 7. **Build to verify the change** | ||
| ```bash | ||
| bazel build //src/v/base | ||
| ``` | ||
| - If the build fails, revert the changes and report the error to the user | ||
| - Do not proceed with the PR if the build fails | ||
|
|
||
| 8. **Get the list of changes since the old SHA** | ||
| ```bash | ||
| gh api "repos/redpanda-data/seastar/compare/<OLD_SHA>...<NEW_SHA>" --jq '.commits[].commit.message' | head -1 | while read line; do echo "- $line"; done | ||
travisdowns marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
| Or use: | ||
| ```bash | ||
| gh api "repos/redpanda-data/seastar/compare/<OLD_SHA>...<NEW_SHA>" --jq '.commits[] | "- " + (.commit.message | split("\n")[0])' | ||
| ``` | ||
| Store the list of oneline commit messages as `CHANGELOG`. | ||
|
|
||
| 9. **Create a branch and commit** | ||
| - Create branch: `seastar-update-<first 8 chars of NEW_SHA>` | ||
| - Stage both `bazel/repositories.bzl` and `MODULE.bazel.lock` | ||
| - Commit message should be multi-line: | ||
| ``` | ||
| bazel: update seastar to <first 8 chars of NEW_SHA> | ||
| Changes: | ||
| <CHANGELOG> | ||
| ``` | ||
| 10. **Open a PR** | ||
| Use `gh pr create` with: | ||
| - Title: `bazel: update seastar to <first 8 chars of NEW_SHA>` | ||
| - Body should include: | ||
| - Previous SHA (first 12 chars) | ||
| - New SHA (first 12 chars) | ||
| - Link to the commit comparison on GitHub | ||
| 11. **Report success** | ||
| - Print the old and new SHA | ||
| - Print the PR URL | ||
| - Print the GitHub comparison link: `https://github.com/redpanda-data/seastar/compare/<OLD_SHA>...<NEW_SHA>` | ||
| ## Example | ||
| Running `/update-seastar-sha` when there's a new commit: | ||
| ``` | ||
| Updating Seastar SHA... | ||
| Old SHA: 804949ce1b42 | ||
| New SHA: abc123def456 | ||
| Build succeeded. | ||
| PR created: https://github.com/redpanda-data/redpanda/pull/12345 | ||
| Compare changes: https://github.com/redpanda-data/seastar/compare/804949ce1b42...abc123def456 | ||
| ``` | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I first read this I thought things like NEW_SHA were files, and that this was too prescriptive. That is, Claude should perform better with declarative instructions.
But now I'm curious: is this like using a virtual storage location of sorts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure (since claude also wrote this file), but I did test it and it worked. The way I did it was to work though a PR workflow without any skill, then when it worked, got claude to go back and record the steps it uses for next time as a skill.
I know you can actually do direct substitution in these files, like this though this isn't that.
I did find some references that specifically "store this as" will put the value into long term memory, depending on the context (e.g., into MCP's external memory).