Skip to content

fix(ci): run repo-local validation on stacked PR bases - #1587

Open
seonghobae wants to merge 7 commits into
developfrom
fix/stacked-pr-local-ci
Open

fix(ci): run repo-local validation on stacked PR bases#1587
seonghobae wants to merge 7 commits into
developfrom
fix/stacked-pr-local-ci

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Current authority — 2026-09-08

  • protected base: develop@042b0c70531b229af3acbd0421a2f23098d848b3
  • source head: 48bd9efe3509496060386691a8c29d0f06b6b92e
  • lifecycle: Ready / independently approved / mergeable / not merge-authorized
  • effective scope: four repo-local PR-validation branch filters plus backend/tests/test_stacked_pr_workflow_triggers.py and reusable AGENTS.md trigger-test guidance
  • compare remains ahead-only from protected develop; no force update or base rewrite

Problem and causal repair

Repository-owned PR validation was filtered to long-lived target branches. A stacked PR targeting a feature-stack base could therefore have zero Application/Bandit/Dependency-Review/Docker PR runs even when its source head contained product/deployment changes.

The source fix adds the all-base ** pull-request target pattern to the four repo-local validation workflows without changing push/tag publication conditions, permissions, action pins, release behavior, or canonical central-workflow ownership.

The original guard inspected workflow source text. That was insufficient: a comment containing ** could satisfy the test, and an ordered negative pattern after ** could still exclude a feature-stack base. Ordinary descendants preserved the source fix and strengthened the regression:

  • 8cd91ee71eb355b7c33876910e88719cfc7ec1f4 parses the event configuration with the already hash-locked PyYAML BaseLoader, preserving the Actions on key, and rejects both comment-only wildcards and later negative exclusions;
  • 48bd9efe3509496060386691a8c29d0f06b6b92e records that reusable parser/ordered-pattern contract in AGENTS.md.

No additional YAML parser or runtime dependency was introduced.

Corrected CI evidence authority

The repo-local runs associated with this PR are terminal: Application CI 34183119049, Bandit 34183119055, Docker 34183119159, Security 34183119059, and Semgrep 34183119012 succeeded; CodeQL PR 34183119016 failed at the shared verdict bridge. However, the Application/Bandit/Docker jobs must no longer be described as source-head checkout proof.

GitHub's current pull_request event contract sets GITHUB_REF to refs/pull/<number>/merge and GITHUB_SHA to the merge commit for an open mergeable PR. The protected repo-local workflows use actions/checkout without an explicit ref, so those PR jobs execute the GitHub merge ref by default. Their success proves combined-tree compatibility associated with this PR revision, not execution of the literal source commit 48bd9efe....

Primary GitHub authority: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request

This newly verified evidence-integrity gap is not repaired by rewriting #1587 history. Stacked child #1600 owns a RED-first repair requiring ref: ${{ github.event.pull_request.head.sha || github.sha }} in Application CI, Bandit, Dependency Review, and Docker, and binds retained browser PNG identity to the same source-head SHA. #1600 has already demonstrated that Application/Bandit/Docker events are generated when a dependent PR targets this #1587 feature base, so the all-base trigger behavior has live acceptance evidence even though source checkout still needs the child repair.

Dependency Review is a separate caveat: no recent repo-local Dependency Review run was generated for #1600 despite the #1587 branch containing the all-base filter. Protected develop still contains the older long-lived-base filter. This absence remains non-passing evidence and must be resolved rather than inferred away before #1587 can be treated as fully proven across all four workflows.

CodeRabbit submitted formal APPROVED review after the latest #1587 push at 2026-09-08T03:33:11Z. Current inline review-thread inventory is empty. The older OpenCode CHANGES_REQUESTED submission is bound to predecessor bc83f3f... and its then-failed checks; it is retained as history and is not treated as current-source-head approval or finding.

CodeQL language detection completed successfully. The actions, python, and javascript-typescript compatibility jobs each read the current-head dispatch verdict and then failed at Release runner or enforce current-head CodeQL verdict; the later Dispatch current-head CodeQL scan job completed successfully. The canonical recovery remains in the .github owner path, not this Naruon branch.

Stack succession

After this source head normally integrates into protected develop, #1600 must be ordinary-restacked/retargeted and must prove literal source-head checkout plus downloadable hosted PNG evidence. Only after that prerequisite is integrated should dependent deployment/product branches be synchronized and revalidated.

Merge #1587 only after every then-live protected repository/organization context is terminal-success, the missing Dependency Review behavior is explained/repaired with evidence, and no valid source finding remains. No self-approval, bypass/admin merge, force-push, destructive rebase, dummy/no-op requeue, predecessor evidence transfer, synthetic status, central workflow copy, or gate weakening.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 15cc55af-3dce-4bae-b801-5ef50a9ed91c

📥 Commits

Reviewing files that changed from the base of the PR and between bc83f3f and 48bd9ef.

📒 Files selected for processing (2)
  • AGENTS.md
  • backend/tests/test_stacked_pr_workflow_triggers.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Four GitHub Actions workflows now run for pull requests targeting any branch. Pytest validates the workflow triggers and rejects excluded or comment-only wildcard patterns. AGENTS.md documents the validation requirements.

Changes

Pull-request validation triggers

Layer / File(s) Summary
Expand workflow branch triggers
.github/workflows/app-ci.yml, .github/workflows/bandit.yml, .github/workflows/dependency-review.yml, .github/workflows/docker-publish.yml
The four workflows now include the ** branch pattern for pull-request events.
Validate stacked pull-request triggers
backend/tests/test_stacked_pr_workflow_triggers.py, AGENTS.md
The test parses workflow YAML with yaml.BaseLoader, checks pull-request branch filters, and rejects later exclusions or comment-only wildcards. AGENTS.md documents these checks and the required parser.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 48bd9

Pull-request CI, security, dependency, and Docker validation now run for stacked pull requests targeting any branch. The trigger configuration and regression coverage support the intended behavior with no remaining merge-blocking risk.

Suggested reviewers: cursoragent

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling repository-local CI validation for stacked pull request bases.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/stacked-pr-local-ci

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as ready for review September 7, 2026 04:55

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

현재 exact head bc83f3f11c90aef94633436b5ce78927c90211e1만 독립 검토해 주세요. protected develop@042b0c70531b229af3acbd0421a2f23098d848b3 대비 5-file delta이며, 핵심 acceptance는 dependent stacked PR base에서도 repo-local Application CI/Bandit/Dependency Review/Docker validation이 trigger되는지와 기존 push/tag/release/security 경계가 그대로인지입니다. predecessor review/evidence는 이 head 승인으로 이전하지 않습니다.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 7, 2026
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_commit='bc83f3f11c90aef94633436b5ce78927c90211e1'
base_commit='042b0c70531b229af3acbd0421a2f23098d848b3'

printf '%s\n' '== Commit verification =='
git cat-file -t "$head_commit"
git cat-file -t "$base_commit"
git merge-base --is-ancestor "$base_commit" "$head_commit" && echo 'base_is_ancestor=yes'
git diff --name-status "$base_commit" "$head_commit"
printf '\n%s\n' '== Exact diff =='
git diff --find-renames --find-copies --unified=80 "$base_commit" "$head_commit" -- \
  .github/workflows/app-ci.yml \
  .github/workflows/bandit.yml \
  .github/workflows/dependency-review.yml \
  .github/workflows/docker-publish.yml \
  backend/tests/test_stacked_pr_workflow_triggers.py

printf '\n%s\n' '== Workflow AST outlines =='
ast-grep outline .github/workflows/app-ci.yml --items all || true
ast-grep outline .github/workflows/bandit.yml --items all || true
ast-grep outline .github/workflows/dependency-review.yml --items all || true
ast-grep outline .github/workflows/docker-publish.yml --items all || true

