Skip to content

Generate a pull request which triggers creation of a preview site whenever EveryPolitician data changes

Notifications You must be signed in to change notification settings

everypolitician/pull_request_preview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pull Request Preview

Run a everypolitician/viewer-sinatra-based staging server for open everypolitician/everypolitician-data pull requests.

Preview sites for data changes

Effectively this app (PullRequestPreview) is passing activity on pull requests on the everypolitician-data repo onto viewer-sinatra.

This is useful because the viewer-sinatra GitHub repo is currently configured to generate a preview version of the EveryPolitician website (on Heroku) whenever such a pull request is created.

So this app is triggered whenever a data pull request event occurs on everypolitician/everypolitician-data.

If that pull request contains new (or updated) data, its countries.json file will have been updated to point at those data-changing commits. PullRequestPreview creates a pull request on viewer-sinatra by updating viewer-sinatra's DATASOURCE file: that file solely contains the URL to that specific version of countries.json.

Because countries.json itself contains URLs that link to specific commits within the data repo, each preview site is effectively previewing the data relevant to the changes which caused the original data pull request.

Overall effect: a PR with new or updated data in everypolitician-data causes a preview site to be spun up via viewer-sinatra.

For more information, see the bot blog on spinning up these preview sites.

Webhook

This app expects to be triggered by a GitHub-style webhook from the EveryPolitician webhook manager: see more about EveryPolitician webhooks.

Development

Install

Clone this repository

git clone https://github.com/everypolitician/pull_request_preview
cd pull_request_preview

Install dependencies

bundle install

About

Generate a pull request which triggers creation of a preview site whenever EveryPolitician data changes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages