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

Installation cleanup #35168

Merged
merged 11 commits into from
Aug 17, 2021
Merged

Installation cleanup #35168

merged 11 commits into from
Aug 17, 2021

Conversation

wilsonge
Copy link
Contributor

@wilsonge wilsonge commented Aug 17, 2021

Summary of Changes

Completing installation now deletes the installation directory "automatically" before continuing when not in development mode. When in development mode you continue to get the existing button.

This allows the user to delete installation rather than currently being stuck as the red button is already currently only shown in development mode. Massive shoutout to @zero-24 for last minute finding this one. Would have made for a very fast 4.0.1 otherwise :)

Testing Instructions

Actual result BEFORE applying this Pull Request

You can't delete the installation directory when the build is "stable"

Expected result AFTER applying this Pull Request

Screenshot 2021-08-17 at 08 29 50
Screenshot 2021-08-17 at 08 30 08

In development mode the installation directory is not deleted when clicking complete. Only when pressing the big red button. In stable mode it is only when you click either continue button the installation directory is deleted and you are allowed to proceed

  1. Go to the installer and change the Joomla\Version\Version::DEV_STATUS to be Stable. Ensure you can't see the red button but when clicking on complete the installation directory is removed before you are allowed to proceed
  2. Go to the installer leaving yourself in dev mode. Ensure the red button is available and on clicking it you have the installation folder deleted. But when clicking on complete the redirect happens with no installation folder removal.

Documentation Changes Required

None.

@wilsonge wilsonge force-pushed the installation-cleanup branch from 66eb8a0 to cbdd6d0 Compare August 17, 2021 07:47
@webgras
Copy link
Contributor

webgras commented Aug 17, 2021

I have tested this item ✅ successfully on cbdd6d0

I downloaded from here: https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/35168/downloads/46699/
Tested folder in dev.
Then changed the following to act like stable (thanks @zero-24):
libraries\src\Version.php
const EXTRA_VERSION = '';
const DEV_STATUS = 'stable';


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35168.

@richard67
Copy link
Member

@wilsonge System tests are failing because they expect the button to be shown. It needs to adapt them to the changes here.

wilsonge added a commit to joomla-projects/joomla-browser that referenced this pull request Aug 17, 2021
@@ -38,6 41,12 @@ public function deleteInstallationFolder()
$return = File::move(JPATH_ROOT . '/robots.txt.dist', JPATH_ROOT . '/robots.txt');
}

if (function_exists('opcache_reset')) {
\opcache_reset();

This comment was marked as abuse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't work for our case. we've deleted the folder not a single file. I agree we do need to get #32915 in though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In theory we can try and just invalidate installation/index.php as that's what we actually test for? But not sure whether it's really a lesser evil.

This comment was marked as abuse.

Copy link
Contributor Author

@wilsonge wilsonge Aug 17, 2021

Choose a reason for hiding this comment

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

OK So concretely @HLeithner on his server gets race conditions without this line. And opcache invalidating that line also doesn't seem to solve it. Unclear right now if opcache just takes a bit longer so solves the race condition or there's some concrete cache being solved. But we'll go with this for 4.0.0 and then we can spend some time and figure out if we're just masking the issue or not for 4.0.1. Again fully agree that we need #32915 - just it doesn't apply to this specific case.

This comment was marked as abuse.

Copy link
Member

Choose a reason for hiding this comment

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

In theory we can try and just invalidate installation/index.php as that's what we actually test for? But not sure whether it's really a lesser evil.

Can someone make a new PR to change it that way?

This comment was marked as abuse.

Copy link
Member

Choose a reason for hiding this comment

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

@PhilETaylor I changed it now to invalidate cd2ea50

This comment was marked as abuse.

@wilsonge wilsonge merged commit f91d97b into joomla:4.0-dev Aug 17, 2021
@wilsonge wilsonge deleted the installation-cleanup branch August 17, 2021 08:20
@wilsonge
Copy link
Contributor Author

We'll fix drone this evening once work is done.

@PhilETaylor

This comment was marked as abuse.

@richard67
Copy link
Member

@wilsonge I think @PhilETaylor is right here. Should he make a PR to change from "opcache_reset" to something like here for the "installation/index.php" file?

https://github.com/joomla/joomla-cms/pull/32915/files#diff-87944bb26710d00cc11ee21e5a9c9242c5fd957acade50f9eed59b84f87b563bR1644-R1649

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.

8 participants