printf '\n%s\n' '== Current workflow files with line numbers =='
for f in \
  .github/workflows/app-ci.yml \
  .github/workflows/bandit.yml \
  .github/workflows/dependency-review.yml \
  .github/workflows/docker-publish.yml \
  backend/tests/test_stacked_pr_workflow_triggers.py
do
  echo "--- $f"
  cat -n "$f"
done

Length of output: 44568


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_commit='bc83f3f11c90aef94633436b5ce78927c90211e1'
base_commit='042b0c70531b229af3acbd0421a2f23098d848b3'
workflows=(
  .github/workflows/app-ci.yml
  .github/workflows/bandit.yml
  .github/workflows/dependency-review.yml
  .github/workflows/docker-publish.yml
)

printf '%s\n' '== Diff whitespace check =='
git diff --check "$base_commit" "$head_commit"

printf '\n%s\n' '== Changed lines only =='
git diff --unified=0 "$base_commit" "$head_commit" -- "${workflows[@]}" \
  backend/tests/test_stacked_pr_workflow_triggers.py

printf '\n%s\n' '== Security and publication boundary comparison =='
for revision in "$base_commit" "$head_commit"; do
  echo "--- $revision"
  for workflow in "${workflows[@]}"; do
    echo "[$workflow]"
    git show "${revision}:${workflow}" |
      grep -nE '^(on:|  (pull_request|push|workflow_dispatch):|    (branches|tags):|permissions:|  permissions:|    permissions:|    if:|      - name: (Log in to GHCR|Build PR image without publishing|Build and publish Docker image)|          (push|sbom):|          persist-credentials:)' \
      || true
  done
done

printf '\n%s\n' '== Test target list and workflow trigger declarations at exact head =='
git show "${head_commit}:backend/tests/test_stacked_pr_workflow_triggers.py" | sed -n '1,120p'
for workflow in "${workflows[@]}"; do
  echo "--- $workflow"
  git show "${head_commit}:${workflow}" | sed -n '1,25p'
done

Length of output: 10759


@seonghobae 독립 검토를 완료했습니다.

develop@042b0c70531b229af3acbd0421a2f23098d848b3부터 exact head bc83f3f11c90aef94633436b5ce78927c90211e1까지의 5-file delta만 검토했습니다. 이전 검토 또는 이전 증거는 사용하지 않았습니다.

문제를 찾지 못했습니다.

  • 네 개의 repository-local workflow는 모두 pull_request.branches"**"를 포함합니다. 따라서 dependent stacked PR base를 대상으로도 Application CI, Bandit, Dependency Review, Docker image validation이 생성됩니다.
  • Application CI와 Bandit의 push branch 경계는 변경되지 않았습니다.
  • Docker workflow의 tag trigger, publish_images, deploy_preflight, deploy_to_aks 조건은 계속 pushrefs/tags/v로 제한됩니다.
  • PR image validation은 계속 push: false입니다.
  • 권한, action SHA pin, persist-credentials: false, dependency-review security gate는 변경되지 않았습니다.
  • 새 회귀 테스트는 네 workflow 모두를 대상으로 all-base PR trigger 계약을 검사합니다.
  • git diff --check도 오류 없이 완료되었습니다.

GitHub가 protected develop에 병합한 뒤 exact-head workflow runs를 생성하는지에 대한 실행 검증은 별도로 필요합니다.

⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for bc83f3f11c90aef94633436b5ce78927c90211e1.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: app-ci.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: app-ci.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Workflow: bandit.yml"]
  S2 --> I2["GitHub Actions review job"]
  I2 --> R2["Review risk: Workflow: bandit.yml"]
  R2 --> V2["actionlint plus required checks"]
  Evidence --> S3["Workflow: dependency-review.yml"]
  S3 --> I3["GitHub Actions review job"]
  I3 --> R3["Review risk: Workflow: dependency-review.yml"]
  R3 --> V3["actionlint plus required checks"]
  Evidence --> S4["Workflow: docker-publish.yml"]
  S4 --> I4["GitHub Actions review job"]
  I4 --> R4["Review risk: Workflow: docker-publish.yml"]
  R4 --> V4["actionlint plus required checks"]
  Evidence --> S5["Test: test_stacked_pr_workflow_triggers.py"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test: test_stacked_pr_workflow_triggers.py"]
  R5 --> V5["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head regression repair 8cd91ee: the previous source-regex guard accepted a later !feature/** exclusion and an all-branch wildcard appearing only in a comment. Added both adversarial fixtures; predecessor result was 2 failed / 4 passed because the expected rejection did not occur. The guard now parses Actions YAML with BaseLoader (preserving on as a string), requires the PR event, rejects branches-ignore and excludes negative patterns after the final all-branch wildcard. No workflow behavior was weakened. Fixed suite: 6 passed in20.50s with -W error, terminal0; same committed suite with GITHUB_ACTIONS=true:6passed0.09s terminal0. Ruff/diff checks passed. New Application CI34182997104 and central CodeQL PR34182997073 are actual queued runs for this head, not successful results. No empty requeue commit or lifecycle toggle was used. Previous bc83f3f checks/reviews are historical only.

Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Visual inspection receipt — 48bd9ef: inspected the rendered AGENTS.md PR automation and review defaults section in the real in-app browser at 1265×712. The new stacked-trigger parsing paragraph is fully visible, wraps normally, and has no observed clipping or overlap. Scope is this documentation paragraph only; this is not product UI, mobile, accessibility, or deployment acceptance. Current-head required checks remain queued; predecessor test results are not hosted current-head gate evidence.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Hosted current-head backend evidence: 48bd9ef, Application CI run34183119049, backend job101926049444 is terminal success. Actual Python3.14 log reports 1813 passed, 32 skipped in15.45s; backend lint also passed. This supersedes local-only evidence for that job, not for the full rollup. Frontend job101926049244 remains in progress after build completion; product smoke and other required reviews/security checks are not yet claimed complete. No head change or rerun was made.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Coordination: preserve the current trigger-fix lane. The independently identified smoke evidence gaps warrant a focused successor, not a claim that the current desktop mocked smoke proves live backend/mobile/all-locale behavior. Please carry unknown API fallback rejection, console-error checks after critical/accessibility interactions, and retained screenshot artifacts with regression cases; first check for an existing owner. Keep endpoint fixtures explicit, preserve failing evidence, and never turn proxy_fetch_failed into an accepted message without identifying its actual request. Package publishing keys do not establish cluster deployment readiness.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 48bd9efe3509496060386691a8c29d0f06b6b92e.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: app-ci.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: app-ci.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Workflow: bandit.yml"]
  S2 --> I2["GitHub Actions review job"]
  I2 --> R2["Review risk: Workflow: bandit.yml"]
  R2 --> V2["actionlint plus required checks"]
  Evidence --> S3["Workflow: dependency-review.yml"]
  S3 --> I3["GitHub Actions review job"]
  I3 --> R3["Review risk: Workflow: dependency-review.yml"]
  R3 --> V3["actionlint plus required checks"]
  Evidence --> S4["Workflow: docker-publish.yml"]
  S4 --> I4["GitHub Actions review job"]
  I4 --> R4["Review risk: Workflow: docker-publish.yml"]
  R4 --> V4["actionlint plus required checks"]
  Evidence --> S5["Repository file: AGENTS.md"]
  S5 --> I5["repository behavior"]
  I5 --> R5["Review risk: Repository file: AGENTS.md"]
  R5 --> V5["required checks"]
  Evidence --> S6["Test: test_stacked_pr_workflow_triggers.py"]
  S6 --> I6["regression suite"]
  I6 --> R6["Review risk: Test: test_stacked_pr_workflow_triggers.py"]
  R6 --> V6["targeted test run"]
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high High-priority or P1 work type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant