Skip to content

Track one-click app template sources - #227

Merged
githubsaturn merged 1 commit into
masterfrom
agent/track-one-click-template-source
Jul 31, 2026
Merged

Track one-click app template sources#227
githubsaturn merged 1 commit into
masterfrom
agent/track-one-click-template-source

Conversation

@githubsaturn

@githubsaturn githubsaturn commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • attach a template source identifier to official, private, free-form, and Docker Compose deployments
  • forward the identifier through the configuration and deployment flow to caprover-api
  • upgrade caprover-api to 0.0.19 for the new deployment argument
  • move deployment query parameter names into a shared constants module
  • give the free-form template generator a dedicated route
  • classify only the canonical One-Click App repository as official

Why

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>
  • PRIVATE
  • TEMPLATE_ONE_CLICK
  • DOCKER_COMPOSE

The value is attribution metadata supplied by the client and should not be treated as an authorization or security signal.

Validation

  • yarn tslint
  • CI=true yarn test --watchAll=false --runInBand — 46 tests passed
  • git diff --check
  • confirmed caprover-api@0.0.19 is installed and the new API call type-checks

A full standalone tsc --noEmit still reports existing declaration incompatibilities in third-party dependencies (@rc-component/qrcode, Redux Toolkit, rc-picker, and vfile).

Summary by CodeRabbit

  • New Features

    • Added template-aware deployment support for One-Click apps and Docker Compose apps.
    • Added clearer routing for template generation and custom template configuration.
    • Added validation to distinguish official and private One-Click repositories.
  • Bug Fixes

    • Improved deployment URL handling to preserve template information throughout configuration and deployment.
    • Updated the CapRover API integration to the latest version.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change centralizes OneClick deployment query parameters, updates template routes, identifies official and private templates, and passes templateName from deployment links through configuration and deployment API calls. The caprover-api dependency is updated to ^0.0.19.

Changes

OneClick template routing

Layer / File(s) Summary
Deployment contracts and entry routes
src/containers/apps/oneclick/OneClickDeploymentConstants.ts, src/containers/PageRoot.tsx, src/containers/apps/oneclick/selector/OneClickAppSelector.tsx, src/containers/apps/oneclick/template/TemplateInputPage.tsx
Shared deployment query-parameter constants were added. Template routes now use /apps/oneclick/templategenerator. Template input navigation adds TEMPLATE_ONE_CLICK.
Template source linking
src/containers/apps/oneclick/selector/OneClickGrid.tsx, src/containers/apps/compose/DockerComposeEntry.tsx
Official repository URLs are validated by origin, root path, and absent query or hash components. Deployment links identify official, private, and Docker Compose templates.
Deployment template propagation
src/containers/apps/oneclick/variables/OneClickAppConfigPage.tsx, src/containers/apps/oneclick/variables/OneClickDeploymentPage.tsx, package.json
The configuration page forwards templateName. The deployment page requires it and passes it to startOneClickAppDeploy. caprover-api is updated to ^0.0.19.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: tracking template sources for one-click app deployments.
Description check ✅ Passed The description clearly covers the changes, rationale, impact, validation, and known TypeScript limitations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/track-one-click-template-source

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@githubsaturn
githubsaturn marked this pull request as ready for review July 31, 2026 05:55

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f49c284 and 336745f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • package.json
  • src/containers/PageRoot.tsx
  • src/containers/apps/compose/DockerComposeEntry.tsx
  • src/containers/apps/oneclick/OneClickDeploymentConstants.ts
  • src/containers/apps/oneclick/selector/OneClickAppSelector.tsx
  • src/containers/apps/oneclick/selector/OneClickGrid.tsx
  • src/containers/apps/oneclick/template/TemplateInputPage.tsx
  • src/containers/apps/oneclick/variables/OneClickAppConfigPage.tsx
  • src/containers/apps/oneclick/variables/OneClickDeploymentPage.tsx

Comment thread src/containers/apps/oneclick/selector/OneClickGrid.tsx
Comment thread src/containers/apps/oneclick/selector/OneClickGrid.tsx
@githubsaturn
githubsaturn merged commit 4c811ee into master Jul 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant