hashbangcode / vlad

Vlad - Vagrant LAMP Ansible Drupal
173 stars 53 forks source link

Test if http://pecl.php.net is up right at the start of the build #59

Closed philipnorton42 closed 10 years ago

philipnorton42 commented 10 years ago

Following on from Issue #58 "Make uploadprogress optional".

I wonder if it's worth adding in a check, right at the start of the build to see if http://pecl.php.net is behaving itself. I'd rather know sooner than later that my build is going to fall over because this site is down again.

Thoughts?


philipnorton42 commented 10 years ago

Closing in favour of some documentation updates.


Original Comment By: Philip Norton

philipnorton42 commented 10 years ago

Agreed that we drop it for now but perhaps it may be wise to add notes to the wiki and/or readme or even feedback via Vlad (if fairly easy) to make this remote dependency clear. I'm unsure what a fail looks like if GitHub is down but the PECL one that I encountered had me chasing my tail for ages until I realised that it was because their site was down. We could save people some pain here.


Original Comment By: Dan Bohea

philipnorton42 commented 10 years ago

So I'm not sure where to go with this one. If pecl is down then we could fail the build, but you are right that it would stop certain builds that don't use any pecl packages.

There is also the further problem of what to do when any of the third part sites like github or pear are down (or inaccessible) as the build will fail in all sorts of places.

I'm thinking that there isn't much we can practically do here so I'm thinking we should close the issue and accept that the build will fail later if these party sites are down. If that's ok with you?


Original Comment By: Philip Norton

philipnorton42 commented 10 years ago

lol


Original Comment By: Dan Bohea

philipnorton42 commented 10 years ago

Up and down like the Assyrian Empire :P


Original Comment By: Philip Norton

philipnorton42 commented 10 years ago

BTW http://pecl.php.net is now back up.


Original Comment By: Dan Bohea

philipnorton42 commented 10 years ago

I guess the only drawback here is that if PECL is down and someone is trying to do a build that involves no PECL packages (possible now that uploadprogress is optional) their build will fail unnecessarily (kind of defeating the point of making all the PECL packages optional).

Perhaps we need to add further logic to "when:" but I'm unsure of how Ansible expects more complex logic than "and".

If this is getting too complex relative to the actual problem then let's drop the idea.


Original Comment By: Dan Bohea

philipnorton42 commented 10 years ago

Yeah, slight tweak (not tested!):

#!yaml

- name: test pecl is up
  action: command  curl -w -I http://pecl.php.net/
  register: curl_result
  failed_when: "'HTTP/1.1 200 OK' not in curl_result.stdout"

- name: test pecl is up
  fail: msg="Pecl is down, your build may fail as a result"
  when: "'Error</title>' in curl_result.stdout"

Original Comment By: Philip Norton

philipnorton42 commented 10 years ago

That or we check the site's <title> tag for the substring "Error".


Original Comment By: Dan Bohea

philipnorton42 commented 10 years ago

Yes, it's the db issues that have been plaguing the site over the weekend too. Perhaps we could try to grab a (small) package from the site as a test?


Original Comment By: Dan Bohea

philipnorton42 commented 10 years ago

I just checked pecl.php.net and it looks like they are having database issues. So the above would pass the test, although technically the site is actually down...


Original Comment By: Philip Norton

philipnorton42 commented 10 years ago

Excellent - it would certainly help.


Original Comment By: Dan Bohea

philipnorton42 commented 10 years ago

We could do that, all it would take it to add something like this to the pre-build tasks.

#!yaml

- name: test pecl is up
  action: command curl -I pecl.php.net
  register: curl_result
  failed_when: "'HTTP/1.1 200 OK' not in curl_result.stdout"

Original Comment By: Philip Norton