Skip to content
New issue

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

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

Already on GitHub? # to your account

Robustness: Have fallbacks if http://cgit.drupalcode.org is not available #71

Closed
alexpott opened this issue Dec 21, 2017 · 19 comments
Closed

Comments

@alexpott
Copy link
Contributor

21st Dec 2017 http://cgit.drupalcode.org has gone down. This breaks any composer build using scaffold. It feels way off to break builds because of this. Perhaps we could provide default versions of all the files that are scaffolded?

@Natshah
Copy link

Natshah commented Dec 21, 2017

With you Alex on that.

I hope if we could have them in package like drupal/core
we could call them drupal/scaffolding_files as a fall back option, and change the target for them. not to run into this issue again.

Thanks for your quick following up on this

@Natshah
Copy link

Natshah commented Dec 21, 2017

I think we could have the fall back options as in:

source:
 "http://cgit.drupalcode.org/drupal/plain/{path}?h={version}"
 "https://github.com/drupal/drupal/blob/{version}/{path}"

and more fall backs


{
  "extra": {
    "drupal-scaffold": {
      "source": "http://cgit.drupalcode.org/drupal/plain/{path}?h={version}",
      "excludes": [
        "google123.html",
        "robots.txt"
      ],
      "includes": [
        "sites/default/example.settings.my.php"
      ],
      "initial": {
        "sites/default/default.services.yml": "sites/default/services.yml",
        "sites/default/default.settings.php": "sites/default/settings.php"
      },
      "omit-defaults": false
    }
  }

@Natshah
Copy link

Natshah commented Dec 21, 2017

A basic change at your root composer.json file will in development in a quick time.

  "extra": {
    "drupal-scaffold": {
      "source": "https://github.com/drupal/drupal/blob/{version}/{path}"
    }
  }

It worked for me:

Generating autoload files
Downloading https://github.com/drupal/drupal/blob/8.4.3/.csslintrc
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/.editorconfig
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/.eslintignore
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/.eslintrc.json
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/.gitattributes
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/.htaccess
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/index.php
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/robots.txt
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/sites/default/default.services.yml
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/sites/default/default.settings.php
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/sites/development.services.yml
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/sites/example.settings.local.php
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/sites/example.sites.php
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/update.php
Downloading (100%)Downloading https://github.com/drupal/drupal/blob/8.4.3/web.config

Back to continue work on my tasks

@flesheater
Copy link

the solution above is also not producing an error but is rather downloading the files with the GitHub interface around : D

For us it works this version

  "extra": {
    "drupal-scaffold": {
      "source": "https://raw.githubusercontent.com/drupal/drupal/{version}/{path}"
    },

Cheers!

@Natshah
Copy link

Natshah commented Dec 21, 2017

Very good :) 👍

The Following is only a prototype as I think a Fall Back option settings should be with better options by default. not to set them in our custom root composer.json project.

  "extra": {
    "drupal-scaffold": {
      "source": {
        "http://cgit.drupalcode.org/drupal/plain/{path}?h={version}",
        "https://github.com/drupal/drupal/blob/{version}/{path}",
        "https://raw.githubusercontent.com/drupal/drupal/{version}/{path}"
       
         And more fall back options for, other back up git services.
       
       }
     }
  }

@webflo
Copy link
Member

webflo commented Dec 21, 2017

Ok, lets convert source into an array and add multiple urls as default. The bc break should be minimal.

@Natshah
Copy link

Natshah commented Dec 21, 2017

Looking for where is the default setting in the code to come with drupal-scaffold 2.4.1

I think the following is the right change for now, not to have any no http access issues :

  "extra": {
    "drupal-scaffold": {
      "source": "https://github.com/drupal/drupal/blob/{version}/{path}",
      "initial": {
        "sites/default/default.services.yml": "sites/default/services.yml",
        "sites/default/default.settings.php": "sites/default/settings.php"
      },
      "omit-defaults": false
    }
  }

Or Raw is the better one
https://raw.githubusercontent.com/drupal/drupal/{version}/{path}

@Natshah
Copy link

Natshah commented Dec 21, 2017

Even after:

 "extra": {
   "drupal-scaffold": {
     "source": "https://raw.githubusercontent.com/drupal/drupal/{version}/{path}"
   }
 }

Files will come with HTML in them
I think this is the issue now
raw is not raw

@jochemvn
Copy link

think the comma after "https://raw.githubusercontent.com/drupal/drupal/{version}/{path}", needs to go right?

@Natshah
Copy link

Natshah commented Dec 21, 2017

I do have more items

@Natshah
Copy link

Natshah commented Dec 21, 2017

Seems that Michael Hess (mlhess) send us that he fixed it.
https://www.drupal.org/project/infrastructure/issues/2932245
I will keep following this issue and waiting for drupal-scaffold 2.4.1
if we are going to plan for a fallback options

Now I'm back to continue work on my tasks.

Thank you 👍

@andypost
Copy link

Nice idea with conversion to array, easy to implement

@andypost
Copy link

btw There's maintainable repos after split https://www.drupal.org/node/2865141

@greg-1-anderson
Copy link
Collaborator

This could be done without a b/c break if the source is typecast to an array.

@Natshah
Copy link

Natshah commented Nov 15, 2018

We are having the same issue again

    DrupalComposer\DrupalScaffold\Plugin::scaffold
    - .csslintrc (https://cgit.drupalcode.org/drupal/plain/.csslintrc?h=8.6.3): DoDownloading (failed)Script DrupalComposer\DrupalScaffold\Plugin::scaffold handling the drupal-scaffold event terminated with an exception
    [Composer\Downloader\TransportException]
    The "https://cgit.drupalcode.org/drupal/plain/.csslintrc?h=8.6.3" file could not be downloaded (HTTP/1.1 502 Bad Gateway)
    drupal-scaffold [--dev] [--no-dev] [--] []...
    Script @composer drupal-scaffold handling the post-install-cmd event returned with error code 255 

We had the some issue of drupal-scaffold before
https://www.drupal.org/project/varbase/issues/2933316

It could be that http://cgit.drupalcode.org/drupal is down
https://www.drupal.org/project/infrastructure/issues/2932245

From yesterday we had the following issue with packagist
https://twitter.com/packagist/status/1062630206966513665

WOW this is only 20m ago
https://twitter.com/drupal_infra/status/1063096242882969602
It is the same issue like before

I think the fallback option is very important, fallback to github or gitlab

@vijaycs85
Copy link
Collaborator

+1 on this issue. We had an hour of cgit.drupal.org down today and faced this issue. Even though drupal/core is coming from github (and loading without any issues), the plain files from cgit makes install failure.

vijaycs85 added a commit to vijaycs85/drupal-scaffold that referenced this issue Jan 8, 2019
vijaycs85 added a commit to vijaycs85/drupal-scaffold that referenced this issue Jan 8, 2019
vijaycs85 added a commit to vijaycs85/drupal-scaffold that referenced this issue Jan 8, 2019
@andypost
Copy link

Today cgit is down again, so +1

@ivnish
Copy link

ivnish commented Mar 19, 2019

Today cgit is down again [1]

webflo pushed a commit that referenced this issue Mar 26, 2019
@webflo
Copy link
Member

webflo commented Mar 26, 2019

Thanks all! Tagged a new release. 2.6.0 is available.

@webflo webflo closed this as completed Mar 26, 2019
webflo added a commit to webflo/drupal-scaffold that referenced this issue Mar 30, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants