@rtorcato/repo-tooling 3.31.0 → 3.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -964,14 +964,15 @@ review that already exists — `<ARM>` is `code` or `sec`:
|
|
|
964
964
|
|
|
965
965
|
```bash
|
|
966
966
|
ME=$(gh api user --jq .login) # the identity every loop agent posts as
|
|
967
|
+
HEAD=$(gh pr view <N> --json headRefOid --jq .headRefOid)
|
|
967
968
|
VERDICT=$(gh api "repos/$OWNER_REPO/pulls/<N>/reviews" --paginate --slurp \
|
|
968
|
-
| jq -r --arg me "$ME" '[add[]
|
|
969
|
-
| select(.user.login==$me)
|
|
969
|
+
| jq -r --arg me "$ME" --arg head "$HEAD" '[add[]
|
|
970
|
+
| select(.user.login==$me and .commit_id==$head)
|
|
970
971
|
| (.body // "")
|
|
971
972
|
| capture("<!-- ai-issue-loop:verdict:<ARM>:(?<v>[A-Z-]+) -->").v] | last // empty')
|
|
972
973
|
```
|
|
973
974
|
|
|
974
|
-
|
|
975
|
+
Five details there are load-bearing:
|
|
975
976
|
|
|
976
977
|
- **`pulls/<N>/reviews`, because the prompt posts with `gh pr review --comment`.**
|
|
977
978
|
That creates a *review*, which never appears under `issues/<N>/comments`. The
|
|
@@ -993,6 +994,19 @@ Four details there are load-bearing:
|
|
|
993
994
|
count. Login, not `author_association`, because association wobbles with repo
|
|
994
995
|
ownership (an org-owned repo never yields `OWNER`, even for its admins) while
|
|
995
996
|
`gh api user` names exactly who this loop posts as.
|
|
997
|
+
- **The head gate — `.commit_id==$head`, so a verdict expires with the diff it
|
|
998
|
+
read.** Every review carries the commit it was submitted against; ungated, the
|
|
999
|
+
read takes `last` over all of them, so after a fix round the newest marker is
|
|
1000
|
+
still the *pre-fix* one and the tick adopts a verdict about a diff that no
|
|
1001
|
+
longer exists. Both directions bite: a stale `CHANGES` re-applies `ai-changes`
|
|
1002
|
+
for a finding the fix round already resolved, burning a round of two and
|
|
1003
|
+
pushing the PR toward `ai-blocked` over nothing; a stale `PASS` is worse, since
|
|
1004
|
+
it marks a rewritten diff reviewed when nothing read it. Scoped to the head, an
|
|
1005
|
+
older marker reads as absent and that arm re-spawns — which is already the
|
|
1006
|
+
behaviour for an arm that never posted. **This does not cost the #497 recovery
|
|
1007
|
+
case** the read exists for: a reviewer that died between posting and labelling
|
|
1008
|
+
posted against the head that is still current, so its marker still matches.
|
|
1009
|
+
Only genuinely stale markers stop matching, which is the point.
|
|
996
1010
|
- **`(.body // "")` and `// empty`.** A review can have a null body, which
|
|
997
1011
|
`capture` throws on, aborting the whole filter; and `jq -r` prints a missing
|
|
998
1012
|
value as the literal string `null`, which is not empty and would read as a
|