Hi,
The 9.5.0 update appears to have broken the connections to existing plugins and themes previously installed from a private, self-hosted, Bitbucket repository.
The issue appears to lie with the change in the plugin URI.
As per the closed job #770 we established that the URI should be of the format:
https://bitbucket.xxxxx.yy/projects/ProjectName/RepName
In 9.5.0 this has changed to
https://bitbucket.xxxxx.yy/ProjectName/RepName
I have verified this through a plugin install and update, both of which were successful using the new format.
The problem is that existing installs of plugins have the old style URI and github-updater is now unable to connect to them to check for updates.
Perhaps a fallback check using the previous format is required if github-updater can't connect with the new format?
Andrew
@allrite I guess I forgot my note regarding the proper header for Bitbucket Server user v project repository.
The previous account access I had on your Bitbucket Server installation no longer seems to work making my testing impossible.
Can you test the develop branch and see if https://github.com/afragen/github-updater/commit/dee7068db1e8c34f7869497e27e54a6b2af7f062 fixed it?
Hi @afragen ,
I think we were on the 9.3 branch, had a few little issues on 9.4 but I didn't chase them up, then confirmed that they existed in 9.5.
I've tried the 9.5.0.3 develop branch and it appears that the plugin now connects to the already installed plugins with the old style URIs.
However, the plugins installed with the new style URI are now disconnected. More importantly, it is not able to install new plugins off bitbucket with either style URI either in the metadata or install path.
I'll check to see if I can reinstate your account (may not be possible due to current pandemic related change restrictions).
I also removed the latest from the download links as I found it wasn't needed on Bitbucket.org and took a chance here.
Can you let me know what you mean by old-style URI and new-style URI. I think this is what we are supposed to have now. https://github.com/afragen/github-updater/wiki/Self-Hosted-or-Enterprise-Installations#bitbucket-server-support
I think we're back to the _old-style_ URI.
When we get this figured out I'm wondering if I can use something that only needs to add the ~ for a user account.
Old style URI: https://bitbucket.example.com/projects/owner/repo
New style: https://bitbucket.example.com/owner/repo
Not sure about ~'s as we don't use any user accounts.
I've re-enabled your account. You should be able to access https://bitbucket.csiro.au/projects/WP/repos/wpgh-test/ now.
I saw the renewed access. Thanks. It makes this so much easier.
I think what I'm going to do is the new style URI but just require a user to add the ~ to the front of their username.
wpgh-test is missing an index.php file and so won't install
You can try https://bitbucket.csiro.au/projects/WP/repos/nba-starter-plugin/ instead as this should install.
I'm testing just using a header as follows, Bitbucket Plugin URI: https://bitbucket.csiro.au/WP/nba-starter-plugin/
If its a user project the then you will need to prepend a ~ in front of the <owner> as in
Bitbucket Plugin URI: https://bitbucket.csiro.au/~andy.6/test-bitbucket-plugin
As our existing URIs are like https://bitbucket.csiro.au/projects/WP/nba-starter-plugin/ does that mean that we would need to update them or reinstall from the new URI without the "projects" section?
Yes it does. I'm just finishing the testing now. I will commit to develop if a few minutes. I'll let you know.
I want to use the new style URI as it's consistent with all other supported platforms.
Committed in v9.5.0.5 in develop branch.
Sorry for having to change all your headers on existing projects, but I think the consistency is easier for me.
Fair enough! I'll test it and let you know how I go and if there's anything useful I can share about mitigating the effects of the change.
Installation and updating of plugins works with the new version, if the plugin is installed with the new URI version (eg https://bitbucket.csiro.au/WP/nba-starter-plugin/).
As expected, connections are broken for plugins that we installed with the old URI format.
Is there any way we can go into the WP database and update the old URIs? Or is it based upon the installed plugin file, meaning we either need to reinstall the plugin with the new URI or do a filesystem based search and replace for that string?
What you would need to do is update the header both locally and on the Bitbucket Server. That particular data isn't in the database.
There is a filter, GitHub_updater_post_construct_download_link. It's documented in the Bitbucket_Server_API class. It will allow you to modify the download links, but I since the plugin won't connect I'm not sure it will help. Sorry.
I can create a branch for you to update with. That way all you would need to do is update the headers in Bitbucket Server. Then an update will change them on the sites. Afterwards you would need to switch the branch again.
I made a branch allrite for you. I think it should work with the old-style URI. You will need to update all the repos on your Bitbucket Server though and then an update from your sites should pull in the new style headers on the updates.
Use branch switching to switch to the allrite branch. When you've finished updating switch back and let me know as I will delete the branch afterwards.
Depending upon how many sites you have to update it might be worthwhile checking out https://github.com/afragen/git-remote-updater
https://thefragens.com/git-remote-updater-the-personal-remote-management-system/
Thanks so much for this! I'll get moving on updating those headers and deploying the changes and let you know when we are done so you can delete the branch.
I will take a look at the git-remote-updater. We currently use MainWP for our standard, but I'm not certain if it picks up the changes in our bitbucket repository. The remote updater would be very useful for this.
We've updated all our Bitbucket repositories and done a test update using the allrite branch on a test site, then reverted to the standard develop branch of github-updater and so far it's looking good! Just need to roll out the allrite branch to all our live sites and run the update there. Will let you know when it is complete (probably tomorrow for us).
Hi @afragen we have now completed the migration and you can delete the allrite branch. Thanks so much for your assistance with this, very much appreciated.
Make sure you have switched back to develop.
LMK if you want to troubleshoot the Git Remote Updater.
Yep, I actually switched back to develop or master on all of them and installed additional plugins via Github-Updater on a number of sites afterwards so I am happy to confirm that it is working well. Going to have a play with the remote updater on my local machine today and will note any findings there.
Most helpful comment
Yep, I actually switched back to develop or master on all of them and installed additional plugins via Github-Updater on a number of sites afterwards so I am happy to confirm that it is working well. Going to have a play with the remote updater on my local machine today and will note any findings there.