Skip to content

feat: Add 'Create New App' flow to Pilot admin UI - #223

Open
ajmal1212 wants to merge 14 commits into
frappe:developfrom
ajmal1212:feat/create-app
Open

feat: Add 'Create New App' flow to Pilot admin UI#223
ajmal1212 wants to merge 14 commits into
frappe:developfrom
ajmal1212:feat/create-app

Conversation

@ajmal1212

Copy link
Copy Markdown

Summary

This PR implements the "Create New App" capability inside the Pilot admin UI. It allows users to scaffold a new Frappe app (equivalent to running bench new-app), automatically register/install it, optionally provision a clean repository on GitHub (via connected Git integrations), and deploy it directly onto selected sites.

Key Changes

  1. Scaffolding Background Task (pilot/tasks/jobs/create_app_task.py):
    • Executes Frappe's _create_app_boilerplate() non-interactively using Python snippet invocation.
    • Installs the app into the virtual environment (pip install -e), registers it in apps.txt, and builds assets.
    • Leverages personal access tokens from connected integrations to optionally provision a new GitHub repository, set up git remote origin, and commit/push initial branches. Includes branch checks to prevent overwriting repositories with existing history.
  2. API Endpoint (admin/backend/api/v1/apps.py):
    • Added a POST /apps/create endpoint that validates the proposed snake_case app name and schedules the background task.
  3. GitHub API Client (pilot/integrations/git/github.py):
    • Added create_repo() to support programmatic repository creation on GitHub.
  4. UI Components:
    • Added CreateAppDialog.vue containing form fields for metadata (Title, Publisher, Email, License) and GitHub settings.
    • Added buttons to open the Dialog from both the Marketplace Filters and Site Detail header.

@greptile-apps

greptile-apps Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge; all previously-reported credential and rollback issues are resolved, and the remaining findings are style/design-system nits.

The core scaffolding, GitHub integration, and site-install paths are all guarded correctly. No present behavioral defects were found in this revision.

pilot/tasks/create_app.py (create_github complexity) and admin/frontend/src/components/apps/CreateAppDialog.vue (raw form elements)

Reviews (12): Last reviewed commit: "test(admin): update route inventory base..." | Re-trigger Greptile

Comment thread pilot/integrations/git/github.py Outdated
Comment thread pilot/tasks/jobs/create_app_task.py Outdated
Comment thread admin/backend/api/v1/apps.py Outdated
@tanmoysrt

Copy link
Copy Markdown
Member

@ajmal1212 Please keep the PR description minimal and add screenshots for UI changes.
There was a major refactor in backend side. So, please update your feature branch.

@ajmal1212

Copy link
Copy Markdown
Author
Screenshot 2026-07-20 074141 Screenshot 2026-07-20 074214 Screenshot 2026-07-20 080229

this is the UI changes

Comment thread pilot/tasks/create_app.py
@tanmoysrt

Copy link
Copy Markdown
Member

Hi @ajmal1212
Can you move the new app button to marketplace instead ?

@ajmal1212

ajmal1212 commented Jul 21, 2026

Copy link
Copy Markdown
Author

Hi @tanmoysrt,

I'll work on it.

@ajmal1212

Copy link
Copy Markdown
Author

Fixed the rollback guard in CreateAppTask.run(). self.scaffold() and self.install_env() are now wrapped inside the try block so any failure during scaffolding or venv installation triggers full cleanup (directory removal, deregistration, pip uninstall). Added unit test test_run_triggers_rollback_on_install_env_failure in commit e9404d34.

Comment thread pilot/tasks/create_app.py Outdated
@ajmal1212

Copy link
Copy Markdown
Author
Screenshot 2026-07-21 203847 Screenshot 2026-07-21 203910

@tanmoysrt

Copy link
Copy Markdown
Member

@siduck can you check the design

@tanmoysrt
tanmoysrt requested a review from siduck July 22, 2026 05:56
Comment thread pilot/tasks/create_app.py
Comment on lines +14 to +35
@dataclass(kw_only=True)
class CreateAppTask(Task):
command: ClassVar[str] = "create-app"

name: str
title: str = ""
description: str = ""
publisher: str = ""
email: str = ""
app_license: str = "mit"
create_github_repo: bool = False
github_repo_private: bool = False
sites: list[str] = field(default_factory=list)

def run(self) -> None:
# Essential App Scaffolding & Virtualenv Installation
try:
self.scaffold()
self.install_env()
except Exception as e:
self.report(f"App creation failed: {e}. Rolling back...")
try:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use bench new-app command instead ?
in current bench, that's named as bench make-app ig, you can rename it to new-app for compaitability with old bench

@Aradhya-Tripathi

Copy link
Copy Markdown
Collaborator

Using the bench new-app command will ensure the build files are correctly added.

@tanmoysrt

Copy link
Copy Markdown
Member

Hi @ajmal1212
bench new-app and scaffold through framework has been added. Can you please use that ?

@ajmal1212

ajmal1212 commented Jul 24, 2026

Copy link
Copy Markdown
Author

Sorry, guys. I haven't had enough time to work on it. Let's complete it today

@ajmal1212

Copy link
Copy Markdown
Author

Hi @tanmoysrt,

Updated this PR with the latest changes:

  1. Merged upstream main containing bench new-app / NewAppOptions scaffolding.
  2. Refactored CreateAppTask in pilot/tasks/create_app.py to use bench.new_app directly.
  3. Updated unit tests & route baseline checks (test_create_app_task.py and test_admin_routes.py).

@tanmoysrt

Copy link
Copy Markdown
Member

@ajmal1212

Please merge the base branch. There are already scaffolding code and command for creating new-app.
We shouldn't do it manually, framework itself handle that, we are just using frappe's internal make-app command.

https://github.com/frappe/pilot/blob/main/pilot/commands/apps/new.py

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.

3 participants