@codyswann/lisa 4.99.9 → 4.99.11
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/cli/ui-enabled-plugins.d.ts.map +1 -1
- package/dist/cli/ui-enabled-plugins.js +5 -29
- package/dist/cli/ui-enabled-plugins.js.map +1 -1
- package/dist/core/lisa.d.ts +10 -1
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +38 -3
- package/dist/core/lisa.js.map +1 -1
- 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/plugin-command.d.ts +14 -0
- package/dist/core/plugin-command.d.ts.map +1 -1
- package/dist/core/plugin-command.js +21 -3
- package/dist/core/plugin-command.js.map +1 -1
- package/dist/core/plugin-marketplace-filter.d.ts +36 -0
- package/dist/core/plugin-marketplace-filter.d.ts.map +1 -0
- package/dist/core/plugin-marketplace-filter.js +35 -0
- package/dist/core/plugin-marketplace-filter.js.map +1 -0
- package/dist/core/plugin-registration-prune.d.ts +31 -0
- package/dist/core/plugin-registration-prune.d.ts.map +1 -0
- package/dist/core/plugin-registration-prune.js +257 -0
- package/dist/core/plugin-registration-prune.js.map +1 -0
- package/dist/core/retired-plugin-keys.d.ts +24 -0
- package/dist/core/retired-plugin-keys.d.ts.map +1 -0
- package/dist/core/retired-plugin-keys.js +12 -0
- package/dist/core/retired-plugin-keys.js.map +1 -0
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +27 -9
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +4 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/prune-retired-claude-stack-plugin-keys.d.ts +33 -0
- package/dist/migrations/prune-retired-claude-stack-plugin-keys.d.ts.map +1 -0
- package/dist/migrations/prune-retired-claude-stack-plugin-keys.js +98 -0
- package/dist/migrations/prune-retired-claude-stack-plugin-keys.js.map +1 -0
- package/dist/utils/marketplace-manifest.d.ts +19 -0
- package/dist/utils/marketplace-manifest.d.ts.map +1 -0
- package/dist/utils/marketplace-manifest.js +59 -0
- package/dist/utils/marketplace-manifest.js.map +1 -0
- 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/typescript/copy-contents/.husky/post-checkout +28 -0
|
@@ -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
|
|
|
@@ -86,11 +86,14 @@ def get_github_repo():
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
def collect_screenshots(evidence_dir):
|
|
89
|
-
"""Collect screenshot files sorted by name.
|
|
89
|
+
"""Collect screenshot files sorted by name.
|
|
90
|
+
|
|
91
|
+
Only NN-*.png: that is exactly what post-evidence.sh uploads and
|
|
92
|
+
attaches, and it refuses a description that links anything it did not
|
|
93
|
+
upload (CodySwannGT/lisa#4639). Linking a .jpg/.gif here would fail it.
|
|
94
|
+
"""
|
|
90
95
|
evidence_path = Path(evidence_dir)
|
|
91
|
-
screenshots = []
|
|
92
|
-
for ext in ("*.png", "*.jpg", "*.jpeg", "*.gif"):
|
|
93
|
-
screenshots.extend(evidence_path.glob(ext))
|
|
96
|
+
screenshots = list(evidence_path.glob("[0-9][0-9]-*.png"))
|
|
94
97
|
return sorted(screenshots, key=lambda p: p.name)
|
|
95
98
|
|
|
96
99
|
|
|
@@ -237,7 +240,10 @@ def generate_github_md(ticket_id, pr_number, branch, screenshots, journey, gh_re
|
|
|
237
240
|
|
|
238
241
|
lines.append(f"**{label}:**")
|
|
239
242
|
lines.append("")
|
|
240
|
-
|
|
243
|
+
# post-evidence.sh stores the asset as pr-<number>-<file> so pull
|
|
244
|
+
# requests sharing the release never overwrite each other's
|
|
245
|
+
# evidence (CodySwannGT/lisa#4639); link exactly that name.
|
|
246
|
+
lines.append(f"")
|
|
241
247
|
lines.append("")
|
|
242
248
|
|
|
243
249
|
# Verification Journey
|
|
@@ -54,7 +54,7 @@ export LISA_EVIDENCE_RELEASE=$(node scripts/lisa-work-item.mjs evidence-release
|
|
|
54
54
|
## What It Does
|
|
55
55
|
|
|
56
56
|
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.
|
|
57
|
-
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** —
|
|
57
|
+
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 `NN-name-viewport.png` screenshot as `pr-<PR_NUMBER>-<file>` via `gh release upload --clobber`, creating CDN URLs that render in GitHub markdown, 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.
|
|
58
58
|
3. **Update PR description** — Replaces or appends the `## Evidence` section in the PR body using `gh pr edit`
|
|
59
59
|
4. **Upload JIRA attachments** — Uploads screenshots via REST API v3 so `!filename.png!` wiki markup renders inline
|
|
60
60
|
5. **Post JIRA comment** — Posts `comment.txt` as a new comment via REST API v2 (wiki markup with embedded images)
|
|
@@ -73,6 +73,8 @@ evidence/
|
|
|
73
73
|
comment.md used for PR description
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
Local screenshots keep their `NN-` names. In the shared evidence release each one is stored as `pr-<number>-<file>` (for PR 42, `01-search-step-desktop.png` becomes `pr-42-01-search-step-desktop.png`), so two pull requests with a same-named screenshot never overwrite each other's evidence. `generate-templates.py` links that scoped name; JIRA attachments keep the local name.
|
|
77
|
+
|
|
76
78
|
## Troubleshooting
|
|
77
79
|
|
|
78
80
|
### Images not rendering 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
|
|
|
@@ -86,11 +86,14 @@ def get_github_repo():
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
def collect_screenshots(evidence_dir):
|
|
89
|
-
"""Collect screenshot files sorted by name.
|
|
89
|
+
"""Collect screenshot files sorted by name.
|
|
90
|
+
|
|
91
|
+
Only NN-*.png: that is exactly what post-evidence.sh uploads and
|
|
92
|
+
attaches, and it refuses a description that links anything it did not
|
|
93
|
+
upload (CodySwannGT/lisa#4639). Linking a .jpg/.gif here would fail it.
|
|
94
|
+
"""
|
|
90
95
|
evidence_path = Path(evidence_dir)
|
|
91
|
-
screenshots = []
|
|
92
|
-
for ext in ("*.png", "*.jpg", "*.jpeg", "*.gif"):
|
|
93
|
-
screenshots.extend(evidence_path.glob(ext))
|
|
96
|
+
screenshots = list(evidence_path.glob("[0-9][0-9]-*.png"))
|
|
94
97
|
return sorted(screenshots, key=lambda p: p.name)
|
|
95
98
|
|
|
96
99
|
|
|
@@ -237,7 +240,10 @@ def generate_github_md(ticket_id, pr_number, branch, screenshots, journey, gh_re
|
|
|
237
240
|
|
|
238
241
|
lines.append(f"**{label}:**")
|
|
239
242
|
lines.append("")
|
|
240
|
-
|
|
243
|
+
# post-evidence.sh stores the asset as pr-<number>-<file> so pull
|
|
244
|
+
# requests sharing the release never overwrite each other's
|
|
245
|
+
# evidence (CodySwannGT/lisa#4639); link exactly that name.
|
|
246
|
+
lines.append(f"")
|
|
241
247
|
lines.append("")
|
|
242
248
|
|
|
243
249
|
# Verification Journey
|
|
@@ -54,7 +54,7 @@ export LISA_EVIDENCE_RELEASE=$(node scripts/lisa-work-item.mjs evidence-release
|
|
|
54
54
|
## What It Does
|
|
55
55
|
|
|
56
56
|
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.
|
|
57
|
-
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** —
|
|
57
|
+
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 `NN-name-viewport.png` screenshot as `pr-<PR_NUMBER>-<file>` via `gh release upload --clobber`, creating CDN URLs that render in GitHub markdown, 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.
|
|
58
58
|
3. **Update PR description** — Replaces or appends the `## Evidence` section in the PR body using `gh pr edit`
|
|
59
59
|
4. **Upload JIRA attachments** — Uploads screenshots via REST API v3 so `!filename.png!` wiki markup renders inline
|
|
60
60
|
5. **Post JIRA comment** — Posts `comment.txt` as a new comment via REST API v2 (wiki markup with embedded images)
|
|
@@ -73,6 +73,8 @@ evidence/
|
|
|
73
73
|
comment.md used for PR description
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
Local screenshots keep their `NN-` names. In the shared evidence release each one is stored as `pr-<number>-<file>` (for PR 42, `01-search-step-desktop.png` becomes `pr-42-01-search-step-desktop.png`), so two pull requests with a same-named screenshot never overwrite each other's evidence. `generate-templates.py` links that scoped name; JIRA attachments keep the local name.
|
|
77
|
+
|
|
76
78
|
## Troubleshooting
|
|
77
79
|
|
|
78
80
|
### Images not rendering 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
|
|
|
@@ -86,11 +86,14 @@ def get_github_repo():
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
def collect_screenshots(evidence_dir):
|
|
89
|
-
"""Collect screenshot files sorted by name.
|
|
89
|
+
"""Collect screenshot files sorted by name.
|
|
90
|
+
|
|
91
|
+
Only NN-*.png: that is exactly what post-evidence.sh uploads and
|
|
92
|
+
attaches, and it refuses a description that links anything it did not
|
|
93
|
+
upload (CodySwannGT/lisa#4639). Linking a .jpg/.gif here would fail it.
|
|
94
|
+
"""
|
|
90
95
|
evidence_path = Path(evidence_dir)
|
|
91
|
-
screenshots = []
|
|
92
|
-
for ext in ("*.png", "*.jpg", "*.jpeg", "*.gif"):
|
|
93
|
-
screenshots.extend(evidence_path.glob(ext))
|
|
96
|
+
screenshots = list(evidence_path.glob("[0-9][0-9]-*.png"))
|
|
94
97
|
return sorted(screenshots, key=lambda p: p.name)
|
|
95
98
|
|
|
96
99
|
|
|
@@ -237,7 +240,10 @@ def generate_github_md(ticket_id, pr_number, branch, screenshots, journey, gh_re
|
|
|
237
240
|
|
|
238
241
|
lines.append(f"**{label}:**")
|
|
239
242
|
lines.append("")
|
|
240
|
-
|
|
243
|
+
# post-evidence.sh stores the asset as pr-<number>-<file> so pull
|
|
244
|
+
# requests sharing the release never overwrite each other's
|
|
245
|
+
# evidence (CodySwannGT/lisa#4639); link exactly that name.
|
|
246
|
+
lines.append(f"")
|
|
241
247
|
lines.append("")
|
|
242
248
|
|
|
243
249
|
# Verification Journey
|
|
@@ -54,7 +54,7 @@ export LISA_EVIDENCE_RELEASE=$(node scripts/lisa-work-item.mjs evidence-release
|
|
|
54
54
|
## What It Does
|
|
55
55
|
|
|
56
56
|
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.
|
|
57
|
-
2. **Upload to the configured evidence release (`node scripts/lisa-work-item.mjs evidence-release --ensure` prints it; default `pr-assets`)** —
|
|
57
|
+
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 `NN-name-viewport.png` screenshot as `pr-<PR_NUMBER>-<file>` via `gh release upload --clobber`, creating CDN URLs that render in GitHub markdown, 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.
|
|
58
58
|
3. **Update PR description** — Replaces or appends the `## Evidence` section in the PR body using `gh pr edit`
|
|
59
59
|
4. **Upload JIRA attachments** — Uploads screenshots via REST API v3 so `!filename.png!` wiki markup renders inline
|
|
60
60
|
5. **Post JIRA comment** — Posts `comment.txt` as a new comment via REST API v2 (wiki markup with embedded images)
|
|
@@ -73,6 +73,8 @@ evidence/
|
|
|
73
73
|
comment.md used for PR description
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
Local screenshots keep their `NN-` names. In the shared evidence release each one is stored as `pr-<number>-<file>` (for PR 42, `01-search-step-desktop.png` becomes `pr-42-01-search-step-desktop.png`), so two pull requests with a same-named screenshot never overwrite each other's evidence. `generate-templates.py` links that scoped name; JIRA attachments keep the local name.
|
|
77
|
+
|
|
76
78
|
## Troubleshooting
|
|
77
79
|
|
|
78
80
|
### Images not rendering in GitHub PR
|