Skip to content

Commit 474d40a

Browse files
feat!(action): simplify v2 flow to CLI incremental/full contract (#69)
* feat(action): simplify action flow to incremental/full CLI contract * fix(action): restore manifest and CI checks * fix(ci): align dogfood workflows with action inputs * fix(lint): make local runner shellcheck clean * fix(action): restore review authentication compatibility Amp-Thread-ID: https://ampcode.com/threads/T-019fc956-723a-737d-a4ac-b0470f146cd4 Co-authored-by: Amp <amp@ampcode.com> * fix(action): run engine on supported Python Amp-Thread-ID: https://ampcode.com/threads/T-019fc956-723a-737d-a4ac-b0470f146cd4 Co-authored-by: Amp <amp@ampcode.com> * fix(action): honor engine fallback contract Amp-Thread-ID: https://ampcode.com/threads/T-019fc956-723a-737d-a4ac-b0470f146cd4 Co-authored-by: Amp <amp@ampcode.com> * fix(action): surface engine contract errors Amp-Thread-ID: https://ampcode.com/threads/T-019fc956-723a-737d-a4ac-b0470f146cd4 Co-authored-by: Amp <amp@ampcode.com> * fix(action): parse logged engine responses Amp-Thread-ID: https://ampcode.com/threads/T-019fc956-723a-737d-a4ac-b0470f146cd4 Co-authored-by: Amp <amp@ampcode.com> * fix(action): normalize direct LLM keys Amp-Thread-ID: https://ampcode.com/threads/T-019fc956-723a-737d-a4ac-b0470f146cd4 Co-authored-by: Amp <amp@ampcode.com> * fix(review): retain baseline through rendering Amp-Thread-ID: https://ampcode.com/threads/T-019fc956-723a-737d-a4ac-b0470f146cd4 Co-authored-by: Amp <amp@ampcode.com> * fix(review): read boolean render metadata Amp-Thread-ID: https://ampcode.com/threads/T-019fc956-723a-737d-a4ac-b0470f146cd4 Co-authored-by: Amp <amp@ampcode.com> * fix(review): post rendered diagram content Amp-Thread-ID: https://ampcode.com/threads/T-019fc956-723a-737d-a4ac-b0470f146cd4 Co-authored-by: Amp <amp@ampcode.com> * fix(action): stream CLI progress logs * fix(review): restore slash command feedback * fix(review): refine comment presentation * fix(sync): preserve user CodeBoarding config * feat!: simplify the v2 action contract Move orchestration into focused scripts, reduce persisted sync output to Core analysis state, support direct providers with model overrides, and route hosted OIDC requests through the deployed AWS proxy. BREAKING CHANGE: v2 removes deprecated v1 inputs and generated sync documentation. Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> * fix: resolve action paths and local fallbacks safely Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> * fix: remove deprecated artifact fallback Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> * chore: defer dogfood workflow cleanup Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> * fix(review): highlight components owning changed methods Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> * fix(action): address sync and cleanup edge cases Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> * fix(action): address final review edge cases Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> * fix(action): secure slash commands and dogfood inputs Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> * fix(review): link progress comment to workflow run Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> * docs(scripts): explain shell script purposes Amp-Thread-ID: https://ampcode.com/threads/T-019fdc90-d8c3-779f-92ce-ce9888aad94d Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com> --------- Co-authored-by: Amp <amp@ampcode.com>
1 parent fdcd7c6 commit 474d40a

31 files changed

Lines changed: 1990 additions & 6002 deletions

.github/workflows/codeboarding-sync.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ on:
4747
options: [push, pull_request]
4848
required: false
4949
default: push
50-
sync_pr_branch:
51-
description: 'Machine-owned branch used when sync_strategy is pull_request.'
52-
type: string
53-
required: false
54-
default: codeboarding/sync
5550

5651
# No workflow-level permissions: the single job below requests only what it
5752
# needs (least privilege), so the default token starts with none.
@@ -70,6 +65,7 @@ jobs:
7065
permissions:
7166
contents: write # push the generated baseline branch
7267
pull-requests: write # workflow_dispatch may exercise pull_request delivery
68+
id-token: write # mint per-request OIDC credentials for the relay
7369
steps:
7470
# Dogfood: run the action from the checked-out repo (uses: ./) so pushes to
7571
# main exercise the action code on main, not the last published release.
@@ -145,15 +141,9 @@ jobs:
145141
- uses: ./
146142
with:
147143
mode: sync
148-
force_full: ${{ inputs.force_full || false }}
149-
# Push events retain direct delivery to their branch. A manual
150-
# pull_request-strategy run targets main even though the workflow code
151-
# itself is checked out from the feature ref being dogfooded.
152-
target_branch: ${{ github.event_name == 'workflow_dispatch' && inputs.sync_strategy == 'pull_request' && 'main' || github.ref_name }}
153144
sync_strategy: ${{ inputs.sync_strategy || 'push' }}
154-
sync_pr_branch: ${{ inputs.sync_pr_branch || 'codeboarding/sync' }}
145+
force_full: ${{ inputs.force_full || false }}
155146
# App token authenticates the baseline push so the commit is attributed
156147
# to the CodeBoarding App (logo avatar). Falls back to the workflow token,
157148
# which can push because this job grants contents: write.
158-
push_token: ${{ steps.codeboarding-app-token-client.outputs.token || steps.codeboarding-app-token-app.outputs.token || github.token }}
159-
llm_api_key: ${{ secrets.OPENROUTER_API_KEY }}
149+
github_token: ${{ steps.codeboarding-app-token-client.outputs.token || steps.codeboarding-app-token-app.outputs.token || github.token }}

.github/workflows/codeboarding.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,24 @@ jobs:
3131
contents: read
3232
pull-requests: write # post / update the architecture-diff PR comment
3333
issues: write # the /codeboarding issue_comment trigger + comment API
34-
# Never auto-review the sync mode's own baseline PR (head branch
35-
# 'codeboarding/sync', the sync_pr_branch default): it only changes generated
36-
# files, so a diff comment would be noise. Scoped to THIS repo's head so a fork
37-
# PR that merely happens to name its branch 'codeboarding/sync' is still
38-
# reviewed normally. Consumers using sync_strategy: pull_request should match
39-
# this exclusion to their sync_pr_branch and, if they run other pull_request
40-
# workflows (tests, lint), exclude the branch there too (via a head_ref guard).
34+
id-token: write # mint per-request OIDC credentials for the relay
35+
# Never auto-review the fixed machine-owned 'codeboarding/sync' PR: it only
36+
# changes generated files, so a diff comment would be noise. Scope this to
37+
# this repository so a fork using the same branch name is still reviewed.
4138
if: >
4239
(github.event_name == 'pull_request' && github.event.action != 'closed' && github.event.pull_request.draft == false &&
40+
github.event.pull_request.head.repo.full_name == github.repository &&
4341
!(github.head_ref == 'codeboarding/sync' && github.event.pull_request.head.repo.full_name == github.repository)) ||
4442
(github.event_name == 'issue_comment' && github.event.issue.pull_request != null &&
4543
startsWith(github.event.comment.body, '/codeboarding') &&
4644
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
4745
steps:
48-
# Dogfood: run the action from the checked-out repo (uses: ./) so each PR
49-
# exercises the action code under review, not the last published release.
50-
# The action reads its scripts via github.action_path and checks the engine
51-
# and target repo into subdirectories, so this local checkout is untouched.
52-
#
53-
# On issue_comment events, checkout's default ref is the repo's DEFAULT
54-
# BRANCH (the event isn't tied to a PR), so `uses: ./` would run main's
55-
# action code, not this PR's — /codeboarding would silently test the wrong
56-
# version. Check out the PR head explicitly for that event so the comment
57-
# path dogfoods the PR under review too. pull_request events keep checkout's
58-
# default (the PR merge ref), which already points at the PR. On-demand runs
59-
# are restricted to same-repo PRs, so refs/pull/<n>/head resolves in this
60-
# repo (no fork-repo override needed).
46+
# Automatic same-repo reviews dogfood the PR action. Slash commands use the
47+
# trusted default-branch action, which can safely analyze a fork's head
48+
# without executing its action.yml with this job's OIDC permission.
6149
- uses: actions/checkout@v4
6250
with:
63-
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || '' }}
51+
ref: ${{ github.event_name == 'issue_comment' && github.event.repository.default_branch || '' }}
6452
- name: Detect CodeBoarding GitHub App credentials
6553
id: codeboarding-app-config
6654
shell: bash
@@ -123,4 +111,3 @@ jobs:
123111
- uses: ./
124112
with:
125113
github_token: ${{ steps.codeboarding-app-token-client.outputs.token || steps.codeboarding-app-token-app.outputs.token || github.token }}
126-
llm_api_key: ${{ secrets.OPENROUTER_API_KEY }}

0 commit comments

Comments
 (0)