chore(skills): add create-release skill#1909
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1909 +/- ##
==========================================
+ Coverage 71.62% 71.73% +0.11%
==========================================
Files 432 434 +2
Lines 69183 69954 +771
==========================================
+ Hits 49554 50184 +630
- Misses 19629 19770 +141
🚀 New features to boost your workflow:
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: fbbbe00 | Docs | Datadog PR Page | Give us feedback! |
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
Aaalibaba42
left a comment
There was a problem hiding this comment.
I'm generally uncomfortable with letting AI use git. Why can't this be a script instead of a skill ? Is there some non-deterministic / hard to anticipate aspects ? This looks pretty straight forward
|
|
||
| ```bash | ||
| git fetch origin main | ||
| git checkout -b release/v<version> origin/main |
There was a problem hiding this comment.
I think git switch -c is prefered
There was a problem hiding this comment.
I never did the switch to switch 😄
|
It can be a script, I think the skill helps with discoverability since you don't have to know it exist for claude to use it. I can make it a script and have a skill to make the script discoverable. |
| # Rules are evaluated in order. Later matches override earlier ones. | ||
| # More specific patterns at the bottom override general patterns above. | ||
|
|
||
| .claude/ @DataDog/libdatadog-core |
There was a problem hiding this comment.
should this be apm-common-components-core?
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| fi | ||
|
|
||
| REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| cd "$REPO_ROOT" |
There was a problem hiding this comment.
mmh since we have access to git, don't we want to use git rev-parse --show-toplevel ?
| git push -u origin "${BRANCH}" | ||
|
|
||
| echo "==> Creating draft PR" | ||
| gh pr create \ |
There was a problem hiding this comment.
We might want to start the script with a if [ ! -x "$(which gh)" ]; then echo "gh not installed or couldn't be found"; exit 1; fi or something like this
There was a problem hiding this comment.
I think gh is typically available on dd laptops, but good call. Better to fail fast.
| python3 - "$VERSION" <<'PY' | ||
| import re, sys, pathlib | ||
| version = sys.argv[1] | ||
| path = pathlib.Path("Cargo.toml") | ||
| text = path.read_text() | ||
|
|
||
| pattern = re.compile( | ||
| r'(\[workspace\.package\][^\[]*?\nversion\s*=\s*")[^"]*(")', | ||
| re.DOTALL, | ||
| ) | ||
| new_text, n = pattern.subn(rf'\g<1>{version}\g<2>', text, count=1) | ||
| if n != 1: | ||
| sys.exit("Error: could not locate version field in [workspace.package]") | ||
| path.write_text(new_text) | ||
| PY |
There was a problem hiding this comment.
That looks like a sed thing
There was a problem hiding this comment.
Yes, but I believe there are minor differences with sed on mac and linux, so you'd just have to account for that. This might do what you need?
sed -i.bak '/\[workspace\.package\]/,/^\[/{s/^version = ".*"/version = "'"${VERSION}"'"/;}' Cargo.toml
There was a problem hiding this comment.
@Aaalibaba42's suggestions are good. LGTM after you apply them. I think you also have to assign the script a codeowner and add license headers.
What does this PR do?
Add a claude skill to create a new release
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
How to test the change?
Describe here in detail how the change can be validated.