Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,18 @@ jobs:
echo "Initial push (zero-SHA) — skipping marker check"
exit 0
fi
echo "Push to main — running marker check against pre-push state"
bun run script/upstream/analyze.ts --markers --base "${{ github.event.before }}" --strict
# Squash-merging an `upstream/merge-*` PR lands as a single commit
# on main, so the second-parent / branch-name signal is gone here.
# Detect bridge/merge-upstream commits in the pushed range by subject
# and downgrade to non-strict — the PR-side review already gated this.
if git log --format=%s "${{ github.event.before }}..${{ github.sha }}" \
| grep -qiE '(bridge|merge) upstream'; then
echo "Bridge/upstream-merge commit detected in push range — running marker check in non-strict mode"
bun run script/upstream/analyze.ts --markers --base "${{ github.event.before }}"
Comment on lines +448 to +451
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

CURRENT_RE='(bridge|merge) upstream'
PROPOSED_RE='(^|[[:space:][:punct:]])(upstream/merge-[^[:space:]]*|merge[[:space:]/_-]+upstream|bridge[[:space:]/_-]+(merge|upstream))([[:space:][:punct:]]|$)'

echo "Recent commit subjects:"
git log -n 200 --format='%s' | sed 's/^/  - /'

echo
echo "Matches with CURRENT_RE:"
git log -n 200 --format='%s' | grep -niE "$CURRENT_RE" || true

echo
echo "Matches with PROPOSED_RE:"
git log -n 200 --format='%s' | grep -niE "$PROPOSED_RE" || true

Repository: AltimateAI/altimate-code

Length of output: 281


🏁 Script executed:

cd /tmp && git clone --quiet https://github.com/AltimateAI/altimate-code.git && cd altimate-code
sed -n '448,451p' .github/workflows/ci.yml

Repository: AltimateAI/altimate-code

Length of output: 397


🏁 Script executed:

cd /tmp/altimate-code && rg -n "(bridge|merge) upstream" .github/workflows/ci.yml

Repository: AltimateAI/altimate-code

Length of output: 50


🏁 Script executed:

cd /tmp/altimate-code && rg -n "Bridge/upstream-merge\|git log.*grep.*qiE" .github/workflows/ci.yml

Repository: AltimateAI/altimate-code

Length of output: 50


🏁 Script executed:

cd /tmp/altimate-code && wc -l .github/workflows/ci.yml && rg -n "git log" .github/workflows/ci.yml

Repository: AltimateAI/altimate-code

Length of output: 97


🏁 Script executed:

cd /tmp/altimate-code && sed -n '440,460p' .github/workflows/ci.yml

Repository: AltimateAI/altimate-code

Length of output: 1431


Broaden bridge/upstream subject matching to prevent false negatives on pushed commits.

Line 449's regex (bridge|merge) upstream only matches space-separated patterns. The repository's actual commit subjects use hyphenated variants like bridge-merge (confirmed in recent commits), which won't match. This causes strict mode to run on bridge pushes, reintroducing the original CI failure.

The proposed regex correctly matches these variants and should be applied before merge.

Suggested patch
-            if git log --format=%s "${{ github.event.before }}..${{ github.sha }}" \
-                 | grep -qiE '(bridge|merge) upstream'; then
+            BRIDGE_UPSTREAM_RE='(^|[[:space:][:punct:]])(upstream/merge-[^[:space:]]*|merge[[:space:]/_-]+upstream|bridge[[:space:]/_-]+(merge|upstream))([[:space:][:punct:]]|$)'
+            if git log --format=%s "${{ github.event.before }}..${{ github.sha }}" \
+                 | grep -qiE "$BRIDGE_UPSTREAM_RE"; then
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 448 - 451, Update the git-log subject
matching used in the if-condition that runs bun run script/upstream/analyze.ts:
replace the current grep regex '(bridge|merge) upstream' with a broader pattern
that accepts either a space or a hyphen and also matches hyphenated forms like
bridge-merge; for example change the grep invocation in the if block to use a
regex such as '(bridge|merge)(?:[ -]upstream|[-]merge)?' so commits like
"bridge-merge", "bridge-upstream" and "merge upstream" are all detected.

else
echo "Push to main — running marker check against pre-push state"
bun run script/upstream/analyze.ts --markers --base "${{ github.event.before }}" --strict
fi
elif [[ "${{ github.head_ref }}" == merge-upstream-* ]] || [[ "${{ github.head_ref }}" == upstream/merge-* ]]; then
echo "Upstream merge PR detected — running marker check in non-strict mode"
bun run script/upstream/analyze.ts --markers --base ${{ github.event.pull_request.base.ref }}
Expand Down
Loading