backdrop-contrib / backdrop-drush-extension

A set of commands and boot class for Drush and Backdrop CMS.
GNU General Public License v2.0
13 stars 18 forks source link

Drush dl sometimes does not pick up version #210

Open rroseselavy42 opened 4 years ago

rroseselavy42 commented 4 years ago

Hey folks, Have a strange intermittent issue where drush dl will sometimes not pick up the latest version of a backdrop module. Instead it will give me an error such as below

$ drush dl rules
    Error: There is no release located at https://github.com/backdrop-contrib/rules/releases/download//rules.zip.
    Try visiting the rules page directly: https://github.com/backdrop-contrib/rules

this only happens intermittently and mostly when run scripted.

serundeputy commented 4 years ago

thanks for reporting this @rroseselavy42

We have had other reports of the dl command intermittently failing ... let's try to nail it down and fix it here.

serundeputy commented 4 years ago

looks like I'm curling to a reg github url instead of the github api

https://github.com/backdrop-contrib/drush/blob/1.x-1.x/commands/pm/backdrop_pm.drush.inc#L121

        $html = backdrop_pm_get_from_github(
          "https://github.com/backdrop-contrib/$project/releases/latest"
        );

We should fix this to hit the API instead so redirects won't fail the dl command. Something like this:

curl -s https://api.github.com/repos/backdrop-contrib/rules/releases/latest

then refactor to parse the json result.

bradbulger commented 4 years ago

I'm getting an error today from drush dl:

Module is already installed ... exiting without re-writing module. [error]

Normally it would get the new version of the module (entity_plus in this case) and ask me if I want to overwrite the existing version. Whether a module is installed or not shouldn't matter, but I assume by "installed" it means "exists on the file system".

serundeputy commented 4 years ago

@bradbulger if you are trying to update a module you should use drush up entity_plus

bradbulger commented 4 years ago

Sometimes you don't want to update, though. You want to download a different version from what's there. I can get around it by removing the directory, I just thought I remembered it working. I guess I must have been thinking of my experience using it with Drupal, where it will overwrite the existing directory after prompting (or with the -y flag). I believe this was a conversation at one point, around a bug filed against original Drush that dl should delete the old files (since files can go away between versions).

serundeputy commented 4 years ago

@bradbulger file a new issue as a feature request please.

rroseselavy42 commented 2 years ago

just to update, this is now happening 100% of the time I think output has changed