Feature #57
openFeature #33: Canofy Control Centre Backend Development
Feature #46: Canofy Control Centre Onboarding Process
# [CANOFY-111] Install Custom Apps
0%
Description
[CANOFY-111] Install Custom Apps¶
Type: Story
Epic: New Client Onboarding — Automated AWS + Frappe Provisioning
Stage key: apps_install (pipeline stage 11 of 15)
Component: utils/onboarding_executor.py
User Story¶
As an operations engineer,
I want every app configured for a client automatically cloned from
GitHub and installed on their site, in the correct order,
so that client-specific functionality (canofy_tcs, s3_file_storage,
etc.) is present from day one without manual bench get-app commands per
client.
Description¶
For each row in Onboarding Request.apps_to_install (ordered by
install_order):
- Resolve the clone target folder — normally
app_name, but
target_folder_nameifrequires_special_cloneis set (some apps'
repo layout doesn't match their installable app name). - Clone the app's repo using a GitHub PAT (from Secrets Manager, referenced
byOnboarding Request.github_pat_key) injected into the HTTPS clone URL
— never a PAT in plaintext in logs. -
bench --site <site> install-app <app_name>. - In "AMI Image" deployment mode, skip the clone step for apps flagged
is_standard(already baked into the golden AMI) — install-app only.
Explicit rule: frappe itself must never appear as an app to install
here. It's the base framework, already present from bench new-site in
stage 10. Any apps_to_install row named frappe (case-insensitive) must
be skipped with a clear log line, not attempted.
If an app row has no github_repo set and cloning isn't skipped for AMI
mode, the stage must fail with a specific, actionable error ("no
github_repo configured for app X") — not a generic SSM exit-status failure
that gives no clue what actually went wrong.
Configuration / Prerequisites¶
- Every app in
apps_to_installmust have a validgithub_repo(unless
AMI-mode-skipped) and, if private, a workinggithub_pat_keypointing at
a real Secrets Manager secret. -
Canofy Appregistry entries should exist for these apps (for
cross-referencing special-clone folder names, default branch, etc.).
Acceptance Criteria¶
-
Apps install in
install_order, not an arbitrary/parallel order (some
apps may depend on others being present first). -
frappeis never treated as an installable app. -
PAT never appears in plaintext in SSM command logs or Onboarding
Request output. - Special-clone apps land in the correct folder name, not the app name.
-
A missing
github_repoproduces a specific, diagnosable error, not a
generic failure. -
AMI-mode standard apps skip cloning but still run
install-app.
Test Cases¶
| ID | Scenario | Steps | Expected Result |
|---|---|---|---|
| TC-1 | Happy path | Run stage with 3 valid apps in order | All 3 clone, install successfully, in the configured order |
| TC-2 | Frappe guard | Include an apps_to_install row named "Frappe" |
Skipped with a log line, no install-app Frappe attempted |
| TC-3 | Special clone | Configure an app with requires_special_clone=1 and a differing target_folder_name
|
App lands in the correct custom folder, install-app still uses the real app name |
| TC-4 | PAT not leaked | Inspect SSM command text/output for the clone step | PAT value not present in plaintext anywhere retrievable |
| TC-5 | Missing repo URL | One app row has github_repo empty |
Stage fails with a specific "no github_repo for app X" error, not a generic exit-status-1 |
| TC-6 | AMI mode standard app |
deployment_mode="AMI Image", app flagged is_standard
|
Clone step skipped, install-app still runs |
| TC-7 | Invalid PAT |
github_pat_key points at a Secrets Manager key that doesn't exist or is expired |
Stage fails with a clear "PAT retrieval/auth failed" error |
No data to display