feat: default custom topup amount to 100 - #5337
Conversation
|
Need an answer fast? Review this PR in Change Stack to ask focused questions about the PR or a changed range. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughRefactors the Docker multi-arch publish workflow (dynamic versioning, conditional Docker Hub publish/sign, conditional manifests) and normalizes front-end top-up defaults by introducing clamped defaults, a backend setting, and wiring across admin UIs and translations. ChangesDocker Build Workflow Restructure
Top-up Default Amount Normalization
Sequence Diagram(s)sequenceDiagram
participant Workflow as GitHub Action (docker-build)
participant Version as Version step
participant Build as build_single_arch
participant Manifest as create_manifests
participant GHCR as ghcr.io
participant DockerHub as docker.io
participant Cosign as cosign
Workflow->>Version: compute IMAGE_VERSION & PUBLISH_LATEST
Version->>Build: emit image_version, publish_latest
Build->>GHCR: push arch-tagged images
Build->>DockerHub: push arch-tagged images (if DOCKERHUB_ENABLED)
Build->>Cosign: sign images for GHCR (and Docker Hub if enabled)
Build->>Manifest: provide IMAGE_VERSION, PUBLISH_LATEST, DOCKERHUB_ENABLED
Manifest->>GHCR: create version manifest (always) and latest manifest (if publish_latest)
Manifest->>DockerHub: create manifests/tags (if dockerhub_enabled and publish_latest)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 1
🤖 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 `@web/default/src/features/wallet/lib/payment.ts`:
- Around line 149-154: The function getDefaultCustomTopupAmount can return NaN
when getMinTopupAmount(topupInfo) yields a non-finite value; normalize the min
value before comparing by checking Number.isFinite on the result of
getMinTopupAmount(topupInfo) (or equivalent finite check) and fallback to a safe
numeric default (e.g., 0) when non-finite, then return
Math.max(DEFAULT_CUSTOM_TOPUP_AMOUNT, normalizedMin); update
getDefaultCustomTopupAmount to use the normalized minimum and keep the rest of
the logic intact.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 80749e0a-d52a-4ad0-b2ad-5fabea7b4d50
📒 Files selected for processing (6)
.github/workflows/docker-build.ymlweb/classic/src/components/topup/RechargeCard.jsxweb/classic/src/components/topup/index.jsxweb/default/src/features/wallet/constants.tsweb/default/src/features/wallet/index.tsxweb/default/src/features/wallet/lib/payment.ts
Summary
Testing
Summary by CodeRabbit
Bug Fixes
New Features
Localization
Chores