Skip to content

Commit 9760121

Browse files
committed
add review changes
1 parent be18d6c commit 9760121

5 files changed

Lines changed: 137 additions & 1 deletion

File tree

.agents/skills/track-framework-updates/SKILL.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ If the command fails due to sandbox network restrictions, re-run with broader pe
3636

3737
Override `--since-days` only when the user explicitly requests a different window.
3838

39+
### Step 1b: Check source coverage
40+
41+
Run from the repo root:
42+
43+
```bash
44+
python3 .agents/skills/track-framework-updates/scripts/check_sources.py
45+
```
46+
47+
This compares the `@sentry/*` packages in `packages/` against the `sentryPackages` listed in `sources.json`.
48+
If any public SDK packages are **not** tracked by any framework entry, they will appear in the `untracked` array which should be added to the resulting digest.
49+
3950
### Step 2: Check current SDK support
4051

4152
Run from the repo root:
@@ -108,6 +119,7 @@ Scripts live in `scripts/` and use only Python stdlib + the `gh` CLI.
108119
| `fetch_discussions.py` | GitHub Discussions (GraphQL) + RFC-repo PRs (REST). Links only. |
109120
| `fetch_rss.py` | RSS/Atom feeds via `urllib` + `xml.etree`. |
110121
| `check_support.py` | Reads local `peerDependencies` and lists E2E test apps. |
122+
| `check_sources.py` | Compares `packages/` against `sources.json` to find untracked packages. |
111123
| `_common.py` | Shared: date-window math, `sources.json` loader, `gh` API helpers. |
112124

113125
## Data files

.agents/skills/track-framework-updates/assets/digest-schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@
3535
]
3636
}
3737
],
38+
"untrackedPackages": ["@sentry/foo — SDK packages not covered by sources.json. Empty array if all covered."],
3839
"runNotes": ["Any fetcher errors. Empty array if none."]
3940
}

.agents/skills/track-framework-updates/assets/digest-template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ _Window: last <SINCE_DAYS> days · generated <GENERATED_AT>_
3535
3636
<!-- Same per-framework structure as Client-Side. -->
3737
38+
## Source coverage
39+
40+
⚠ The following SDK packages are **not tracked** in `sources.json`. Add an upstream framework entry or exclude them in `scripts/check_sources.py`:
41+
42+
- `@sentry/<package>`
43+
44+
<!-- Omit this section entirely if all packages are tracked or excluded. -->
45+
3846
## Run notes
3947
4048
- <Framework>: <error message>
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#!/usr/bin/env python3
2+
"""Check that sources.json covers all public @sentry/* packages.
3+
4+
Compares the package names found in packages/*/package.json with the
5+
sentryPackages referenced in sources.json. Prints any public packages
6+
not tracked by any framework entry.
7+
8+
Usage:
9+
check_sources.py # prints JSON array to stdout
10+
11+
Output shape:
12+
["@sentry/foo", ...] (empty array when everything is covered)
13+
"""
14+
15+
from __future__ import annotations
16+
17+
import json
18+
import os
19+
import sys
20+
from typing import Any
21+
22+
from _common import load_frameworks
23+
24+
REPO_ROOT = os.path.dirname(
25+
os.path.dirname(
26+
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
27+
)
28+
)
29+
PACKAGES_DIR = os.path.join(REPO_ROOT, "packages")
30+
31+
EXCLUDED_PACKAGES: set[str] = {
32+
# Internal build/dev tooling — not user-facing SDK packages.
33+
"@sentry-internal/eslint-config-sdk",
34+
"@sentry-internal/eslint-plugin-sdk",
35+
"@sentry-internal/typescript",
36+
"@sentry-internal/integration-shims",
37+
"@sentry-internal/server-utils",
38+
# Internal sub-packages that are part of a larger feature, not standalone SDKs.
39+
"@sentry-internal/browser-utils",
40+
"@sentry-internal/feedback",
41+
"@sentry-internal/replay",
42+
"@sentry-internal/replay-canvas",
43+
"@sentry-internal/replay-worker",
44+
# Core packages — not tied to any upstream framework.
45+
"@sentry/core",
46+
"@sentry/types",
47+
"@sentry/browser",
48+
"@sentry/node",
49+
"@sentry/node-core",
50+
"@sentry/node-native",
51+
"@sentry/opentelemetry",
52+
"@sentry/profiling-node",
53+
"@sentry/wasm",
54+
"@sentry/vercel-edge",
55+
# Platform SDKs without a single upstream framework repo to track.
56+
"@sentry/bun",
57+
"@sentry/deno",
58+
"@sentry/cloudflare",
59+
"@sentry/aws-serverless",
60+
"@sentry/google-cloud-serverless",
61+
}
62+
63+
64+
def _all_package_names() -> set[str]:
65+
"""Read the 'name' field from every packages/*/package.json."""
66+
names: set[str] = set()
67+
if not os.path.isdir(PACKAGES_DIR):
68+
return names
69+
for entry in os.listdir(PACKAGES_DIR):
70+
pkg_json = os.path.join(PACKAGES_DIR, entry, "package.json")
71+
if not os.path.isfile(pkg_json):
72+
continue
73+
with open(pkg_json, "r", encoding="utf-8") as fh:
74+
data = json.load(fh)
75+
name = data.get("name")
76+
if name:
77+
names.add(name)
78+
return names
79+
80+
81+
def _tracked_packages(frameworks: list[dict[str, Any]]) -> set[str]:
82+
"""Collect every sentryPackage referenced in sources.json."""
83+
tracked: set[str] = set()
84+
for fw in frameworks:
85+
for pkg in fw.get("sentryPackages", []):
86+
tracked.add(pkg)
87+
return tracked
88+
89+
90+
def check() -> list[str]:
91+
"""Return sorted list of packages not tracked in sources.json and not excluded."""
92+
all_pkgs = _all_package_names()
93+
tracked = _tracked_packages(load_frameworks())
94+
return sorted(all_pkgs - tracked - EXCLUDED_PACKAGES)
95+
96+
97+
def main() -> None:
98+
untracked = check()
99+
json.dump(untracked, sys.stdout, indent=2)
100+
sys.stdout.write("\n")
101+
if untracked:
102+
print(
103+
f"\n{len(untracked)} package(s) not tracked in sources.json:",
104+
file=sys.stderr,
105+
)
106+
for pkg in untracked:
107+
print(f" - {pkg}", file=sys.stderr)
108+
print(
109+
" Add them to sources.json or to EXCLUDED_PACKAGES in this script.",
110+
file=sys.stderr,
111+
)
112+
113+
114+
if __name__ == "__main__":
115+
main()

.agents/skills/track-framework-updates/scripts/check_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _find_e2e_apps(framework_name: str) -> list[str]:
6161
# Order matters: check specific names before generic ones.
6262
prefix_map: list[tuple[str, list[str]]] = [
6363
("next", ["nextjs-"]),
64-
("sveltekit", ["sveltekit-", "sveltekit-"]),
64+
("sveltekit", ["sveltekit-"]),
6565
("react router", ["react-router-", "create-remix-"]),
6666
("remix", ["react-router-", "create-remix-"]),
6767
("tanstack", ["tanstackstart-", "tanstack-"]),

0 commit comments

Comments
 (0)