Track one-click app template sources - #227
Conversation
📝 WalkthroughWalkthroughThe change centralizes OneClick deployment query parameters, updates template routes, identifies official and private templates, and passes ChangesOneClick template routing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant OneClickGrid
participant OneClickAppConfigPage
participant OneClickDeploymentPage
participant caprover-api
OneClickGrid->>OneClickAppConfigPage: Open link with templateName
OneClickAppConfigPage->>OneClickDeploymentPage: Forward templateName
OneClickDeploymentPage->>OneClickDeploymentPage: Validate templateName
OneClickDeploymentPage->>caprover-api: Call startOneClickAppDeploy with templateName
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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: 2
🤖 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 `@src/containers/apps/oneclick/selector/OneClickGrid.tsx`:
- Around line 17-25: Update isMainOneClickAppRepository to reject URLs
containing credentials by checking repositoryUrl.username and
repositoryUrl.password, and ensure app.baseUrl is set to the canonical
repository text before any deployment is marked with an OFFICIAL_ status.
- Around line 81-82: Encode the deployment query’s templateName value before
appending it to the URL. In
src/containers/apps/oneclick/selector/OneClickGrid.tsx lines 81-82, encode the
generated OFFICIAL_<appName> or PRIVATE value; in
src/containers/apps/oneclick/variables/OneClickAppConfigPage.tsx lines 190-197,
encode the decoded templateName before adding it to deployUrl or use
URLSearchParams, preserving plus signs through forwarding.
🪄 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 Plus
Run ID: a09587d0-b1a6-4223-bbd3-90f1df011da3
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (9)
package.jsonsrc/containers/PageRoot.tsxsrc/containers/apps/compose/DockerComposeEntry.tsxsrc/containers/apps/oneclick/OneClickDeploymentConstants.tssrc/containers/apps/oneclick/selector/OneClickAppSelector.tsxsrc/containers/apps/oneclick/selector/OneClickGrid.tsxsrc/containers/apps/oneclick/template/TemplateInputPage.tsxsrc/containers/apps/oneclick/variables/OneClickAppConfigPage.tsxsrc/containers/apps/oneclick/variables/OneClickDeploymentPage.tsx
Summary
caprover-apicaprover-apito 0.0.19 for the new deployment argumentWhy
The backend needs to know which template source initiated a One-Click deployment. Previously the deployment request contained the rendered template and values but no source identifier.
Impact
Deployments now report one of:
OFFICIAL_<app-name>PRIVATETEMPLATE_ONE_CLICKDOCKER_COMPOSEThe value is attribution metadata supplied by the client and should not be treated as an authorization or security signal.
Validation
yarn tslintCI=true yarn test --watchAll=false --runInBand— 46 tests passedgit diff --checkcaprover-api@0.0.19is installed and the new API call type-checksA full standalone
tsc --noEmitstill reports existing declaration incompatibilities in third-party dependencies (@rc-component/qrcode, Redux Toolkit,rc-picker, andvfile).Summary by CodeRabbit
New Features
Bug Fixes