Conversation
|
Greetings, @ali-ahnaf. Thy scroll hath arrived unblemished — the runes align and no conflict bars the path. The council shall now convene over its contents, weighing each incantation by candlelight. Tarry a while, brave adventurer; we shall investigate and return to thee with our verdict. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe pending expense flow now refreshes dashboard transactions after transaction creation. Deployment documentation adds GitHub CLI secret management instructions. The README updates a contributor level. ChangesPending expense transaction refresh
Deployment secret documentation
Contributor roster update
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant PendingExpenseDetailModal
participant PendingExpensesPanel
participant DashboardPage
PendingExpenseDetailModal->>PendingExpensesPanel: report resolution and transactionCreated status
PendingExpensesPanel->>DashboardPage: invoke onTransactionCreated when true
DashboardPage->>DashboardPage: refresh transaction data
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@documentation/deployment.md`:
- Line 17: Update the VAPID_PUBLIC_KEY documentation entry to state that it must
match the API’s VAPID_PUBLIC_KEY, not the private key. Keep the existing UI
build variable reference and security guidance unchanged.
- Line 23: Update the deployment instructions to use the canonical repository
name ali-ahnaf/pocket_pixel and explicitly include --repo ali-ahnaf/pocket_pixel
in gh secret commands. Do not rely on the current Git remote, and remove the
incorrect ali-ahnaf/pixel_pocket reference.
- Around line 25-32: Update the deployment documentation around the single-line
secret examples to remove the claim that stdin prevents values from appearing in
shell history. State only that values are not passed as gh arguments, or revise
the examples to obtain sensitive values interactively or from files.
- Line 50: Update the deployment guidance around the manual workflow command to
use `gh run rerun <run-id>`, since `.github/workflows/ci-cd.yml` does not expose
a `workflow_dispatch` trigger; alternatively, add that trigger to the workflow
and document the supported dispatch command.
- Line 48: Update the deployment secrets guidance to reflect the per-job
configuration in ci-cd.yml: document HOSTINGER_VPS_* and API_ENV as production
environment secrets for deploy, and VAPID_PUBLIC_KEY as a repository-level
secret for build; remove the blanket instruction against using --env/--org.
In `@packages/ui/src/components/pending-expenses/PendingExpenseDetailModal.tsx`:
- Line 114: Update the pending-expense resolution flow around
deletePendingExpense and createTransaction so transaction creation and
pending-expense cleanup cannot leave a partially completed retryable state.
Prefer a server-side operation that atomically creates the transaction and
deletes the pending expense; otherwise add a stable idempotency key to
createTransaction, handle cleanup failures explicitly, and call onResolved only
after the combined operation succeeds.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 72f22dc2-3c8e-418d-ade6-8147f846da6e
📒 Files selected for processing (5)
README.mddocumentation/deployment.mdpackages/ui/src/app/page.tsxpackages/ui/src/components/pending-expenses/PendingExpenseDetailModal.tsxpackages/ui/src/components/pending-expenses/PendingExpensesPanel.tsx
| | `HOSTINGER_VPS_APP_DIR` | App dir on VPS, e.g. `/var/www/pocket_pixel` | | ||
| | `HOSTINGER_VPS_SSH_KEY` | Private SSH key (deploy job strips `\r`) | | ||
| | `API_ENV` | **Entire content** of the API `.env` — written verbatim to `packages/api/.env` on the VPS every deploy | | ||
| | `VAPID_PUBLIC_KEY` | Web Push VAPID public key — inlined into the UI build as `NEXT_PUBLIC_VAPID_PUBLIC_KEY` (see the `Build UI` step). Not secret, but must match the API's private key. | |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Reference the API public key, not the private key.
Line 17 says VAPID_PUBLIC_KEY must match the API private key. The UI value must match the API's VAPID_PUBLIC_KEY; line 57 already states this. If a user follows line 17 and supplies VAPID_PRIVATE_KEY, the build exposes the signing key through NEXT_PUBLIC_VAPID_PUBLIC_KEY.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@documentation/deployment.md` at line 17, Update the VAPID_PUBLIC_KEY
documentation entry to state that it must match the API’s VAPID_PUBLIC_KEY, not
the private key. Keep the existing UI build variable reference and security
guidance unchanged.
|
|
||
| ### Setting the secrets with the `gh` CLI | ||
|
|
||
| Requires `gh` authenticated with `repo` scope (`gh auth login`, verify with `gh auth status`). All commands below assume you are inside the repo clone so `gh` resolves `ali-ahnaf/pixel_pocket` from the git remote; otherwise add `--repo ali-ahnaf/pixel_pocket`. `gh secret set` creates or overwrites — there is no separate update command, and existing values can never be read back, only replaced. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Target the canonical repository explicitly.
Line 23 names ali-ahnaf/pixel_pocket, but this repository is ali-ahnaf/pocket_pixel. The commands also inherit the current Git remote, so a fork clone can store secrets in the wrong repository. Use --repo ali-ahnaf/pocket_pixel, or state that the remote must point to the canonical repository.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@documentation/deployment.md` at line 23, Update the deployment instructions
to use the canonical repository name ali-ahnaf/pocket_pixel and explicitly
include --repo ali-ahnaf/pocket_pixel in gh secret commands. Do not rely on the
current Git remote, and remove the incorrect ali-ahnaf/pixel_pocket reference.
| Single-line values — pass them on stdin rather than as an argument so they never land in your shell history: | ||
|
|
||
| ```bash | ||
| printf '%s' '203.0.113.10' | gh secret set HOSTINGER_VPS_HOST | ||
| printf '%s' '22' | gh secret set HOSTINGER_VPS_PORT | ||
| printf '%s' 'deploy' | gh secret set HOSTINGER_VPS_USER | ||
| printf '%s' '/var/www/pocket_pixel' | gh secret set HOSTINGER_VPS_APP_DIR | ||
| printf '%s' 'BB...public-key...' | gh secret set VAPID_PUBLIC_KEY |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Do not claim that these examples avoid shell history.
printf '%s' 'value' still places value in the shell command line and shell history. Change the text to say that the value is not passed as a gh argument, or read sensitive single-line values from an interactive or file-based source.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@documentation/deployment.md` around lines 25 - 32, Update the deployment
documentation around the single-line secret examples to remove the claim that
stdin prevents values from appearing in shell history. State only that values
are not passed as gh arguments, or revise the examples to obtain sensitive
values interactively or from files.
| - `API_ENV` is the whole `.env` file, not one variable. Re-run the `--body-file` command after adding any new API env var; the local `packages/api/.env` may contain dev-only values, so keep a prod copy (e.g. `~/pocket_pixel/prod.env`) and set the secret from that instead of from the working tree. | ||
| - Verify names and update timestamps (values are never shown): `gh secret list`. | ||
| - Remove one with `gh secret delete <NAME>`. | ||
| - These are repo-level Actions secrets, which is what `ci-cd.yml` reads. Don't pass `--env`/`--org` unless you also rewire the workflow to an environment. |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
rg -n -C 4 'environment:|secrets\.(HOSTINGER_VPS_|API_ENV|VAPID_PUBLIC_KEY)' .github/workflows/ci-cd.ymlRepository: ali-ahnaf/pocket_pixel
Length of output: 1834
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '--- deployment docs lines 1-80 ---\n'
sed -n '1,80p' documentation/deployment.md
printf '\n--- ci-cd workflow top/context ---\n'
sed -n '1,120p' .github/workflows/ci-cd.yml
printf '\n--- relevant docs references to secrets/env flags ---\n'
rg -n -C 3 'secret|secrets|--env|BUILD|HOSTINGER|VAPID|API_ENV' documentation/deployment.mdRepository: ali-ahnaf/pocket_pixel
Length of output: 251
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- deployment docs lines 1-80 ---'
sed -n '1,80p' documentation/deployment.md
printf '%s\n' ''
printf '%s\n' '--- ci-cd workflow top/context ---'
sed -n '1,120p' .github/workflows/ci-cd.yml
printf '%s\n' ''
printf '%s\n' '--- relevant docs references to secrets/env flags ---'
rg -n -C 3 'secret|secrets|--env|BUILD|HOSTINGER|VAPID|API_ENV' documentation/deployment.mdRepository: ali-ahnaf/pocket_pixel
Length of output: 15225
Document per-job secret visibility.
.github/workflows/ci-cd.yml already sets deploy to environment: production, while build has no environment. Replace the blanket “don’t pass --env/--org” note with scoped guidance: deploy secrets such as HOSTINGER_VPS_* and API_ENV should be environment secrets on production; VAPID_PUBLIC_KEY needs repository-level visibility because the build job reads it.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@documentation/deployment.md` at line 48, Update the deployment secrets
guidance to reflect the per-job configuration in ci-cd.yml: document
HOSTINGER_VPS_* and API_ENV as production environment secrets for deploy, and
VAPID_PUBLIC_KEY as a repository-level secret for build; remove the blanket
instruction against using --env/--org.
| - Remove one with `gh secret delete <NAME>`. | ||
| - These are repo-level Actions secrets, which is what `ci-cd.yml` reads. Don't pass `--env`/`--org` unless you also rewire the workflow to an environment. | ||
|
|
||
| After changing a secret, the next push to `main` picks it up — editing only `.md`/`.yml` files does not trigger a run, so re-run the last workflow manually if you need a deploy without a code change: `gh workflow run ci-cd.yml --ref main`. |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
rg -n -C 4 'workflow_dispatch|^on:' .github/workflows/ci-cd.ymlRepository: ali-ahnaf/pocket_pixel
Length of output: 267
🏁 Script executed:
#!/bin/bash
set -e
printf 'deployment.md line 50 context:\n'
sed -n '44,56p' documentation/deployment.md
printf '\nci-cd.yml workflow dispatch section:\n'
sed -n '1,40p' .github/workflows/ci-cd.ymlRepository: ali-ahnaf/pocket_pixel
Length of output: 2323
Fix the manual-redispatch command.
.github/workflows/ci-cd.yml has no workflow_dispatch trigger, so gh workflow run ci-cd.yml --ref main will fail. Document gh run rerun <run-id> instead, or add workflow_dispatch and mention that option in this section.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@documentation/deployment.md` at line 50, Update the deployment guidance
around the manual workflow command to use `gh run rerun <run-id>`, since
`.github/workflows/ci-cd.yml` does not expose a `workflow_dispatch` trigger;
alternatively, add that trigger to the workflow and document the supported
dispatch command.
| }); | ||
| await profileApi.deletePendingExpense(userId, item.id); | ||
| onResolved(item.id); | ||
| onResolved(item.id, true); |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
rg -n -C 12 '\b(createTransaction|deletePendingExpense|resolvePendingExpense)\b' .Repository: ali-ahnaf/pocket_pixel
Length of output: 28356
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "## PendingExpenseDetailModal.tsx"
sed -n '70,120p' packages/ui/src/components/pending-expenses/PendingExpenseDetailModal.tsx | cat -n
echo
echo "## ProfileApi.ts relevant methods"
sed -n '160,182p' packages/ui/src/lib/api/ProfileApi.ts | cat -n
echo
echo "## shared DTOs for transactions/pending expenses"
rg -n "PendingGmailExpenseDto|createTransaction|pending-expenses|idempotency|Idempotency|idempotent|X-Idempotency-Key|idempotency-key|Idempotency-Key|Idempotent" -S . --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' || true
echo
echo "## API route references for pending-expenses/transactions"
rg -n "pending-expenses|/transactions|transactions" -S . --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' | head -200Repository: ali-ahnaf/pocket_pixel
Length of output: 37074
Make pending-expense resolution atomic or idempotent.
deletePendingExpense can fail after createTransaction succeeds, so cleanup never runs and onResolved is not called. A retry can duplicate the transaction because createTransaction has no client-side idempotency key. Add a server-side endpoint that creates the transaction and deletes the pending expense atomically, or make the client retry path idempotent and surface/delete cleanup failures.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/ui/src/components/pending-expenses/PendingExpenseDetailModal.tsx` at
line 114, Update the pending-expense resolution flow around deletePendingExpense
and createTransaction so transaction creation and pending-expense cleanup cannot
leave a partially completed retryable state. Prefer a server-side operation that
atomically creates the transaction and deletes the pending expense; otherwise
add a stable idempotency key to createTransaction, handle cleanup failures
explicitly, and call onResolved only after the combined operation succeeds.
Summary by CodeRabbit
Bug Fixes
Documentation