Conversation
Filter by whether the URL is under github.com/ActivityWatch/ (case- insensitive) instead of hard-coding a name exclusion list. This ensures newly added third-party submodules are excluded automatically, and prints the excluded set in every job run so the boundary stays visible. Closes ActivityWatch#1456 Follow-up from ActivityWatch#1448 Git-Session-Id: dc09
|
| [ -z "$sm" ] && continue | ||
| url=$(git config -f .gitmodules --get "submodule.$sm.url" 2>/dev/null || true) | ||
| case "${url,,}" in | ||
| *github.com/activitywatch/*) firstparty="${firstparty:+$firstparty }$sm" ;; |
There was a problem hiding this comment.
The glob checks for github.com/activitywatch/ anywhere in the URL instead of verifying the URL's host and organization. An external URL such as https://mirror.example/github.com/ActivityWatch/component.git would therefore be classified as first-party, advanced to its remote tip, and built downstream in jobs carrying the Tauri signing key. Parse or anchor the accepted GitHub URL forms so that only repositories actually hosted under the ActivityWatch organization cross this boundary.
How this was verified: The matched submodule is advanced with --remote, propagated through the SHA output, and checked out and built downstream with the signing key in the job environment.
Knowledge Base Used: Build and distribution
| firstparty=$(git submodule --quiet foreach 'echo $sm_path' | grep -vx awatcher || true) | ||
| while IFS= read -r sm; do | ||
| [ -z "$sm" ] && continue | ||
| url=$(git config -f .gitmodules --get "submodule.$sm.url" 2>/dev/null || true) |
There was a problem hiding this comment.
$sm comes from $sm_path, but .gitmodules is keyed by the submodule section name, which Git permits to differ from its path. For such a submodule, this lookup silently returns an empty URL because errors are suppressed. A first-party component is then reported as third-party and left pinned; if every section name differs from its path, the nightly job fails its empty-list guard. Carry both $name and $sm_path from git submodule foreach, using the name for the configuration lookup and the path for the update.
….gitmodules Two review findings on the URL-based classifier: - The `*github.com/activitywatch/*` glob matched the string anywhere in the URL, so a mirror like `https://mirror.example/github.com/ActivityWatch/x` would classify as first-party and get built with the signing key. Anchor the match against known URL prefixes instead. - `$sm` was populated from `git submodule foreach`'s `$sm_path`, but `.gitmodules` is keyed by submodule *name*, which git permits to differ from path. Read name/path pairs directly from `.gitmodules` instead of reusing the path as the name for the url lookup. Git-Session-Id: 1083368a-3a3e-5b8c-ac1e-c999007d3dc1
|
@greptileai review |
🤖 AI code reviewThe PR replaces the name-based exclusion of the awatcher submodule in the nightly-submodules job with a URL-based classification. It reads submodule name/path pairs from .gitmodules, looks up each URL, and classifies a submodule as first-party only if its URL matches github.com/ActivityWatch/ (case-insensitive). The excluded set is printed to the log, and the empty-list guard is preserved. Safe to merge — no P0/P1 findingsConfidence 5/5
✅ No thread-worthy findings. Advisory notes follow; they are retained without opening review threads. 1 advisory finding (summary-only, not scored)These P2 guard, heuristic, trade-off, or documentation claims are retained for judgment without opening review threads.
This is a How this was verified: static preflight: fix-commit + touched-files scan (rule 7) Files changed (1) — the diff as I read it
Reviewed Maintainer commands
|
Follow-up from #1448, closes #1456.
Change
Replace the name-based exclusion list (
grep -vx awatcher) with a URL-based property check. A submodule is first-party iff its URL is undergithub.com/ActivityWatch/(case-insensitive). This makes the boundary:The logic walks top-level submodule paths and queries
.gitmodulesviagit config -f .gitmodulesfor each URL. All current submodules classify correctly: the 10 ActivityWatch-org ones become first-party;awatcher(github.com/2e3s/awatcher) becomes excluded.Verification
Manual classification check against current
.gitmodules:aw-core,aw-client,aw-server,aw-watcher-afk,aw-qt,aw-watcher-window,aw-server-rust,aw-watcher-input,aw-tauri,aw-notify→ all undergithub.com/ActivityWatch/→ first-party ✓awatcher→github.com/2e3s/awatcher→ excluded ✓The empty-list guard (exits 1 if
$firstpartyis empty) is preserved so the nightly can't silently promote all submodules including third-party if the URL lookup ever fails.