@codyswann/lisa 4.99.9 → 4.99.10
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/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +16 -8
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-evidence/SKILL.md +3 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-journey/scripts/generate-templates.py +4 -1
- package/plugins/lisa/skills/lisa-jira-evidence/SKILL.md +3 -1
- package/plugins/lisa/skills/lisa-jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa/skills/lisa-jira-journey/scripts/generate-templates.py +4 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-agy/skills/lisa-jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-agy/skills/lisa-jira-journey/scripts/generate-templates.py +4 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/skills/lisa-jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-copilot/skills/lisa-jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-copilot/skills/lisa-jira-journey/scripts/generate-templates.py +4 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-cursor/skills/lisa-jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-cursor/skills/lisa-jira-journey/scripts/generate-templates.py +4 -1
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/skills/lisa-jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-devin/skills/lisa-jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-devin/skills/lisa-jira-journey/scripts/generate-templates.py +4 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/skills/jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-expo/.codex-plugin/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-expo/.codex-plugin/skills/jira-journey/scripts/generate-templates.py +11 -5
- package/plugins/lisa-expo/skills/jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-expo/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-expo/skills/jira-journey/scripts/generate-templates.py +11 -5
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-agy/skills/jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-expo-agy/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-expo-agy/skills/jira-journey/scripts/generate-templates.py +11 -5
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/skills/jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-expo-copilot/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-expo-copilot/skills/jira-journey/scripts/generate-templates.py +11 -5
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/skills/jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-expo-cursor/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-expo-cursor/skills/jira-journey/scripts/generate-templates.py +11 -5
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/skills/jira-evidence/SKILL.md +3 -1
- package/plugins/lisa-expo-devin/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-expo-devin/skills/jira-journey/scripts/generate-templates.py +11 -5
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/skills/jira-evidence/SKILL.md +2 -1
- package/plugins/lisa-rails/.codex-plugin/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-rails/skills/jira-evidence/SKILL.md +2 -1
- package/plugins/lisa-rails/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-agy/skills/jira-evidence/SKILL.md +2 -1
- package/plugins/lisa-rails-agy/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/skills/jira-evidence/SKILL.md +2 -1
- package/plugins/lisa-rails-copilot/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/skills/jira-evidence/SKILL.md +2 -1
- package/plugins/lisa-rails-cursor/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/skills/jira-evidence/SKILL.md +2 -1
- package/plugins/lisa-rails-devin/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/skills/lisa-jira-evidence/SKILL.md +3 -1
- package/plugins/src/base/skills/lisa-jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/src/base/skills/lisa-jira-journey/scripts/generate-templates.py +4 -1
- package/plugins/src/expo/skills/jira-evidence/SKILL.md +3 -1
- package/plugins/src/expo/skills/jira-evidence/scripts/post-evidence.sh +87 -8
- package/plugins/src/expo/skills/jira-journey/scripts/generate-templates.py +11 -5
- package/plugins/src/rails/skills/jira-evidence/SKILL.md +2 -1
- package/plugins/src/rails/skills/jira-evidence/scripts/post-evidence.sh +87 -8
package/package.json
CHANGED
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
"qs": "^6.16.0"
|
|
197
197
|
},
|
|
198
198
|
"name": "@codyswann/lisa",
|
|
199
|
-
"version": "4.99.
|
|
199
|
+
"version": "4.99.10",
|
|
200
200
|
"description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
|
|
201
201
|
"main": "dist/index.js",
|
|
202
202
|
"exports": {
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
"test": "tests"
|
|
360
360
|
},
|
|
361
361
|
"types": "./dist/index.d.ts",
|
|
362
|
-
"lisaReleaseCommit": "
|
|
363
|
-
"gitHead": "
|
|
364
|
-
"lisaReleaseTag": "v4.99.
|
|
362
|
+
"lisaReleaseCommit": "968e6fd2e432786e279471fb05523490dc97bbbb",
|
|
363
|
+
"gitHead": "968e6fd2e432786e279471fb05523490dc97bbbb",
|
|
364
|
+
"lisaReleaseTag": "v4.99.10"
|
|
365
365
|
}
|
|
@@ -83,7 +83,7 @@ export LISA_EVIDENCE_RELEASE=$(node scripts/lisa-work-item.mjs evidence-release
|
|
|
83
83
|
## What It Does
|
|
84
84
|
|
|
85
85
|
1. **Read JIRA config** — Resolves the jira-cli config (`$PROJECT_DIR/.lisa/jira-cli/.config.yml` first, then `~/.config/.jira/.config.yml`, announcing the fallback) and reads `server` and `login` from it dynamically — no hardcoded values. Exits 1 naming both paths when neither exists. The same resolved path is then passed to `jira issue move` as `--config`, so the CLI cannot end up on a different config than the one this script parsed.
|
|
86
|
-
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** —
|
|
86
|
+
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** — Validates `PR_NUMBER` as a positive integer, uploads each evidence file as `pr-<PR_NUMBER>-<file>` via `gh release upload --clobber`, then lists the release and exits 1 naming any uploaded asset that is missing. Before uploading it refuses an evidence name outside `NN-name.(png|txt|json)` with letters, digits, `.`, `_` and `-` only (GitHub rewrites other characters in asset names), and before editing the description it exits 1 naming any Markdown link or image target in `comment.md` (inline, titled, `<url>`-bracketed or a reference definition such as `[ref]: url`) that points into that release but is not `pr-<PR_NUMBER>-…` or was not uploaded by this run (a stale asset from an earlier run does not count; release URLs quoted as plain text in inlined evidence are ignored). `--clobber` therefore only ever replaces this pull request's own earlier upload.
|
|
87
87
|
3. **Update PR description** — Replaces or appends the `## Evidence` section in the PR body
|
|
88
88
|
4. **Post JIRA comment** — Posts `comment.txt` as a new comment (wiki markup with code blocks)
|
|
89
89
|
5. **Move ticket to the configured review status** — Transitions the JIRA ticket to `$REVIEW` (default: `Code Review`).
|
|
@@ -101,6 +101,8 @@ evidence/
|
|
|
101
101
|
comment.md used for PR description
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
+
Local evidence files keep their `NN-` names. In the shared evidence release each one is stored as `pr-<number>-<file>` (for PR 42, `01-health-check.json` becomes `pr-42-01-health-check.json`), so two pull requests with a same-named file never overwrite each other's evidence. `generate-templates.py` links that scoped name.
|
|
105
|
+
|
|
104
106
|
## Troubleshooting
|
|
105
107
|
|
|
106
108
|
### Evidence not appearing in GitHub PR
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
#
|
|
16
16
|
# What it does:
|
|
17
17
|
# 1. Uploads evidence files to the configured GitHub evidence release
|
|
18
|
-
# (default 'pr-assets'; see verification.completion.evidenceRelease)
|
|
18
|
+
# (default 'pr-assets'; see verification.completion.evidenceRelease) as
|
|
19
|
+
# pr-<PR_NUMBER>-<file>, then confirms every one is listed there
|
|
19
20
|
# 2. Updates the GitHub PR description with evidence/comment.md
|
|
20
21
|
# 3. Uploads image evidence as JIRA attachments
|
|
21
22
|
# 4. Posts/updates the JIRA comment with evidence/comment.txt
|
|
@@ -28,6 +29,14 @@ TICKET_ID="${1:?Usage: post-evidence.sh <TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>}"
|
|
|
28
29
|
EVIDENCE_DIR="${2:?Usage: post-evidence.sh <TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>}"
|
|
29
30
|
PR_NUMBER="${3:?Usage: post-evidence.sh <TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>}"
|
|
30
31
|
|
|
32
|
+
# Every release asset is named pr-${PR_NUMBER}-<file>, so the number must be a
|
|
33
|
+
# canonical positive integer before anything is uploaded: an empty, signed or
|
|
34
|
+
# padded value would produce a name another pull request could also produce.
|
|
35
|
+
if [[ ! "$PR_NUMBER" =~ ^[1-9][0-9]*$ ]]; then
|
|
36
|
+
echo "ERROR: PR_NUMBER must be a positive integer, got '$PR_NUMBER'" >&2
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
31
40
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
32
41
|
# CONFIG RESOLUTION
|
|
33
42
|
#
|
|
@@ -153,6 +162,26 @@ fi
|
|
|
153
162
|
|
|
154
163
|
echo "Found ${#SCREENSHOTS[@]} screenshots and ${#TEXT_EVIDENCE[@]} text evidence files to upload"
|
|
155
164
|
|
|
165
|
+
# GitHub rewrites special characters (spaces, brackets, non-ASCII) in release
|
|
166
|
+
# asset names, so a link built from the local name would point at an asset that
|
|
167
|
+
# does not exist under that name. Refuse such names before anything is uploaded.
|
|
168
|
+
for FILE in "${ALL_EVIDENCE[@]}"; do
|
|
169
|
+
if [[ ! "$(basename "$FILE")" =~ ^[0-9]{2}-[A-Za-z0-9._-]+\.(png|txt|json)$ ]]; then
|
|
170
|
+
echo "ERROR: evidence file name '$(basename "$FILE")' is not release-safe." >&2
|
|
171
|
+
echo " Rename it to NN-name.ext using only letters, digits, '.', '_' and '-'" >&2
|
|
172
|
+
echo " (e.g. '01-search step.png' -> '01-search-step.png'), then re-run generate-templates.py." >&2
|
|
173
|
+
exit 1
|
|
174
|
+
fi
|
|
175
|
+
done
|
|
176
|
+
|
|
177
|
+
# The description is checked against the release after uploading, so it must
|
|
178
|
+
# exist before anything is uploaded.
|
|
179
|
+
COMMENT_MD="$EVIDENCE_DIR/comment.md"
|
|
180
|
+
if [[ ! -f "$COMMENT_MD" ]]; then
|
|
181
|
+
echo "ERROR: $COMMENT_MD not found — run generate-templates.py first" >&2
|
|
182
|
+
exit 1
|
|
183
|
+
fi
|
|
184
|
+
|
|
156
185
|
# Compute JIRA auth early (used in steps 3 and 4)
|
|
157
186
|
JIRA_AUTH=$(printf '%s' "$JIRA_USER:$JIRA_API_TOKEN" | base64 | tr -d '\n')
|
|
158
187
|
|
|
@@ -160,21 +189,71 @@ JIRA_AUTH=$(printf '%s' "$JIRA_USER:$JIRA_API_TOKEN" | base64 | tr -d '\n')
|
|
|
160
189
|
echo ""
|
|
161
190
|
echo "==> Uploading to GitHub release '$RELEASE_TAG'..."
|
|
162
191
|
|
|
192
|
+
# Every pull request shares this one release, and --clobber deletes a
|
|
193
|
+
# same-named asset before uploading. Bare NN- names collided across pull
|
|
194
|
+
# requests, so a later upload destroyed an earlier one's evidence
|
|
195
|
+
# (CodySwannGT/lisa#4639). Each asset is therefore uploaded as
|
|
196
|
+
# pr-${PR_NUMBER}-<file>: --clobber can then replace only this pull request's
|
|
197
|
+
# own earlier upload. Local evidence files keep their NN- names; the scoped
|
|
198
|
+
# copies live in a private directory removed on exit.
|
|
199
|
+
UPLOAD_DIR=$(mktemp -d)
|
|
200
|
+
trap 'rm -rf "$UPLOAD_DIR"' EXIT
|
|
201
|
+
UPLOADED_ASSETS=()
|
|
163
202
|
for FILE in "${ALL_EVIDENCE[@]}"; do
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
203
|
+
ASSET_NAME="pr-${PR_NUMBER}-$(basename "$FILE")"
|
|
204
|
+
cp "$FILE" "$UPLOAD_DIR/$ASSET_NAME"
|
|
205
|
+
echo " ↑ $ASSET_NAME"
|
|
206
|
+
gh release upload "$RELEASE_TAG" "$UPLOAD_DIR/$ASSET_NAME" --repo "$GH_REPO" --clobber
|
|
207
|
+
UPLOADED_ASSETS+=("$ASSET_NAME")
|
|
167
208
|
done
|
|
168
209
|
|
|
210
|
+
# The description links these names, so confirm each one is really in the
|
|
211
|
+
# release before pointing anything at it.
|
|
212
|
+
RELEASE_ASSETS=$(gh release view "$RELEASE_TAG" --repo "$GH_REPO" --json assets --jq '.assets[].name')
|
|
213
|
+
MISSING_ASSETS=0
|
|
214
|
+
for ASSET_NAME in "${UPLOADED_ASSETS[@]}"; do
|
|
215
|
+
if ! grep -qxF "$ASSET_NAME" <<< "$RELEASE_ASSETS"; then
|
|
216
|
+
echo "ERROR: $ASSET_NAME is missing from release '$RELEASE_TAG' after upload" >&2
|
|
217
|
+
MISSING_ASSETS=1
|
|
218
|
+
fi
|
|
219
|
+
done
|
|
220
|
+
if [[ $MISSING_ASSETS -ne 0 ]]; then
|
|
221
|
+
exit 1
|
|
222
|
+
fi
|
|
223
|
+
|
|
169
224
|
echo " ✓ GitHub release assets uploaded"
|
|
170
225
|
|
|
171
|
-
#
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
226
|
+
# Every Markdown link or image target that points into the release must name
|
|
227
|
+
# an asset THIS run uploaded, and therefore one the check above just found in
|
|
228
|
+
# the release. A bare or other-PR name would show some other pull request's
|
|
229
|
+
# evidence, and a pr-<n>- asset left over from an earlier run would show
|
|
230
|
+
# evidence this run did not produce. Every Markdown target form counts:
|
|
231
|
+
# inline ](url) ](url "title") ](<url>) ](<url> "title")
|
|
232
|
+
# reference [ref]: url [ref]: <url> "title" (up to 3 leading spaces)
|
|
233
|
+
# Only link targets count: text evidence inlined into comment.md may quote a
|
|
234
|
+
# release URL as plain text, and that must not fail the run.
|
|
235
|
+
THIS_RUN_ASSETS=$(printf '%s\n' "${UPLOADED_ASSETS[@]}")
|
|
236
|
+
BAD_LINKS=0
|
|
237
|
+
while IFS= read -r LINK; do
|
|
238
|
+
[[ "$LINK" == *"releases/download/${RELEASE_TAG}/"* ]] || continue
|
|
239
|
+
LINK_NAME="${LINK##*/}"
|
|
240
|
+
if [[ "$LINK_NAME" != "pr-${PR_NUMBER}-"* ]]; then
|
|
241
|
+
echo "ERROR: $COMMENT_MD links $LINK, which is not scoped to PR #$PR_NUMBER (expected pr-${PR_NUMBER}-<file>)" >&2
|
|
242
|
+
BAD_LINKS=1
|
|
243
|
+
elif ! grep -qxF "$LINK_NAME" <<< "$THIS_RUN_ASSETS"; then
|
|
244
|
+
echo "ERROR: $COMMENT_MD links $LINK, which this run did not upload to release '$RELEASE_TAG'" >&2
|
|
245
|
+
BAD_LINKS=1
|
|
246
|
+
fi
|
|
247
|
+
done < <(
|
|
248
|
+
{ grep -oE '\]\(<?[^)<>[:space:]]+' "$COMMENT_MD" || true; } | sed -E 's/^\]\(<?//'
|
|
249
|
+
{ grep -oE '^ {0,3}\[[^]]+\]:[[:space:]]*<?[^<>[:space:]]+' "$COMMENT_MD" || true; } |
|
|
250
|
+
sed -E 's/^ {0,3}\[[^]]+\]:[[:space:]]*<?//'
|
|
251
|
+
)
|
|
252
|
+
if [[ $BAD_LINKS -ne 0 ]]; then
|
|
175
253
|
exit 1
|
|
176
254
|
fi
|
|
177
255
|
|
|
256
|
+
# ── Step 2: Update GitHub PR description with evidence ──────────────────────
|
|
178
257
|
echo ""
|
|
179
258
|
echo "==> Updating GitHub PR #$PR_NUMBER description..."
|
|
180
259
|
|
|
@@ -194,7 +194,10 @@ def generate_github_md(ticket_id, pr_number, branch, evidence_files, journey, gh
|
|
|
194
194
|
if filename.endswith(".png"):
|
|
195
195
|
lines.append(f"**{label}:**")
|
|
196
196
|
lines.append("")
|
|
197
|
-
|
|
197
|
+
# post-evidence.sh stores the asset as pr-<number>-<file> so pull
|
|
198
|
+
# requests sharing the release never overwrite each other's
|
|
199
|
+
# evidence (CodySwannGT/lisa#4639); link exactly that name.
|
|
200
|
+
lines.append(f"")
|
|
198
201
|
lines.append("")
|
|
199
202
|
else:
|
|
200
203
|
content = evidence_path.read_text().strip()
|
|
@@ -81,7 +81,7 @@ export LISA_EVIDENCE_RELEASE=$(node scripts/lisa-work-item.mjs evidence-release
|
|
|
81
81
|
## What It Does
|
|
82
82
|
|
|
83
83
|
1. **Read JIRA config** — Resolves the jira-cli config (`$PROJECT_DIR/.lisa/jira-cli/.config.yml` first, then `~/.config/.jira/.config.yml`, announcing the fallback) and reads `server` and `login` from it dynamically — no hardcoded values. Exits 1 naming both paths when neither exists. The same resolved path is then passed to `jira issue move` as `--config`, so the CLI cannot end up on a different config than the one this script parsed.
|
|
84
|
-
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** —
|
|
84
|
+
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** — Validates `PR_NUMBER` as a positive integer, uploads each evidence file as `pr-<PR_NUMBER>-<file>` via `gh release upload --clobber`, then lists the release and exits 1 naming any uploaded asset that is missing. Before uploading it refuses an evidence name outside `NN-name.(png|txt|json)` with letters, digits, `.`, `_` and `-` only (GitHub rewrites other characters in asset names), and before editing the description it exits 1 naming any Markdown link or image target in `comment.md` (inline, titled, `<url>`-bracketed or a reference definition such as `[ref]: url`) that points into that release but is not `pr-<PR_NUMBER>-…` or was not uploaded by this run (a stale asset from an earlier run does not count; release URLs quoted as plain text in inlined evidence are ignored). `--clobber` therefore only ever replaces this pull request's own earlier upload.
|
|
85
85
|
3. **Update PR description** — Replaces or appends the `## Evidence` section in the PR body
|
|
86
86
|
4. **Post JIRA comment** — Posts `comment.txt` as a new comment (wiki markup with code blocks)
|
|
87
87
|
5. **Move ticket to the configured review status** — Transitions the JIRA ticket to `$REVIEW` (default: `Code Review`).
|
|
@@ -99,6 +99,8 @@ evidence/
|
|
|
99
99
|
comment.md used for PR description
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
Local evidence files keep their `NN-` names. In the shared evidence release each one is stored as `pr-<number>-<file>` (for PR 42, `01-health-check.json` becomes `pr-42-01-health-check.json`), so two pull requests with a same-named file never overwrite each other's evidence. `generate-templates.py` links that scoped name.
|
|
103
|
+
|
|
102
104
|
## Troubleshooting
|
|
103
105
|
|
|
104
106
|
### Evidence not appearing in GitHub PR
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
#
|
|
16
16
|
# What it does:
|
|
17
17
|
# 1. Uploads evidence files to the configured GitHub evidence release
|
|
18
|
-
# (default 'pr-assets'; see verification.completion.evidenceRelease)
|
|
18
|
+
# (default 'pr-assets'; see verification.completion.evidenceRelease) as
|
|
19
|
+
# pr-<PR_NUMBER>-<file>, then confirms every one is listed there
|
|
19
20
|
# 2. Updates the GitHub PR description with evidence/comment.md
|
|
20
21
|
# 3. Uploads image evidence as JIRA attachments
|
|
21
22
|
# 4. Posts/updates the JIRA comment with evidence/comment.txt
|
|
@@ -28,6 +29,14 @@ TICKET_ID="${1:?Usage: post-evidence.sh <TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>}"
|
|
|
28
29
|
EVIDENCE_DIR="${2:?Usage: post-evidence.sh <TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>}"
|
|
29
30
|
PR_NUMBER="${3:?Usage: post-evidence.sh <TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>}"
|
|
30
31
|
|
|
32
|
+
# Every release asset is named pr-${PR_NUMBER}-<file>, so the number must be a
|
|
33
|
+
# canonical positive integer before anything is uploaded: an empty, signed or
|
|
34
|
+
# padded value would produce a name another pull request could also produce.
|
|
35
|
+
if [[ ! "$PR_NUMBER" =~ ^[1-9][0-9]*$ ]]; then
|
|
36
|
+
echo "ERROR: PR_NUMBER must be a positive integer, got '$PR_NUMBER'" >&2
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
31
40
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
32
41
|
# CONFIG RESOLUTION
|
|
33
42
|
#
|
|
@@ -153,6 +162,26 @@ fi
|
|
|
153
162
|
|
|
154
163
|
echo "Found ${#SCREENSHOTS[@]} screenshots and ${#TEXT_EVIDENCE[@]} text evidence files to upload"
|
|
155
164
|
|
|
165
|
+
# GitHub rewrites special characters (spaces, brackets, non-ASCII) in release
|
|
166
|
+
# asset names, so a link built from the local name would point at an asset that
|
|
167
|
+
# does not exist under that name. Refuse such names before anything is uploaded.
|
|
168
|
+
for FILE in "${ALL_EVIDENCE[@]}"; do
|
|
169
|
+
if [[ ! "$(basename "$FILE")" =~ ^[0-9]{2}-[A-Za-z0-9._-]+\.(png|txt|json)$ ]]; then
|
|
170
|
+
echo "ERROR: evidence file name '$(basename "$FILE")' is not release-safe." >&2
|
|
171
|
+
echo " Rename it to NN-name.ext using only letters, digits, '.', '_' and '-'" >&2
|
|
172
|
+
echo " (e.g. '01-search step.png' -> '01-search-step.png'), then re-run generate-templates.py." >&2
|
|
173
|
+
exit 1
|
|
174
|
+
fi
|
|
175
|
+
done
|
|
176
|
+
|
|
177
|
+
# The description is checked against the release after uploading, so it must
|
|
178
|
+
# exist before anything is uploaded.
|
|
179
|
+
COMMENT_MD="$EVIDENCE_DIR/comment.md"
|
|
180
|
+
if [[ ! -f "$COMMENT_MD" ]]; then
|
|
181
|
+
echo "ERROR: $COMMENT_MD not found — run generate-templates.py first" >&2
|
|
182
|
+
exit 1
|
|
183
|
+
fi
|
|
184
|
+
|
|
156
185
|
# Compute JIRA auth early (used in steps 3 and 4)
|
|
157
186
|
JIRA_AUTH=$(printf '%s' "$JIRA_USER:$JIRA_API_TOKEN" | base64 | tr -d '\n')
|
|
158
187
|
|
|
@@ -160,21 +189,71 @@ JIRA_AUTH=$(printf '%s' "$JIRA_USER:$JIRA_API_TOKEN" | base64 | tr -d '\n')
|
|
|
160
189
|
echo ""
|
|
161
190
|
echo "==> Uploading to GitHub release '$RELEASE_TAG'..."
|
|
162
191
|
|
|
192
|
+
# Every pull request shares this one release, and --clobber deletes a
|
|
193
|
+
# same-named asset before uploading. Bare NN- names collided across pull
|
|
194
|
+
# requests, so a later upload destroyed an earlier one's evidence
|
|
195
|
+
# (CodySwannGT/lisa#4639). Each asset is therefore uploaded as
|
|
196
|
+
# pr-${PR_NUMBER}-<file>: --clobber can then replace only this pull request's
|
|
197
|
+
# own earlier upload. Local evidence files keep their NN- names; the scoped
|
|
198
|
+
# copies live in a private directory removed on exit.
|
|
199
|
+
UPLOAD_DIR=$(mktemp -d)
|
|
200
|
+
trap 'rm -rf "$UPLOAD_DIR"' EXIT
|
|
201
|
+
UPLOADED_ASSETS=()
|
|
163
202
|
for FILE in "${ALL_EVIDENCE[@]}"; do
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
203
|
+
ASSET_NAME="pr-${PR_NUMBER}-$(basename "$FILE")"
|
|
204
|
+
cp "$FILE" "$UPLOAD_DIR/$ASSET_NAME"
|
|
205
|
+
echo " ↑ $ASSET_NAME"
|
|
206
|
+
gh release upload "$RELEASE_TAG" "$UPLOAD_DIR/$ASSET_NAME" --repo "$GH_REPO" --clobber
|
|
207
|
+
UPLOADED_ASSETS+=("$ASSET_NAME")
|
|
167
208
|
done
|
|
168
209
|
|
|
210
|
+
# The description links these names, so confirm each one is really in the
|
|
211
|
+
# release before pointing anything at it.
|
|
212
|
+
RELEASE_ASSETS=$(gh release view "$RELEASE_TAG" --repo "$GH_REPO" --json assets --jq '.assets[].name')
|
|
213
|
+
MISSING_ASSETS=0
|
|
214
|
+
for ASSET_NAME in "${UPLOADED_ASSETS[@]}"; do
|
|
215
|
+
if ! grep -qxF "$ASSET_NAME" <<< "$RELEASE_ASSETS"; then
|
|
216
|
+
echo "ERROR: $ASSET_NAME is missing from release '$RELEASE_TAG' after upload" >&2
|
|
217
|
+
MISSING_ASSETS=1
|
|
218
|
+
fi
|
|
219
|
+
done
|
|
220
|
+
if [[ $MISSING_ASSETS -ne 0 ]]; then
|
|
221
|
+
exit 1
|
|
222
|
+
fi
|
|
223
|
+
|
|
169
224
|
echo " ✓ GitHub release assets uploaded"
|
|
170
225
|
|
|
171
|
-
#
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
226
|
+
# Every Markdown link or image target that points into the release must name
|
|
227
|
+
# an asset THIS run uploaded, and therefore one the check above just found in
|
|
228
|
+
# the release. A bare or other-PR name would show some other pull request's
|
|
229
|
+
# evidence, and a pr-<n>- asset left over from an earlier run would show
|
|
230
|
+
# evidence this run did not produce. Every Markdown target form counts:
|
|
231
|
+
# inline ](url) ](url "title") ](<url>) ](<url> "title")
|
|
232
|
+
# reference [ref]: url [ref]: <url> "title" (up to 3 leading spaces)
|
|
233
|
+
# Only link targets count: text evidence inlined into comment.md may quote a
|
|
234
|
+
# release URL as plain text, and that must not fail the run.
|
|
235
|
+
THIS_RUN_ASSETS=$(printf '%s\n' "${UPLOADED_ASSETS[@]}")
|
|
236
|
+
BAD_LINKS=0
|
|
237
|
+
while IFS= read -r LINK; do
|
|
238
|
+
[[ "$LINK" == *"releases/download/${RELEASE_TAG}/"* ]] || continue
|
|
239
|
+
LINK_NAME="${LINK##*/}"
|
|
240
|
+
if [[ "$LINK_NAME" != "pr-${PR_NUMBER}-"* ]]; then
|
|
241
|
+
echo "ERROR: $COMMENT_MD links $LINK, which is not scoped to PR #$PR_NUMBER (expected pr-${PR_NUMBER}-<file>)" >&2
|
|
242
|
+
BAD_LINKS=1
|
|
243
|
+
elif ! grep -qxF "$LINK_NAME" <<< "$THIS_RUN_ASSETS"; then
|
|
244
|
+
echo "ERROR: $COMMENT_MD links $LINK, which this run did not upload to release '$RELEASE_TAG'" >&2
|
|
245
|
+
BAD_LINKS=1
|
|
246
|
+
fi
|
|
247
|
+
done < <(
|
|
248
|
+
{ grep -oE '\]\(<?[^)<>[:space:]]+' "$COMMENT_MD" || true; } | sed -E 's/^\]\(<?//'
|
|
249
|
+
{ grep -oE '^ {0,3}\[[^]]+\]:[[:space:]]*<?[^<>[:space:]]+' "$COMMENT_MD" || true; } |
|
|
250
|
+
sed -E 's/^ {0,3}\[[^]]+\]:[[:space:]]*<?//'
|
|
251
|
+
)
|
|
252
|
+
if [[ $BAD_LINKS -ne 0 ]]; then
|
|
175
253
|
exit 1
|
|
176
254
|
fi
|
|
177
255
|
|
|
256
|
+
# ── Step 2: Update GitHub PR description with evidence ──────────────────────
|
|
178
257
|
echo ""
|
|
179
258
|
echo "==> Updating GitHub PR #$PR_NUMBER description..."
|
|
180
259
|
|
|
@@ -194,7 +194,10 @@ def generate_github_md(ticket_id, pr_number, branch, evidence_files, journey, gh
|
|
|
194
194
|
if filename.endswith(".png"):
|
|
195
195
|
lines.append(f"**{label}:**")
|
|
196
196
|
lines.append("")
|
|
197
|
-
|
|
197
|
+
# post-evidence.sh stores the asset as pr-<number>-<file> so pull
|
|
198
|
+
# requests sharing the release never overwrite each other's
|
|
199
|
+
# evidence (CodySwannGT/lisa#4639); link exactly that name.
|
|
200
|
+
lines.append(f"")
|
|
198
201
|
lines.append("")
|
|
199
202
|
else:
|
|
200
203
|
content = evidence_path.read_text().strip()
|
|
@@ -81,7 +81,7 @@ export LISA_EVIDENCE_RELEASE=$(node scripts/lisa-work-item.mjs evidence-release
|
|
|
81
81
|
## What It Does
|
|
82
82
|
|
|
83
83
|
1. **Read JIRA config** — Resolves the jira-cli config (`$PROJECT_DIR/.lisa/jira-cli/.config.yml` first, then `~/.config/.jira/.config.yml`, announcing the fallback) and reads `server` and `login` from it dynamically — no hardcoded values. Exits 1 naming both paths when neither exists. The same resolved path is then passed to `jira issue move` as `--config`, so the CLI cannot end up on a different config than the one this script parsed.
|
|
84
|
-
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** —
|
|
84
|
+
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** — Validates `PR_NUMBER` as a positive integer, uploads each evidence file as `pr-<PR_NUMBER>-<file>` via `gh release upload --clobber`, then lists the release and exits 1 naming any uploaded asset that is missing. Before uploading it refuses an evidence name outside `NN-name.(png|txt|json)` with letters, digits, `.`, `_` and `-` only (GitHub rewrites other characters in asset names), and before editing the description it exits 1 naming any Markdown link or image target in `comment.md` (inline, titled, `<url>`-bracketed or a reference definition such as `[ref]: url`) that points into that release but is not `pr-<PR_NUMBER>-…` or was not uploaded by this run (a stale asset from an earlier run does not count; release URLs quoted as plain text in inlined evidence are ignored). `--clobber` therefore only ever replaces this pull request's own earlier upload.
|
|
85
85
|
3. **Update PR description** — Replaces or appends the `## Evidence` section in the PR body
|
|
86
86
|
4. **Post JIRA comment** — Posts `comment.txt` as a new comment (wiki markup with code blocks)
|
|
87
87
|
5. **Move ticket to the configured review status** — Transitions the JIRA ticket to `$REVIEW` (default: `Code Review`).
|
|
@@ -99,6 +99,8 @@ evidence/
|
|
|
99
99
|
comment.md used for PR description
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
Local evidence files keep their `NN-` names. In the shared evidence release each one is stored as `pr-<number>-<file>` (for PR 42, `01-health-check.json` becomes `pr-42-01-health-check.json`), so two pull requests with a same-named file never overwrite each other's evidence. `generate-templates.py` links that scoped name.
|
|
103
|
+
|
|
102
104
|
## Troubleshooting
|
|
103
105
|
|
|
104
106
|
### Evidence not appearing in GitHub PR
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
#
|
|
16
16
|
# What it does:
|
|
17
17
|
# 1. Uploads evidence files to the configured GitHub evidence release
|
|
18
|
-
# (default 'pr-assets'; see verification.completion.evidenceRelease)
|
|
18
|
+
# (default 'pr-assets'; see verification.completion.evidenceRelease) as
|
|
19
|
+
# pr-<PR_NUMBER>-<file>, then confirms every one is listed there
|
|
19
20
|
# 2. Updates the GitHub PR description with evidence/comment.md
|
|
20
21
|
# 3. Uploads image evidence as JIRA attachments
|
|
21
22
|
# 4. Posts/updates the JIRA comment with evidence/comment.txt
|
|
@@ -28,6 +29,14 @@ TICKET_ID="${1:?Usage: post-evidence.sh <TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>}"
|
|
|
28
29
|
EVIDENCE_DIR="${2:?Usage: post-evidence.sh <TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>}"
|
|
29
30
|
PR_NUMBER="${3:?Usage: post-evidence.sh <TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>}"
|
|
30
31
|
|
|
32
|
+
# Every release asset is named pr-${PR_NUMBER}-<file>, so the number must be a
|
|
33
|
+
# canonical positive integer before anything is uploaded: an empty, signed or
|
|
34
|
+
# padded value would produce a name another pull request could also produce.
|
|
35
|
+
if [[ ! "$PR_NUMBER" =~ ^[1-9][0-9]*$ ]]; then
|
|
36
|
+
echo "ERROR: PR_NUMBER must be a positive integer, got '$PR_NUMBER'" >&2
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
31
40
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
32
41
|
# CONFIG RESOLUTION
|
|
33
42
|
#
|
|
@@ -153,6 +162,26 @@ fi
|
|
|
153
162
|
|
|
154
163
|
echo "Found ${#SCREENSHOTS[@]} screenshots and ${#TEXT_EVIDENCE[@]} text evidence files to upload"
|
|
155
164
|
|
|
165
|
+
# GitHub rewrites special characters (spaces, brackets, non-ASCII) in release
|
|
166
|
+
# asset names, so a link built from the local name would point at an asset that
|
|
167
|
+
# does not exist under that name. Refuse such names before anything is uploaded.
|
|
168
|
+
for FILE in "${ALL_EVIDENCE[@]}"; do
|
|
169
|
+
if [[ ! "$(basename "$FILE")" =~ ^[0-9]{2}-[A-Za-z0-9._-]+\.(png|txt|json)$ ]]; then
|
|
170
|
+
echo "ERROR: evidence file name '$(basename "$FILE")' is not release-safe." >&2
|
|
171
|
+
echo " Rename it to NN-name.ext using only letters, digits, '.', '_' and '-'" >&2
|
|
172
|
+
echo " (e.g. '01-search step.png' -> '01-search-step.png'), then re-run generate-templates.py." >&2
|
|
173
|
+
exit 1
|
|
174
|
+
fi
|
|
175
|
+
done
|
|
176
|
+
|
|
177
|
+
# The description is checked against the release after uploading, so it must
|
|
178
|
+
# exist before anything is uploaded.
|
|
179
|
+
COMMENT_MD="$EVIDENCE_DIR/comment.md"
|
|
180
|
+
if [[ ! -f "$COMMENT_MD" ]]; then
|
|
181
|
+
echo "ERROR: $COMMENT_MD not found — run generate-templates.py first" >&2
|
|
182
|
+
exit 1
|
|
183
|
+
fi
|
|
184
|
+
|
|
156
185
|
# Compute JIRA auth early (used in steps 3 and 4)
|
|
157
186
|
JIRA_AUTH=$(printf '%s' "$JIRA_USER:$JIRA_API_TOKEN" | base64 | tr -d '\n')
|
|
158
187
|
|
|
@@ -160,21 +189,71 @@ JIRA_AUTH=$(printf '%s' "$JIRA_USER:$JIRA_API_TOKEN" | base64 | tr -d '\n')
|
|
|
160
189
|
echo ""
|
|
161
190
|
echo "==> Uploading to GitHub release '$RELEASE_TAG'..."
|
|
162
191
|
|
|
192
|
+
# Every pull request shares this one release, and --clobber deletes a
|
|
193
|
+
# same-named asset before uploading. Bare NN- names collided across pull
|
|
194
|
+
# requests, so a later upload destroyed an earlier one's evidence
|
|
195
|
+
# (CodySwannGT/lisa#4639). Each asset is therefore uploaded as
|
|
196
|
+
# pr-${PR_NUMBER}-<file>: --clobber can then replace only this pull request's
|
|
197
|
+
# own earlier upload. Local evidence files keep their NN- names; the scoped
|
|
198
|
+
# copies live in a private directory removed on exit.
|
|
199
|
+
UPLOAD_DIR=$(mktemp -d)
|
|
200
|
+
trap 'rm -rf "$UPLOAD_DIR"' EXIT
|
|
201
|
+
UPLOADED_ASSETS=()
|
|
163
202
|
for FILE in "${ALL_EVIDENCE[@]}"; do
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
203
|
+
ASSET_NAME="pr-${PR_NUMBER}-$(basename "$FILE")"
|
|
204
|
+
cp "$FILE" "$UPLOAD_DIR/$ASSET_NAME"
|
|
205
|
+
echo " ↑ $ASSET_NAME"
|
|
206
|
+
gh release upload "$RELEASE_TAG" "$UPLOAD_DIR/$ASSET_NAME" --repo "$GH_REPO" --clobber
|
|
207
|
+
UPLOADED_ASSETS+=("$ASSET_NAME")
|
|
167
208
|
done
|
|
168
209
|
|
|
210
|
+
# The description links these names, so confirm each one is really in the
|
|
211
|
+
# release before pointing anything at it.
|
|
212
|
+
RELEASE_ASSETS=$(gh release view "$RELEASE_TAG" --repo "$GH_REPO" --json assets --jq '.assets[].name')
|
|
213
|
+
MISSING_ASSETS=0
|
|
214
|
+
for ASSET_NAME in "${UPLOADED_ASSETS[@]}"; do
|
|
215
|
+
if ! grep -qxF "$ASSET_NAME" <<< "$RELEASE_ASSETS"; then
|
|
216
|
+
echo "ERROR: $ASSET_NAME is missing from release '$RELEASE_TAG' after upload" >&2
|
|
217
|
+
MISSING_ASSETS=1
|
|
218
|
+
fi
|
|
219
|
+
done
|
|
220
|
+
if [[ $MISSING_ASSETS -ne 0 ]]; then
|
|
221
|
+
exit 1
|
|
222
|
+
fi
|
|
223
|
+
|
|
169
224
|
echo " ✓ GitHub release assets uploaded"
|
|
170
225
|
|
|
171
|
-
#
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
226
|
+
# Every Markdown link or image target that points into the release must name
|
|
227
|
+
# an asset THIS run uploaded, and therefore one the check above just found in
|
|
228
|
+
# the release. A bare or other-PR name would show some other pull request's
|
|
229
|
+
# evidence, and a pr-<n>- asset left over from an earlier run would show
|
|
230
|
+
# evidence this run did not produce. Every Markdown target form counts:
|
|
231
|
+
# inline ](url) ](url "title") ](<url>) ](<url> "title")
|
|
232
|
+
# reference [ref]: url [ref]: <url> "title" (up to 3 leading spaces)
|
|
233
|
+
# Only link targets count: text evidence inlined into comment.md may quote a
|
|
234
|
+
# release URL as plain text, and that must not fail the run.
|
|
235
|
+
THIS_RUN_ASSETS=$(printf '%s\n' "${UPLOADED_ASSETS[@]}")
|
|
236
|
+
BAD_LINKS=0
|
|
237
|
+
while IFS= read -r LINK; do
|
|
238
|
+
[[ "$LINK" == *"releases/download/${RELEASE_TAG}/"* ]] || continue
|
|
239
|
+
LINK_NAME="${LINK##*/}"
|
|
240
|
+
if [[ "$LINK_NAME" != "pr-${PR_NUMBER}-"* ]]; then
|
|
241
|
+
echo "ERROR: $COMMENT_MD links $LINK, which is not scoped to PR #$PR_NUMBER (expected pr-${PR_NUMBER}-<file>)" >&2
|
|
242
|
+
BAD_LINKS=1
|
|
243
|
+
elif ! grep -qxF "$LINK_NAME" <<< "$THIS_RUN_ASSETS"; then
|
|
244
|
+
echo "ERROR: $COMMENT_MD links $LINK, which this run did not upload to release '$RELEASE_TAG'" >&2
|
|
245
|
+
BAD_LINKS=1
|
|
246
|
+
fi
|
|
247
|
+
done < <(
|
|
248
|
+
{ grep -oE '\]\(<?[^)<>[:space:]]+' "$COMMENT_MD" || true; } | sed -E 's/^\]\(<?//'
|
|
249
|
+
{ grep -oE '^ {0,3}\[[^]]+\]:[[:space:]]*<?[^<>[:space:]]+' "$COMMENT_MD" || true; } |
|
|
250
|
+
sed -E 's/^ {0,3}\[[^]]+\]:[[:space:]]*<?//'
|
|
251
|
+
)
|
|
252
|
+
if [[ $BAD_LINKS -ne 0 ]]; then
|
|
175
253
|
exit 1
|
|
176
254
|
fi
|
|
177
255
|
|
|
256
|
+
# ── Step 2: Update GitHub PR description with evidence ──────────────────────
|
|
178
257
|
echo ""
|
|
179
258
|
echo "==> Updating GitHub PR #$PR_NUMBER description..."
|
|
180
259
|
|
|
@@ -194,7 +194,10 @@ def generate_github_md(ticket_id, pr_number, branch, evidence_files, journey, gh
|
|
|
194
194
|
if filename.endswith(".png"):
|
|
195
195
|
lines.append(f"**{label}:**")
|
|
196
196
|
lines.append("")
|
|
197
|
-
|
|
197
|
+
# post-evidence.sh stores the asset as pr-<number>-<file> so pull
|
|
198
|
+
# requests sharing the release never overwrite each other's
|
|
199
|
+
# evidence (CodySwannGT/lisa#4639); link exactly that name.
|
|
200
|
+
lines.append(f"")
|
|
198
201
|
lines.append("")
|
|
199
202
|
else:
|
|
200
203
|
content = evidence_path.read_text().strip()
|
|
@@ -81,7 +81,7 @@ export LISA_EVIDENCE_RELEASE=$(node scripts/lisa-work-item.mjs evidence-release
|
|
|
81
81
|
## What It Does
|
|
82
82
|
|
|
83
83
|
1. **Read JIRA config** — Resolves the jira-cli config (`$PROJECT_DIR/.lisa/jira-cli/.config.yml` first, then `~/.config/.jira/.config.yml`, announcing the fallback) and reads `server` and `login` from it dynamically — no hardcoded values. Exits 1 naming both paths when neither exists. The same resolved path is then passed to `jira issue move` as `--config`, so the CLI cannot end up on a different config than the one this script parsed.
|
|
84
|
-
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** —
|
|
84
|
+
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** — Validates `PR_NUMBER` as a positive integer, uploads each evidence file as `pr-<PR_NUMBER>-<file>` via `gh release upload --clobber`, then lists the release and exits 1 naming any uploaded asset that is missing. Before uploading it refuses an evidence name outside `NN-name.(png|txt|json)` with letters, digits, `.`, `_` and `-` only (GitHub rewrites other characters in asset names), and before editing the description it exits 1 naming any Markdown link or image target in `comment.md` (inline, titled, `<url>`-bracketed or a reference definition such as `[ref]: url`) that points into that release but is not `pr-<PR_NUMBER>-…` or was not uploaded by this run (a stale asset from an earlier run does not count; release URLs quoted as plain text in inlined evidence are ignored). `--clobber` therefore only ever replaces this pull request's own earlier upload.
|
|
85
85
|
3. **Update PR description** — Replaces or appends the `## Evidence` section in the PR body
|
|
86
86
|
4. **Post JIRA comment** — Posts `comment.txt` as a new comment (wiki markup with code blocks)
|
|
87
87
|
5. **Move ticket to the configured review status** — Transitions the JIRA ticket to `$REVIEW` (default: `Code Review`).
|
|
@@ -99,6 +99,8 @@ evidence/
|
|
|
99
99
|
comment.md used for PR description
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
Local evidence files keep their `NN-` names. In the shared evidence release each one is stored as `pr-<number>-<file>` (for PR 42, `01-health-check.json` becomes `pr-42-01-health-check.json`), so two pull requests with a same-named file never overwrite each other's evidence. `generate-templates.py` links that scoped name.
|
|
103
|
+
|
|
102
104
|
## Troubleshooting
|
|
103
105
|
|
|
104
106
|
### Evidence not appearing in GitHub PR
|