Skip to content

fix(setup): ask for a password and record the setup start on new Frappe Cloud sites (backport #3377) - #3379

Merged
pateljannat merged 4 commits into
version-16-hotfixfrom
mergify/bp/version-16-hotfix/pr-3377
Nov 20, 2026
Merged

pateljannat merged 4 commits into
version-16-hotfixfrom
mergify/bp/version-16-hotfix/pr-3377

Conversation

@mergify

@mergify mergify Bot commented Nov 20, 2026

Copy link
Copy Markdown

Setup asks a Frappe Cloud trial owner for a password again

A Frappe Cloud trial owner arrives signed in with no password. The password step of Learning's setup did not show for them, so once their session ends they have no password to sign in with. Frappe's own check skips Frappe Cloud v2 sites and sites with email login links, and every trial site is both.

Learning now decides when its setup asks: any signed-in user without a password, unless a password cannot sign in on the site (password login off, LDAP, social login). Learning's own set_first_password keeps the framework's checks under that rule, and hooks.py points the framework's method at it, so the framework's password step saves without a framework change. Both can go once the framework check covers these sites.

Tested on a local Frappe Cloud v2 site with email login links on and the framework as it is today: the password step shows, saving it goes through the override, and the owner signs in with the new password. Five new tests in test_onboarding.py; four of them fail on develop.


The setup start is recorded on new sites

The framework's setup flow sends setup_started and the first step's view as the page opens, and telemetry drops events until it has loaded. On a new site's first page it often loads later. In the last 30 days, 7 of 16 sites that finished setup have no start event and no view of the first step, while their later steps are there, so the Started count is too low.

When telemetry is still off as setup opens, Learning sends both events once it is on. When it was already on, Learning sends nothing, so no start is counted twice. Remove this once the framework's setup flow waits for telemetry itself. A test in setupPage.test.ts fails on develop.


This is an automatic backport of pull request #3377 done by [Mergify](https://mergify.com).

A Frappe Cloud trial owner arrives signed in with no password, but the
password step of Learning's setup never showed. Frappe's own check skips
Frappe Cloud v2 sites and sites with email login links, and every trial
site is both, so the owner had no password to sign in again.

Learning now decides when its setup asks: any signed-in user without a
password, unless a password cannot sign in on the site. Its own
set_first_password keeps the framework's checks under that rule, and
hooks.py points the framework's method at it, so the framework's password
step saves without a framework change. Remove both once the framework
check covers these sites.

(cherry picked from commit 8d140a5)
The framework's SetupFlow sends setup_started and the first step's view
as it opens, and telemetry drops events until it has loaded. On a new
site's first page it often loads later, so 7 of 16 sites in the last 30
days have no start event, and the Started count is too low.

When telemetry is still off as setup opens, Learning sends both events
once it is on. When it was already on, Learning sends nothing, so no
start is counted twice. Remove this once the framework's SetupFlow waits
for telemetry itself.

(cherry picked from commit 713efbe)
The trial-site password tests changed System Settings with
change_settings, which saves the document. Saving needs a language and a
time zone, and the CI site never ran the setup wizard, so it has neither
and the three tests failed with MandatoryError. They now patch what
get_system_settings returns instead.

(cherry picked from commit dca7dd3)
@pateljannat pateljannat added Run Server Tests Run the server suite on this pull request Run UI Tests Run the UI suite on this pull request Run Frontend Tests Run the frontend suite on this pull request labels Nov 20, 2026
@codecov-commenter

codecov-commenter commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.95775% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.33%. Comparing base (7241c47) to head (d0ba088).
⚠️ Report is 959 commits behind head on version-16-hotfix.

Files with missing lines Patch % Lines
lms/lms/onboarding.py 84.84% 5 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           version-16-hotfix    #3379      +/-   ##
=====================================================
+ Coverage              87.92%   93.33%   +5.41%     
=====================================================
  Files                    248      339      +91     
  Lines                  21534    33895   +12361     
=====================================================
+ Hits                   18933    31635   +12702     
+ Misses                  2601     2260     -341     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The dashboard redesign deleted adminBatchDashboardFilters.test.ts on
develop, because the new dashboard replaced what it tested. Its backport
to version-16-hotfix (#3363) kept the file, so its three tests fail there
on the new dashboard's NumberCard, which their frappe-ui/charts mock does
not provide.
@pateljannat
pateljannat merged commit 4854f6c into version-16-hotfix Nov 20, 2026
16 checks passed
@pateljannat
pateljannat deleted the mergify/bp/version-16-hotfix/pr-3377 branch November 20, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Run Frontend Tests Run the frontend suite on this pull request Run Server Tests Run the server suite on this pull request Run UI Tests Run the UI suite on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants