Skip to content

Commit ba0ec4a

Browse files
tclaude
andcommitted
fix(jira): stop claiming phantom TestFlight builds; render real ADF; fix points field; drop noise-author lines
The merge/PR Jira automation made human-visible false or noisy claims: 1. "Ready for QA: TestFlight build N" was posted on EVERY merge, including develop merges that upload nothing. The number was whatever CURRENT_PROJECT_VERSION happened to grep first, so QA was pointed at a build that predated (and lacked) the fix. Now add_build_info takes a version + uploaded flag and only claims a TestFlight build when one was actually produced (main release, or a develop merge that bumped the build). Otherwise it says the change is merged and tells QA to hold for the next release build. jira-update-on-merge.yml computes `uploaded` (base==main, or build number changed vs first parent) and reads the Palace app's version robustly (max build / highest marketing version, not `grep -m1 | head -1`). 2. The build comment used Jira wiki markup pushed through a plain-text ADF node, so it rendered as literal asterisks and a dead link. It is now built as real ADF (strong marks + a link node). 3. Story points were written to the unused customfield_10016; the board reads customfield_10033. Fixed read + write everywhere. 4. Comments embedded the local git author ("t <t@t.io>") in add_fix_comment's traceability block and link_commit's output — meaningless to a QA/PM reader. Dropped the author line from both; the commit SHA is the traceability anchor. Goal: every automated comment reads clean to a human, no mystery authors. Also: add_build_info updates an existing per-PR comment instead of duplicating, and link_commit skips a SHA that's already linked. **Scope:** dev tooling only — scripts/jira-integration.sh and the two Jira GitHub Actions workflows. No app/production code, no test-affecting change. **Not done:** did not scrub already-posted comments in this commit (done separately on the board); did not add a bash test harness (none exists; verified via bash -n + offline ADF/version dry-runs). **Deferred:** generate-jira-tickets.py hardcodes LABEL="pp-4020" regardless of --parent — a separate, unrelated cleanup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0b60497 commit ba0ec4a

3 files changed

Lines changed: 219 additions & 51 deletions

File tree

.github/workflows/jira-pr-opened.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ jobs:
6262
- name: Get build number
6363
id: build
6464
run: |
65-
BUILD_NUM=$(grep -m1 'CURRENT_PROJECT_VERSION' Palace.xcodeproj/project.pbxproj | grep -oE '[0-9]+' | head -1)
65+
# Read the Palace app target's build number (max), not whichever
66+
# CURRENT_PROJECT_VERSION sorts first (a placeholder target carries "=1").
67+
BUILD_NUM=$(grep -oE 'CURRENT_PROJECT_VERSION = [0-9]+' Palace.xcodeproj/project.pbxproj | grep -oE '[0-9]+' | sort -n | tail -1)
6668
echo "number=$BUILD_NUM" >> $GITHUB_OUTPUT
6769
echo "📦 Build number: $BUILD_NUM"
6870

.github/workflows/jira-update-on-merge.yml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,37 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818

19-
- name: Get build number
19+
- name: Resolve app version + upload status
2020
id: build
21+
env:
22+
BASE_REF: ${{ github.event.pull_request.base.ref }}
2123
run: |
22-
# Extract build number from project.pbxproj
23-
BUILD_NUM=$(grep -m1 'CURRENT_PROJECT_VERSION' Palace.xcodeproj/project.pbxproj | grep -oE '[0-9]+' | head -1)
24+
PBX=Palace.xcodeproj/project.pbxproj
25+
# The Palace app target carries the real values; a placeholder target in the
26+
# same pbxproj carries CURRENT_PROJECT_VERSION=1 / MARKETING_VERSION=1.0. The
27+
# old `grep -m1 ... | head -1` returned whichever sorted first in the file —
28+
# a pbxproj regen floating the "=1" target up would have stamped "build 1" on
29+
# every ticket. Take the app's values: max build, highest marketing version.
30+
read_build() { grep -oE 'CURRENT_PROJECT_VERSION = [0-9]+' "$1" 2>/dev/null | grep -oE '[0-9]+' | sort -n | tail -1; }
31+
BUILD_NUM=$(read_build "$PBX")
32+
MKT=$(grep -oE 'MARKETING_VERSION = [0-9.]+' "$PBX" | sed -E 's/.*= //' | sort -V | tail -1)
2433
echo "number=$BUILD_NUM" >> $GITHUB_OUTPUT
25-
echo "📦 Build number: $BUILD_NUM"
34+
echo "version=$MKT" >> $GITHUB_OUTPUT
35+
36+
# Did this land actually produce a TestFlight build? A merge alone does NOT.
37+
# main merges are releases (always uploaded). A develop merge only produces a
38+
# build when it bumped CURRENT_PROJECT_VERSION (mirrors upload-on-merge.yml's
39+
# version_changed gate). Compare this merge commit's build number to its first
40+
# parent (the base-branch tip before the merge).
41+
PREV_BUILD=$(git show 'HEAD^1:'"$PBX" 2>/dev/null | grep -oE 'CURRENT_PROJECT_VERSION = [0-9]+' | grep -oE '[0-9]+' | sort -n | tail -1 || echo "")
42+
UPLOADED=false
43+
if [ "$BASE_REF" = "main" ]; then
44+
UPLOADED=true
45+
elif [ -n "$PREV_BUILD" ] && [ "$PREV_BUILD" != "$BUILD_NUM" ]; then
46+
UPLOADED=true
47+
fi
48+
echo "uploaded=$UPLOADED" >> $GITHUB_OUTPUT
49+
echo "📦 $MKT ($BUILD_NUM) — base=$BASE_REF prev_build=${PREV_BUILD:-none} uploaded=$UPLOADED"
2650
2751
- name: Extract Jira tickets
2852
id: tickets
@@ -65,6 +89,8 @@ jobs:
6589
JIRA_EMAIL: ${{ secrets.JIRA_PERSONAL_EMAIL }}
6690
JIRA_API_TOKEN: ${{ secrets.JIRA_PERSONAL_API_TOKEN }}
6791
BUILD_NUM: ${{ steps.build.outputs.number }}
92+
APP_VERSION: ${{ steps.build.outputs.version }}
93+
UPLOADED: ${{ steps.build.outputs.uploaded }}
6894
PR_NUM: ${{ github.event.pull_request.number }}
6995
PR_TITLE: ${{ github.event.pull_request.title }}
7096
BRANCH: ${{ github.event.pull_request.base.ref }}
@@ -82,8 +108,8 @@ jobs:
82108
for TICKET in $TICKETS; do
83109
echo "📝 Updating $TICKET..."
84110
85-
# Add build info comment
86-
./scripts/jira-integration.sh add-build-info "$TICKET" "$BUILD_NUM" "$PR_NUM" "$PR_TITLE" "$BRANCH" || {
111+
# Add build info comment (honest: only claims a TestFlight build when UPLOADED=true)
112+
./scripts/jira-integration.sh add-build-info "$TICKET" "$BUILD_NUM" "$PR_NUM" "$PR_TITLE" "$BRANCH" "$APP_VERSION" "$UPLOADED" || {
87113
echo "⚠️ Failed to add comment to $TICKET"
88114
}
89115
@@ -109,6 +135,11 @@ jobs:
109135
echo "" >> $GITHUB_STEP_SUMMARY
110136
echo "**Tickets Updated:** ${{ steps.tickets.outputs.list }}" >> $GITHUB_STEP_SUMMARY
111137
echo "" >> $GITHUB_STEP_SUMMARY
112-
echo "**Build:** ${{ steps.build.outputs.number }}" >> $GITHUB_STEP_SUMMARY
138+
echo "**Version:** ${{ steps.build.outputs.version }} (${{ steps.build.outputs.number }})" >> $GITHUB_STEP_SUMMARY
139+
if [ "${{ steps.build.outputs.uploaded }}" = "true" ]; then
140+
echo "**TestFlight:** uploaded — tickets told they are ready for QA" >> $GITHUB_STEP_SUMMARY
141+
else
142+
echo "**TestFlight:** not uploaded (no version bump) — tickets told to hold QA for the next release build" >> $GITHUB_STEP_SUMMARY
143+
fi
113144
echo "**PR:** #${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY
114145
echo "**Branch:** ${{ github.event.pull_request.base.ref }}" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)