cedaro / satispress

Expose installed WordPress plugins and themes as Composer packages.
500 stars 49 forks source link

Satispress doesn't create zip for new plugin version (0.3.0) #82

Closed aytackokus closed 5 years ago

aytackokus commented 5 years ago

Hello,

We had an issue where the new plugin updates wasn't detected/created by the satispress. After some debugging, we found out that the plugin version check was the blocker for that.

Link to the file

Our $saved_version was 0.3.0 and it didn't pass the version_compare check.

if ( version_compare( $saved_version, '0.3.0-dev1', '<' ) ) {
    Capabilities::register();
    $this->setup_storage();
    $this->cache_packages();
}

The plugin updates are working now because we changed the version from 0.3.0-dev1 to 0.3.1-dev1.

Is this a bug or did we miss a feature?

Take care,

Aytac

GaryJones commented 5 years ago

With version_compare( '0.3.0', '0.3.0-dev1', '<' ), what being asked is: "Is 0.3.0 less (earlier) than 0.3.0-dev1?", to which the answer is no, since 0.3.0 is later than the pre-release version.

@aytackokus How did you install 0.3.0? Did you have an earlier version of 0.3.0 installed?

aytackokus commented 5 years ago

@GaryJones We installed the latest release (0.3.0) from the git.

We had an earlier version, but we deleted that to install the new one fresh. After that we moved the old packages (zip files) back under the satispress directory to save some time.

bradyvercher commented 5 years ago

The saved version is immediately updated to the latest version after upgrading SatisPress, so unless the version in the database was checked beforehand, it probably doesn't matter that it was 0.3.0. That upgrade check should fail in that case so the upgrade routine isn't run more than once.

That being said, I believe the upgrade routine should be idempotent, so running it again shouldn't be a problem. To do that the satispress_version option can be deleted or set to an earlier version.

The only thing I can figure that may have caused this is if a development version was being used before the upgrade routine was added.

If anyone else runs into the same problem, feel free to reopen this issue.

ghost commented 4 years ago

I cannot reopen the issue, but I seem to have the same problem. The repositories in the plugin folder are updated, and the SatisPress admin screen sees the new versions (for example 1.1 is the new version, and has been added as a new version in the admin screen (wp-admin/options-general.php?page=satispress#satispress-packages), but there is no zipfile yet. It is only created after I push the button to download version 1.1 by hand. After this, it's also available in the packages.json

I'm not exactly sure if it's the same issue. If it's not, I'll be glad to open a new one, but I thought it would be better to search older issues first.

BramEsposito commented 4 years ago

Thanks @jpeters-mixcom for your comment. I run into the same issue and this remark from you helps me work around this issue:

... after I push the button to download version 1.1 by hand. After this, it's also available in the packages.json

I have not found another way to activate the newer version of my plugin yet.

Am I looking over the functionality to regenerate the packages and rebuild the package.json?