-
Notifications
You must be signed in to change notification settings - Fork 14
Add update-deps Copilot skill #105
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
Changes from 3 commits
03f98eb
7322a83
9e873d9
daca707
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,295 @@ | ||||||
| --- | ||||||
| name: update-deps | ||||||
| description: Keep dependencies up-to-date. Discovers outdated deps via dependabot alerts/PRs, creates one PR per ecosystem, iterates until CI is green, then assigns for review. | ||||||
| user-invocable: true | ||||||
| --- | ||||||
|
|
||||||
| # Update Dependencies | ||||||
|
|
||||||
| Automate the full dependency update lifecycle: discover what's outdated, apply updates grouped by ecosystem, fix breakage, get CI green, and hand off for human review. | ||||||
|
|
||||||
| ## Repository context | ||||||
|
|
||||||
| This is a Rust workspace containing utility crates published to crates.io. All dependency update PRs target the **`main`** branch. | ||||||
|
|
||||||
| Dependabot is configured (`.github/dependabot.yaml`) to open PRs against `main` on the 2nd of each month. This skill gathers individual dependabot PRs, combines updates by ecosystem, fixes any breakage, gets CI green, and creates consolidated PRs for human review. | ||||||
|
|
||||||
| ### Crates in this workspace | ||||||
|
|
||||||
| | Crate | Description | | ||||||
| |---|---| | ||||||
| | **bpe** | Fast byte-pair encoding | | ||||||
| | **bpe-openai** | OpenAI tokenizers built on bpe | | ||||||
| | **geo_filters** | Probabilistic cardinality estimation | | ||||||
| | **string-offsets** | UTF-8/UTF-16/Unicode position conversion (with WASM/JS bindings) | | ||||||
|
tclem marked this conversation as resolved.
|
||||||
|
|
||||||
| Supporting packages (not published): `bpe-tests`, `bpe-benchmarks`. | ||||||
|
|
||||||
| ### Ecosystems in this repo | ||||||
|
|
||||||
| | Ecosystem | Directories | Notes | | ||||||
| |---|---|---| | ||||||
| | **cargo** | `/` (workspace root) | All Rust deps managed at workspace level via `Cargo.lock` | | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit confusing because the dependencies are pinned via the lock file but aren't "managed". That is delegated to the individual crates. Honestly not sure why we even have a workspace at all given these are individually published crates.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the table too: "Deps declared per-crate; Cargo.lock at workspace root pins versions" |
||||||
| | **github-actions** | `.github/workflows/` | CI and publish workflows | | ||||||
| | **npm** | `crates/string-offsets/js/` | JS bindings for string-offsets (WASM) | | ||||||
|
|
||||||
| ### Build and validation commands | ||||||
|
|
||||||
| ```bash | ||||||
| make build # cargo build --all-targets --all-features | ||||||
| make build-js # npm run compile in crates/string-offsets/js | ||||||
| make lint # cargo fmt --check + cargo clippy (deny warnings, forbid unwrap_used) | ||||||
| make test # cargo test + doc tests | ||||||
| ``` | ||||||
|
|
||||||
| CI runs on `ubuntu-latest` with the `mold` linker. The lint job depends on build. | ||||||
|
|
||||||
| ## Workflow | ||||||
|
|
||||||
| ### 1. Assess repo state | ||||||
|
|
||||||
| Determine the repo identity and confirm the target branch. | ||||||
|
|
||||||
| ```bash | ||||||
| git remote get-url origin # extract owner/repo | ||||||
| git fetch origin main | ||||||
| git rev-parse --verify origin/main | ||||||
| ``` | ||||||
|
|
||||||
| Detect which ecosystems have pending updates: | ||||||
|
|
||||||
| ```bash | ||||||
| [ -f Cargo.toml ] && echo "cargo" | ||||||
| ls .github/workflows/*.yml .github/workflows/*.yaml 2>/dev/null && echo "github-actions" | ||||||
| [ -f crates/string-offsets/js/package.json ] && echo "npm" | ||||||
| ``` | ||||||
|
|
||||||
| Report discovered ecosystems to the user. | ||||||
|
|
||||||
| ### 2. Gather dependency intelligence | ||||||
|
|
||||||
| Fetch open dependabot PRs: | ||||||
|
|
||||||
| ```bash | ||||||
| gh pr list --author 'app/dependabot' --base main --state open --json number,title,headRefName,labels --limit 100 | ||||||
| ``` | ||||||
|
|
||||||
| Fetch open dependabot alerts: | ||||||
|
|
||||||
| ```bash | ||||||
| gh api /repos/{owner}/{repo}/dependabot/alerts --jq '[.[] | select(.state=="open") | {number: .number, package: .security_vulnerability.package.name, ecosystem: .security_vulnerability.package.ecosystem, severity: .security_advisory.severity, summary: .security_advisory.summary}]' | ||||||
| ``` | ||||||
|
Comment on lines
+79
to
+81
|
||||||
|
|
||||||
| For ecosystems without dependabot coverage or when running ad-hoc, use native tooling: | ||||||
|
|
||||||
| - **cargo:** `cargo update --dry-run` | ||||||
| - **npm:** `cd crates/string-offsets/js && npm outdated --json` | ||||||
|
||||||
| - **npm:** `cd crates/string-offsets/js && npm outdated --json` | |
| - **npm:** `cd crates/string-offsets/js && npm outdated --json || true` # npm exits non-zero when updates are available |
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.
Does this make sense? Preserve lockfiles -> regenerate lockfiles?
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.
changed to "Regenerate lockfiles."
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.
This isn't true? There are no dependencies in the workspace root.
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.
Good reworded to: "Dependencies are declared per-crate but share a single Cargo.lock at the workspace root."
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 feel like this could cause issues in the future if we add more npm stuff and forget to update here. Not sure what value it adds either? Maybe just let the agent grep?
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.
changed to discover package.json files dynamically instead of hardcoding the path.
Uh oh!
There was an error while loading. Please reload this page.