-
Notifications
You must be signed in to change notification settings - Fork 14
Production Release: Peanut Card UI + Decomplexify + Native app + Manteca collateral #1984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f066808
f1212fd
965dfe6
e3baf83
5aa1ef5
319cc87
47b23bd
b39bedb
b984284
8cf1674
44274c3
213f85d
bededd1
56fa351
c252869
e7e5be7
2d7cef5
93749d3
86bff35
a9db7cf
88c4c35
655197d
1b9da41
e496cc4
de242aa
2c47f92
5d56694
8bd1f68
62069d3
8fb3412
659cdba
a6dc4e7
e03acc0
9b453fc
c720bc2
9f4d562
22246b4
813deb9
b747450
ab263f1
21319ba
e1f287f
3ee497a
c44e154
da3ca5e
50a2767
586d7dd
a39c5cb
81254da
d15b6df
db1a114
d364319
994e22e
ff7f625
a806512
b954a92
b55e5e1
b190665
09eb992
7517baf
edec755
b6bc628
2cb6d6b
062db94
8280ce3
e8ab682
77d7697
2435c8f
f80e8e2
2eb1da3
ab1f5c2
881833c
e1afb44
c1a5358
5f010da
459843c
4a61a43
e1447dc
ee1d102
0ed4547
543dec5
1b53d32
95df05d
65981a0
808c2ba
fce4ad8
0a1d7b5
26a4c42
a9f78fc
a84aff9
28c5522
447bff7
b6457e7
b862e63
b21c935
1bc8f27
e1acc88
c07e37f
7a499e3
1ba725b
fe93ac8
543a531
7516aa8
4153e90
1c3ecea
886a0b0
115d841
8eaf694
8a5eb05
c1bae36
e4bc3a5
273e17d
385fdcc
b5a0fa2
2f2bfae
f121ef7
fabd8ba
48c9661
671a8af
ae19f30
479c4e7
2ee6ad0
3d8092e
8ebb82c
235f68f
2d96d08
f403315
432410b
cf3b946
e514e72
32ff2d3
aa759b5
bf6ebdd
b4b3b0a
efb48e9
55d72df
dbebf08
2d6cf0c
a432968
00325ed
238a96a
1ec41ad
0dae215
06457ed
4c00363
71f4e15
993e936
d39df0e
0ac5b17
9a8b21d
3686c09
35a2d02
886a718
2cd5124
355b9c0
73f73bc
47a01cc
8a388ec
889a6cf
7100640
c1665c1
1cd4ba5
cf6d941
92cd8f6
087b17f
2470f6f
db45b5c
68f7b67
d12de68
0c8c0b3
ad4d784
90e1328
df62fbb
c516016
a24b3c1
27e8047
65850c3
9bae410
0c2a15d
e57e351
ddb8894
a7a601e
8dbef7c
becdbc9
f63ee76
9862d77
92289de
53d14be
db6626c
e970806
4b18ee9
2785d8b
b184409
2c16130
e2ab807
03c8e7a
dbb7b07
76e77aa
84b1817
c57c28f
770341b
9514c1b
353f1db
19e325c
7fada5a
83b0de2
377f0f1
373dc05
411e4df
16d0ebe
79064b0
b560872
8e8d548
e48f812
80d930c
771992b
f8bfec5
67f40fa
74808c5
fe0e383
d9f4049
06b11ef
6286468
a9ab864
063d927
8aba664
649316e
f91d2e2
47f08bb
7ffef55
9198be7
c050d2f
9b66edc
423fb2b
b8d0dfa
0d96a46
e0444bf
ad76a8b
2d338d5
3a4a390
65782ef
5842b4f
1b4cd7d
35371dc
5d48f88
81695bd
0045c3f
de75a0b
722f257
9082d74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| CONTRIBUTING.md | ||
| ../AGENTS.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Snapshot baseline for the FE render contract — generated by the | ||
| # render-snapshot test in SNAPSHOT_MODE=write. Marking as | ||
| # linguist-generated collapses it in GitHub PR diffs (still tracked, | ||
| # still git-history-preserved). | ||
| src/components/TransactionDetails/__tests__/fixtures/render-baseline.json linguist-generated=true |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,76 @@ | ||||||||||||||||||||||||
| name: Deploy OTA Update (Capgo) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||
| branches: [main, dev] | ||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||
| channel: | ||||||||||||||||||||||||
| description: 'Capgo channel to deploy to' | ||||||||||||||||||||||||
| required: true | ||||||||||||||||||||||||
| default: 'staging' | ||||||||||||||||||||||||
| type: choice | ||||||||||||||||||||||||
| options: | ||||||||||||||||||||||||
| - development | ||||||||||||||||||||||||
| - staging | ||||||||||||||||||||||||
| - production | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||
| group: capgo-deploy-${{ github.ref }} | ||||||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||
| deploy: | ||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||
| submodules: true | ||||||||||||||||||||||||
| token: ${{ secrets.SUBMODULE_TOKEN }} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - uses: pnpm/action-setup@v4 | ||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||
| version: 10 | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - uses: actions/setup-node@v4 | ||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||
| node-version: '21.1.0' | ||||||||||||||||||||||||
| cache: 'pnpm' | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||
| run: pnpm install | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Build native static export | ||||||||||||||||||||||||
| run: node scripts/native-build.js | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Verify build output | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| test -d out && test -f out/index.html || (echo "ERROR: out/ directory missing or incomplete" && exit 1) | ||||||||||||||||||||||||
| echo "Bundle ready. File count: $(find out -type f | wc -l)" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Determine channel | ||||||||||||||||||||||||
| id: channel | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||||||||||||||||||||||||
| echo "name=${{ github.event.inputs.channel }}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||
| elif [ "${{ github.ref }}" = "refs/heads/main" ]; then | ||||||||||||||||||||||||
| echo "name=production" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| echo "name=staging" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Upload bundle to Capgo | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| npx @capgo/cli@latest bundle upload \ | ||||||||||||||||||||||||
| --channel ${{ steps.channel.outputs.name }} \ | ||||||||||||||||||||||||
| --apikey ${{ secrets.CAPGO_API_KEY }} \ | ||||||||||||||||||||||||
| --path ./out \ | ||||||||||||||||||||||||
| --auto-min-update-version \ | ||||||||||||||||||||||||
| --comment "${{ github.event.head_commit.message || 'Manual deploy' }}" | ||||||||||||||||||||||||
|
jjramirezn marked this conversation as resolved.
Dismissed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code injection vulnerability via unsanitized commit message. The workflow directly interpolates 🔒 Proposed fix: pass commit message via environment variable - name: Upload bundle to Capgo
+ env:
+ COMMIT_MSG: ${{ github.event.head_commit.message || 'Manual deploy' }}
run: |
npx `@capgo/cli`@latest bundle upload \
--channel ${{ steps.channel.outputs.name }} \
--apikey ${{ secrets.CAPGO_API_KEY }} \
--path ./out \
--auto-min-update-version \
- --comment "${{ github.event.head_commit.message || 'Manual deploy' }}"
+ --comment "$COMMIT_MSG"Environment variables are safely interpolated by the shell and prevent command injection. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: CodeQL[warning] 69-69: Code injection 🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Deployment summary | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| echo "## OTA Deployment" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||
| echo "- **Channel:** ${{ steps.channel.outputs.name }}" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||
| echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||
| echo "- **Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||
|
jjramirezn marked this conversation as resolved.
Dismissed
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| name: Code analysis | ||
|
|
||
| # Static-analysis diff comment on every PR. Runs the painscore + | ||
| # complexity + dup + churn analyzers on HEAD and base, posts the diff | ||
| # as an idempotent PR comment. | ||
| # | ||
| # Tool lives in mono/engineering/code-analysis. CI clones mono using | ||
| # SUBMODULE_TOKEN (same secret used for peanut-content sync) at the | ||
| # ref pinned by the MONO_REF repo variable (default 'main'). | ||
| # | ||
| # Threshold gate is advisory for the first 2 weeks (continue-on-error). | ||
| # Tighten by removing continue-on-error once the team is acclimatised. | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main, master, dev] | ||
| # Skip code-analysis on doc-only commits — pure overhead. Not a | ||
| # required gate (just a comment), so paths-ignore is safe here. | ||
| paths-ignore: | ||
| - '**/*.md' | ||
| - 'docs/**' | ||
| - '.gitignore' | ||
| - '.editorconfig' | ||
| - 'src/content/**' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| env: | ||
| MONO_REF: ${{ vars.MONO_REF || 'main' }} | ||
|
|
||
| jobs: | ||
| analyze: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout PR head | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: false | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
|
jjramirezn marked this conversation as resolved.
Dismissed
|
||
| with: | ||
| version: 10 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Clone mono (for analyzer) | ||
| env: | ||
| TOKEN: ${{ secrets.MONO_READ_TOKEN }} | ||
| run: | | ||
| git clone --depth 1 --branch "$MONO_REF" \ | ||
| "https://x-access-token:${TOKEN}@github.com/peanutprotocol/mono.git" /tmp/mono | ||
|
|
||
| - name: Install analyzer deps | ||
| working-directory: /tmp/mono/engineering/code-analysis | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| # ---- HEAD analysis | ||
| - name: Analyze HEAD | ||
| run: | | ||
| node /tmp/mono/engineering/code-analysis/bin/analyze.mjs \ | ||
| --root . \ | ||
| --include src \ | ||
| --extensions .ts,.tsx \ | ||
| --analyzers complexity,cognitive,structural-dup,dead-code,import-graph,churn,type-errors,ts-quality,react,nextjs \ | ||
| --filter jsx-aware \ | ||
| --use-ast \ | ||
| --parallel \ | ||
| --label peanut-ui-head \ | ||
| --out-dir analysis-head | ||
|
|
||
| # ---- BASE analysis (fetch + worktree the PR base ref) | ||
| - name: Checkout base ref into a worktree | ||
| run: | | ||
| git fetch origin "${{ github.base_ref }}":base-ref | ||
| git worktree add ../base-tree base-ref | ||
|
|
||
| - name: Analyze base | ||
| run: | | ||
| node /tmp/mono/engineering/code-analysis/bin/analyze.mjs \ | ||
| --root ../base-tree \ | ||
| --include src \ | ||
| --extensions .ts,.tsx \ | ||
| --analyzers complexity,cognitive,structural-dup,dead-code,import-graph,churn,type-errors,ts-quality,react,nextjs \ | ||
| --filter jsx-aware \ | ||
| --use-ast \ | ||
| --parallel \ | ||
| --label peanut-ui-base \ | ||
| --out-dir analysis-base | ||
|
|
||
| # ---- Diff | ||
| - name: Diff | ||
| run: | | ||
| node /tmp/mono/engineering/code-analysis/bin/diff.mjs \ | ||
| --base analysis-base \ | ||
| --head analysis-head \ | ||
| --out diff.md \ | ||
| --out-json diff.json | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: code-analysis-${{ github.event.pull_request.number }} | ||
| path: | | ||
| analysis-head/ | ||
| diff.md | ||
| diff.json | ||
| retention-days: 14 | ||
|
|
||
| # ---- PR comment (idempotent — re-edits prior comment) | ||
| - name: Comment on PR | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const body = fs.readFileSync('diff.md', 'utf-8'); | ||
| const { data: comments } = await github.rest.issues.listComments({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| }); | ||
| const tag = '<!-- code-analysis -->'; | ||
| const existing = comments.find(c => c.body && c.body.includes(tag)); | ||
| const final = tag + '\n' + body; | ||
| if (existing) { | ||
| await github.rest.issues.updateComment({ | ||
| comment_id: existing.id, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: final, | ||
| }); | ||
| } else { | ||
| await github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: final, | ||
| }); | ||
| } | ||
|
|
||
| # ---- Regression gate (advisory for first 2 weeks) | ||
| - name: Fail if regression > 50 net findings | ||
| continue-on-error: true | ||
| run: | | ||
| NET=$(node -e "console.log(require('./diff.json').counts.net)") | ||
| echo "Net new findings: $NET" | ||
| if [ "$NET" -gt 50 ]; then | ||
| echo "::warning::+$NET net findings (threshold: 50)" | ||
| exit 1 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Supply-chain freshness | ||
|
|
||
| # Blocks PRs that add or upgrade a dependency to a version published less than | ||
| # 14 days ago. Defense against compromised npm packages that get yanked within | ||
| # hours of publish. Policy doc: AGENTS.md → "Supply chain". | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ['**'] | ||
| paths: | ||
| - 'package.json' | ||
| - 'pnpm-lock.yaml' | ||
| - '.npmrc' | ||
| - 'scripts/check-min-release-age.mjs' | ||
| - '.github/workflows/supply-chain-check.yml' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| check-min-release-age: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '21.1.0' | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
|
jjramirezn marked this conversation as resolved.
Dismissed
|
||
| with: | ||
| version: 10 | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Resolve base package.json | ||
| run: | | ||
| git fetch origin "${{ github.base_ref }}" | ||
| git show "origin/${{ github.base_ref }}:package.json" > /tmp/base-package.json | ||
|
|
||
| - name: Check min release age | ||
| run: node scripts/check-min-release-age.mjs --base /tmp/base-package.json | ||
|
jjramirezn marked this conversation as resolved.
Dismissed
|
||
Uh oh!
There was an error while loading. Please reload this page.