Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer and upgrader rewrite #8093

Draft
wants to merge 122 commits into
base: release-3.0
Choose a base branch
from

Conversation

Sesquipedalian
Copy link
Member

@Sesquipedalian Sesquipedalian commented Feb 8, 2024

@jdarwood007, let's use this to work collaboratively on the installer/upgrader rewrite.

  • Add Schema for 3.0
  • Add Initial framework for Maintenance logic
  • Build Installer logic
  • Setup Migration logic for upgrades from SMF 2.0 to 2.1
  • Setup Migration logic for upgrades from SMF 2.1 to 3.0
  • Test Installer logic
  • Build Upgrader logic
  • Test Upgrader logic
  • Build Converter Logic
  • Setup Converter logic for YabbSE
  • Setup Converter logic for SMF 1.0
  • Setup Converter logic for SMF 1.1
  • Build Repair Settings tool
  • Build logic for self-contained tools to utilize the maintenance logic.
  • Add logic back for installer to work with compression (?obgz)
  • Allow upgrader to support login or entering in the database password.

Fixes #8261

@Sesquipedalian Sesquipedalian added this to the 3.0 Alpha 2 milestone Feb 8, 2024
@Sesquipedalian Sesquipedalian changed the title Creates SMF\Db\Schema and descendents Installer and upgrader rewrite Feb 8, 2024
@Sesquipedalian Sesquipedalian reopened this Feb 8, 2024
@jdarwood007
Copy link
Member

jdarwood007 commented Feb 9, 2024

A lot is incoming, it's my initial work I started to write the installer logic. You should be able to get through an install. But the base logic should get it going for an upgrader and converter logic.

@jdarwood007
Copy link
Member

I've also added some task notes based on what I was thinking, please amend or adjust.

@Sesquipedalian
Copy link
Member Author

Sesquipedalian commented Feb 13, 2024

Please remember not to force-push to a shared branch, @jdarwood007. I was able to reconcile the differences in my local repository fairly easily this time, but another time I might not be so lucky.

Sesquipedalian and others added 5 commits February 13, 2024 17:06
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Co-authored-by: John Rayes <live627@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Sesquipedalian and others added 3 commits July 1, 2024 11:37
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
jdarwood007 and others added 6 commits July 2, 2024 16:46
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Started work on Migration logic in upgrader.
Minor fixes
# Conflicts:
#	Maintenance/Tools/Upgrade.php
#	other/install_3-0_MySQL.sql
#	other/install_3-0_PostgreSQL.sql
@jdarwood007
Copy link
Member

Finally got through the 2.1 upgrader sql logic. What a mess that was.

I started on the migration logic itself.

I also moved the Maintenance.php from Sources to the Maintenance folder. Had to fix some references for that. If we don't want it there, we can move it back.

I also deleted the upgrade .SQL files for both 2.1 and 3.0. It will make a merge conflict if we make changes, but forces us to find and fix anything. I put the install.php in place. You can swap out install for the upgrade call to see it. I didn't want to overwrite upgrade.php until I have finished using it for referencing while building the migrations,cleanup and done steps to the upgrader.

But I think having the install.php will let us fully test the installer to make sure we are happy with it and can cross that off the list.

There is a note where I left off on the migration logic I am working on for the upgrade itself. I need to get back but wanted to get loaded what I have so far.

Signed-off-by: Jon Stovell <jonstovell@gmail.com>
@jdarwood007
Copy link
Member

@Sesquipedalian
I'm running into an error:
( ! ) Fatal error: Uncaught Error: Typed static property SMF\User::$me must not be accessed before initialization in /Sources/BrowserDetector.php on line 131

Its being called in the Migration/v2_1/BoardDescriptions

					'name' => Utils::htmlspecialchars(strip_tags(BBCodeParser::load()->unparse($row['name']))),

What is the optimal call here to put the best effort that SMF can do to safely startup the User::$me object? Keeping in mind we may be coming from a env in which it may not be able to startup things.

@jdarwood007
Copy link
Member

		// Load up the current user safely.
		$p = User::load(0);
		User::$me = $p[0];

This seems to call ok.

@Sesquipedalian
Copy link
Member Author

Sesquipedalian commented Aug 9, 2024

		// Load up the current user safely.
		$p = User::load(0);
		User::$me = $p[0];

This seems to call ok.

This would be better:

		// Load up the current user safely.
		User::setMe(0);

Also, is it indeed the intention here to load a guest user? Because that's what loading user 0 does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[3.0]: Check for "calendar_holidays" table during upgrade could return false positives
6 participants