Improve installer form initialization and preview navigation - #182
Conversation
snoopdave
left a comment
There was a problem hiding this comment.
PR-Review: 1 inline comment posted.
DatabaseInstallerUpgradeTest pinned the expected database version to
the current release constant ("616"), so the test would fail on the
next version bump even though the behavior it checks is unchanged.
The test now derives its expectation from the same source the
installer uses -- the ro.version property in roller-version.properties,
parsed with the same DatabaseInstaller.parseVersionString -- so the
widening of that pure helper to package-private static is the only
production change. JDK 11 app verify: 301 tests, 0 failures, 1
skipped, unchanged.
| @@ -254,6 +256,10 @@ public void upgradeDatabase(boolean runScripts) throws StartupException { | |||
| // make sure the database version is the exact version | |||
| // we are upgrading too. | |||
| updateDatabaseVersion(con, myVersion); | |||
| if (!schemaChangesRequired) { | |||
| successMessage("No table changes were required."); | |||
| } | |||
| successMessage("Database version updated to " + myVersion + "."); | |||
There was a problem hiding this comment.
probably ok for now but this is also a bit brittle.
I think this pattern would be more future proof.
boolean upgraded = false;
if(dbversion < xx) {
upgradeTo...()
dbversion = yy;
upgraded = true;
}
(...)
if (!upgraded) { extraMessage(); }But this can be tweaked for the next release.
There was a problem hiding this comment.
gh didn't select the full span, the brittle part is L229 boolean schemaChangesRequired = dbversion < 610;.
There was a problem hiding this comment.
Thanks — adopted your flag pattern in #184: a schemaUpgraded flag set inside each upgrade block, so the "no table changes" message no longer depends on the hardcoded 610. It's behavior-preserving (at that point dbversion < 610 is true exactly when a block runs), and I added a test for the schema-change path. Folding it into 6.1.6.
Addresses the installer and entry-preview findings from Greg’s 6.1.6 RC1 testing.
UI form initialization establishes a session before generating the form salt. Entry previews use a context-relative URL, preserving the editor’s origin. Version-only database upgrades report completion explicitly, and the installer supplies page titles and exception names directly to its templates.
Validation: JDK 11
mvn -pl app verifypassed (301 tests, zero failures/errors, one existing disabled test). Isolated Tomcat 9.0.64/PostgreSQL checks passed for fresh-session installation at the root context and a version-610 upgrade under/roller, including bootstrap and version-616 verification. Preview tests cover HTTP/HTTPS, non-default ports, and both context layouts. Live HTTPS/reverse-proxy preview confirmation on Greg’s deployment remains useful.