Giter Club home page Giter Club logo

prout's Introduction

Prout

"Has your pull request been deployed yet?" - Guardian blogpost

Tells you when your pull-requests are live. Tells you when they're not, and should be.

prout overduethenseen

Prout comes from the tenet that:

Developers are responsible for checking their changes on Production

This becomes more important, and easier once you move to a Continuous Deployment release process. Important, because now a developer can break the site simply by hitting 'Merge' on a pull request - but also easier because with such a small delay (say, less than 10 minutes) between merging the work and having it ready to view in a Production setting, the developer is in a much better place to review their work; it's still fresh in their mind.

While everyone on your team may agree with this philosophy, that 10 minute lag between merge and deploy can be enough time for a developer like me to get distracted ("Look, shiny thing!" or, more realistically, "What's the next bit of work?") and forget about promptly reviewing their changes on Production.

Prout simply notifies developers in their pull request that the code has been seen in Production (a slightly stronger statement than simply saying it's been deployed).

Configuration

Follow the 4-step program:

  1. Give prout-bot write-access to your repo (so it can set labels on your pull request)
  2. Add one or more .prout.json config files to your project
  3. Add callbacks to prout - ie a GitHub webhook and ideally also a post-deploy hook
  4. Expose the commit id of your build on your deployed site

Give prout-bot write-access

Giving prout write-access by going to Settings -> Collaborators and team -> Add teams and typing in 'prout'

Admin access to the repository is required to give prout-bot write-access. Please contact your team's Engineering Manager for this.

Add config file

Add a .prout.json file to any folder you want monitored in your repo:

{
  "checkpoints": {
    "DEV": { "url": "http://dev.mysite.com/", "overdue": "10M" },
    "PROD": { "url": "http://mysite.com/", "overdue": "1H" }
  }
}

When a pull-request changes a file anywhere under that folder, Prout will scan the checkpoints defined in your config file, and update the pull-request with labels and a comment as appropriate. The url you specify in the checkpoint will be fetched, and the contents of the response will be read- so long as you embed the commit id that response, Prout will be able to work out whether or not the PR has been deployed.

Add callbacks

Add Prout-hitting callbacks to GitHub and (optionally) post-deploy hooks to your deployment systems so that Prout can immediately check your site.

GitHub

Add a GitHub webhook with these settings:

  • Payload URL : https://prout-bot.herokuapp.com/api/hooks/github
  • Content type : application/json

The hook should be set to activate on Pull Request events.

Adding a GitHub web hook by navigating to Settings -> Webhooks -> Add webhook

Note that this can be done once at the Organization Webhook level, which removes the need for doing it on each individual repo. Prout will check that any repository has a .prout.json config file present before attempting to take any action on it.

Post-deploy hooks

Whatever deployment tool you use (RiffRaff, Heroku, etc) just set it to hit Prout as a post-deploy hook (for your repo on github.com/[owner]/[repo]):

https://prout-bot.herokuapp.com/api/update/[owner]/[repo]

Hitting that url (GET or POST) will always prompt Prout to scan the repository for outstanding pull-requests.

Expose the commit id

You must embed the commit id in your site - we do this on membership.theguardian.com for instance.

I use the sbt-buildinfo plugin to store the Git commit id in my stored artifact, and then expose that value on the production site. The ugly-looking SBT config is:

buildInfoKeys := Seq[BuildInfoKey](
      name,
        "gitCommitId" -> (Option(System.getenv("BUILD_VCS_NUMBER")) getOrElse (try {
        "git rev-parse HEAD".!!.trim
      } catch {
          case e: Exception => "unknown"
      }))
    )

Slack

Users can configure a Slack hook for Prout by creating a new Slack 'Incoming Webhook':

https://your-domain.slack.com/services/new/incoming-webhook

...this will get you a 'Webhook URL', which looks something like this:

https://hooks.slack.com/services/T05FTQF9H/B012N1Y2Y/p9VyRC1ZlTqNGuu

...stick that url into a GitHub webhook for your repo as the 'Payload URL':

https://github.com/my-org/my-repo/settings/hooks/new

...and then (optionally) disable the hook in GitHub! You don't actually want to send GitHub events to the hook - this is just a place to store the private url where Prout can find it. Note that Prout needs repo-admin access in order to read the hook data!

Status

Prout has a status page per repository available at https://prout-bot.herokuapp.com/view/{organisation}/{repository}. This lists useful information like if it was able to find .prout.json, which commit it thinks is currently deployed in production, etc.

Prout also logs lots of useful information which is available in the heroku backend.

Run your own instance of Prout

Deploy

...you want to run your own instance of Prout - the instance at https://prout-bot.herokuapp.com/ is really only for the Guardian.

prout's People

Contributors

ashcorr avatar github-actions[bot] avatar gu-scala-steward-public-repos[bot] avatar ioannakok avatar jacobwinch avatar jfsoul avatar jorgeazevedo avatar kant avatar mchv avatar parisatork avatar prout-bot avatar rowannekabalan avatar rtyley avatar tackley avatar tbonnin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prout's Issues

Sentry Release has more commits than it should have

When @michaelwmcnamara merged guardian/membership-frontend#1638, there was only one commit in the GitHub PR - but Sentry ascribed 25 commits to the release:

https://sentry.io/the-guardian/membership/releases/257e7fc72d73d19d0c6c7d16ebb1ce8bfd1b73fd/commits/

image

We would have passed a refs entry to Sentry like this (note these values are driven from the GitHub API: https://api.github.com/repos/guardian/membership-frontend/pulls/1638) :

The PR had taken a few days to develop and so was based off the old 50e6b684 commit. If you do a GitHub compare on those commits, you'll see the 25 commits (most of which we don't want!): guardian/membership-frontend@50e6b68...257e7fc

The best thing for us to do is probably send the first parent of the merge commit as the 'previous' commit.

Add support for Sentry Releases functionality

Sentry are currently working on some interesting release-based functionality, which could help us with determining what changes are responsible for new bugs, and communicating quickly and non-noisily with the responsible developers.

Update: this is now released https://blog.sentry.io/2017/05/01/release-commits.html

Regarding the support we should add to Prout, the Sentry API has a Create a New Release for a Project call, which we would get Prout to call every time a PR is seen on Prod. Prout would provide a direct link to the GitHub PR to provide context - there doesn't appear to be any other way to provide human-readable context in the Sentry release at the moment, except possibly in the version field. Ideally we'd like the Sentry Release Overview page to display to the PR number & title - data we could provide with Prout, if there was a legitimate field in Sentry to store it.

Some of the listed features of Sentry's release work:

  • Learn which release an issue was first introduced or last seen in
  • Suggested owners on issues
  • Marking issues as resolved in the next release
  • Resolving Sentry issues via commit messages

I've already connected the membership-frontend repository in Sentry, and hopefully with the next few released PR's we'll see some increased metadata in the entries under https://sentry.io/the-guardian/membership/releases/

image

cc @jacobwinch, and also @macqueen, who is working on this โœจ awesome stuff at Sentry โœจ

Prout Bot is depleting GitHub API quota fast and then it becomes unresponsive

How many repos is Prout scanning?

We have 110 private repositories and 60 public repositories. So, prout integration has been done with only 2 private repositories.

How many PRs have been made on those repos in the last 14 days?

I would say we produce 20+ PRs daily. We are 30+ engineering team right now. So, it would be 280+ PRs in 14 days.

An aggregation of the MISS (that's a cache miss) api.github.com calls in your logs? Are they all trees/heads/master?recursive=1 calls?

Maybe following diagnostic log output would help. We are running prout in docker container - will that affect anything? I hope not!!

informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxboilerplate/git/trees/heads/master?recursive=1 Consumed 1088/5000 over 5 mins, projected consumption over window: 12970, will exceed quota 36 mins before reset occurs at 12:09:58Z
re reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxtimer/git/trees/heads/master?recursive=1 Consumed 1046/5000 over 4 mins, projected consumption over window: 15123, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/workstrxxxxxxxx-pulse/git/trees/heads/master?recursive=1 Consumed 1045/5000 over 4 mins, projected consumption over window: 15108, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxxxxxer?recursive=1 Consumed 1047/5000 over 4 mins, projected consumption over window: 15137, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/workstrxxxxxxxx-tools/git/trees/heads/master?recursive=1 Consumed 1048/5000 over 4 mins, projected consumption over window: 15152, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xyzzzzzzzz/git/trees/heads/master?recursive=1 Consumed 1049/5000 over 4 mins, projected consumption over window: 15166, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxx/git/trees/heads/master?recursive=1 Consumed 1050/5000 over 4 mins, projected consumption over window: 15181, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/wsreport/git/trees/heads/master?recursive=1 Consumed 1052/5000 over 4 mins, projected consumption over window: 15210, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/zzzzzz-aaaaaa/git/trees/heads/master?recursive=1 Consumed 1051/5000 over 4 mins, projected consumption over window: 15195, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxxxxxxxx/git/trees/heads/master?recursive=1 Consumed 1053/5000 over 4 mins, projected consumption over window: 15224, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx-monitor/git/trees/heads/master?recursive=1 Consumed 1054/5000 over 4 mins, projected consumption over window: 15239, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/zxing.rb/git/trees/heads/master?recursive=1 Consumed 1055/5000 over 4 mins, projected consumption over window: 15192, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/workstrxxxxxxxx/git/trees/heads/master?recursive=1 Consumed 1056/5000 over 4 mins, projected consumption over window: 15146, will exceed quota 40 mins before reset occurs at 12:09:58Z
informer_1  | [info] c.RepoWhitelistService$ - Consumed 1056/5000 over 4 mins, projected consumption over window: 12714, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/user/repos Consumed 1057/5000 over 5 mins, projected consumption over window: 12684, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/user/repos?page=2 Consumed 1058/5000 over 5 mins, projected consumption over window: 12696, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/user/repos?page=3 Consumed 1059/5000 over 5 mins, projected consumption over window: 12708, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/user/repos?page=4 Consumed 1060/5000 over 5 mins, projected consumption over window: 12678, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/user/repos?page=5 Consumed 1061/5000 over 5 mins, projected consumption over window: 12690, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/user/repos?page=6 Consumed 1062/5000 over 5 mins, projected consumption over window: 12702, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/activerecord-postgres-hstore/git/trees/heads/master?recursive=1 Consumed 1063/5000 over 5 mins, projected consumption over window: 12714, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/act-fluent-logger-rails/git/trees/heads/master?recursive=1 Consumed 1064/5000 over 5 mins, projected consumption over window: 12726, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/axxxx/git/trees/heads/master?recursive=1 Consumed 1065/5000 over 5 mins, projected consumption over window: 12738, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/XXXXXXXXXXXX_app_php-import/git/trees/heads/master?recursive=1 Consumed 1066/5000 over 5 mins, projected consumption over window: 12750, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx-ntp/git/trees/heads/master?recursive=1 Consumed 1067/5000 over 5 mins, projected consumption over window: 12761, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXX/xxxxxxxgit/trees/heads/master?recursive=1 Consumed 1069/5000 over 5 mins, projected consumption over window: 12743, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxx/git/trees/heads/master?recursive=1 Consumed 1070/5000 over 5 mins, projected consumption over window: 12755, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/axxxx/xxxxxxx-prometheus/git/trees/heads/master?recursive=1 Consumed 1068/5000 over 5 mins, projected consumption over window: 12731, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx/git/trees/heads/master?recursive=1 Consumed 1071/5000 over 5 mins, projected consumption over window: 12767, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxx/git/trees/heads/master?recursive=1 Consumed 1072/5000 over 5 mins, projected consumption over window: 12779, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/zzzzzz/git/trees/heads/master?recursive=1 Consumed 1073/5000 over 5 mins, projected consumption over window: 12791, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/baseassets/git/trees/heads/master?recursive=1 Consumed 1074/5000 over 5 mins, projected consumption over window: 12803, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx/git/trees/heads/master?recursive=1 Consumed 1075/5000 over 5 mins, projected consumption over window: 12815, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/bloggrwith2fa/git/trees/heads/master?recursive=1 Consumed 1076/5000 over 5 mins, projected consumption over window: 12826, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/bootstrap-wysihtml5-rails/git/trees/heads/master?recursive=1 Consumed 1077/5000 over 5 mins, projected consumption over window: 12838, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxxxx/git/trees/heads/master?recursive=1 Consumed 1078/5000 over 5 mins, projected consumption over window: 12850, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXxxxxxxxx/git/trees/heads/master?recursive=1 Consumed 1079/5000 over 5 mins, projected consumption over window: 12862, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxx/git/trees/heads/master?recursive=1 Consumed 1080/5000 over 5 mins, projected consumption over window: 12874, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx/git/trees/heads/master?recursive=1 Consumed 1081/5000 over 5 mins, projected consumption over window: 12886, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx/git/trees/heads/master?recursive=1 Consumed 1082/5000 over 5 mins, projected consumption over window: 12898, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/capistrano-hutch/git/trees/heads/master?recursive=1 Consumed 1083/5000 over 5 mins, projected consumption over window: 12910, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxxx/git/trees/heads/master?recursive=1 Consumed 1084/5000 over 5 mins, projected consumption over window: 12922, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/capistrano-sidekiq/git/trees/heads/master?recursive=1 Consumed 1085/5000 over 5 mins, projected consumption over window: 12934, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/campus/git/trees/heads/master?recursive=1 Consumed 1086/5000 over 5 mins, projected consumption over window: 12946, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxx/git/trees/heads/master?recursive=1 Consumed 1087/5000 over 5 mins, projected consumption over window: 12958, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/c/xxxx-form-boilerplate/git/trees/heads/master?recursive=1 Consumed 1088/5000 over 5 mins, projected consumption over window: 12970, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/c/xxxx-xxxxx/git/trees/heads/master?recursive=1 Consumed 1089/5000 over 5 mins, projected consumption over window: 12981, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/c/xxxx-javascript-library/git/trees/heads/master?recursive=1 Consumed 1090/5000 over 5 mins, projected consumption over window: 12993, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/c/xxxx-uiux-demo/git/trees/heads/master?recursive=1 Consumed 1091/5000 over 5 mins, projected consumption over window: 13005, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/c/xxxx-xxxx/git/trees/heads/master?recursive=1 Consumed 1092/5000 over 5 mins, projected consumption over window: 13017, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/c/xxxxlibs/git/trees/heads/master?recursive=1 Consumed 1093/5000 over 5 mins, projected consumption over window: 12986, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx/git/trees/heads/master?recursive=1 Consumed 1095/5000 over 5 mins, projected consumption over window: 13010, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxent/git/trees/heads/master?recursive=1 Consumed 1094/5000 over 5 mins, projected consumption over window: 12998, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx/git/trees/heads/master?recursive=1 Consumed 1096/5000 over 5 mins, projected consumption over window: 13022, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxxuth-adapter/git/trees/heads/master?recursive=1 Consumed 1097/5000 over 5 mins, projected consumption over window: 13034, will exceed quota 36 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/chromedriver-helper/git/trees/heads/master?recursive=1 Consumed 1098/5000 over 5 mins, projected consumption over window: 13046, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/XXXXXXXXXXXX_app_php/git/trees/heads/master?recursive=1 Consumed 1099/5000 over 5 mins, projected consumption over window: 13057, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/ryyyyyyyy-loadenv/git/trees/heads/master?recursive=1 Consumed 1100/5000 over 5 mins, projected consumption over window: 13069, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/XXXXXXXXXXXX_app_ruby/git/trees/heads/master?recursive=1 Consumed 1101/5000 over 5 mins, projected consumption over window: 13081, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/yyyyyyy/trees/heads/master?recursive=1 Consumed 1102/5000 over 5 mins, projected consumption over window: 13093, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/XXXXXXXXXXXX_php/git/trees/heads/master?recursive=1 Consumed 1103/5000 over 5 mins, projected consumption over window: 13105, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx/git/trees/heads/master?recursive=1 Consumed 1104/5000 over 5 mins, projected consumption over window: 13117, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/custom_scripts/git/trees/heads/master?recursive=1 Consumed 1105/5000 over 5 mins, projected consumption over window: 13129, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xx/git/trees/heads/master?recursive=1 Consumed 1106/5000 over 5 mins, projected consumption over window: 13141, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx/git/trees/heads/master?recursive=1 Consumed 1107/5000 over 5 mins, projected consumption over window: 13152, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/channels/git/trees/heads/master?recursive=1 Consumed 1108/5000 over 5 mins, projected consumption over window: 13164, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/databazaar/git/trees/heads/master?recursive=1 Consumed 1109/5000 over 5 mins, projected consumption over window: 13176, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/data_transformation/git/trees/heads/master?recursive=1 Consumed 1110/5000 over 5 mins, projected consumption over window: 13188, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/design_pattern/git/trees/heads/master?recursive=1 Consumed 1111/5000 over 5 mins, projected consumption over window: 13200, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxx/git/trees/heads/master?recursive=1 Consumed 1112/5000 over 5 mins, projected consumption over window: 13212, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxx/git/trees/heads/master?recursive=1 Consumed 1113/5000 over 5 mins, projected consumption over window: 13224, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxx/git/trees/heads/master?recursive=1 Consumed 1114/5000 over 5 mins, projected consumption over window: 13192, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/docs/git/trees/heads/gh-pages?recursive=1 Consumed 1115/5000 over 5 mins, projected consumption over window: 13204, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/dockerfiles/git/trees/heads/master?recursive=1 Consumed 1116/5000 over 5 mins, projected consumption over window: 13216, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/developer.XXXXXXXXXXXX.com/git/trees/heads/master?recursive=1 Consumed 1117/5000 over 5 mins, projected consumption over window: 13228, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxxx/git/trees/heads/master?recursive=1 Consumed 1118/5000 over 5 mins, projected consumption over window: 13239, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxx/git/trees/heads/master?recursive=1 Consumed 1119/5000 over 5 mins, projected consumption over window: 13251, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/easyssh/git/trees/heads/master?recursive=1 Consumed 1120/5000 over 5 mins, projected consumption over window: 13263, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxx/git/trees/heads/master?recursive=1 Consumed 1121/5000 over 5 mins, projected consumption over window: 13275, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/fxxxapp/git/trees/heads/master?recursive=1 Consumed 1122/5000 over 5 mins, projected consumption over window: 13287, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/elbx/git/trees/heads/master?recursive=1 Consumed 1123/5000 over 5 mins, projected consumption over window: 13299, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/exceptions/git/trees/heads/master?recursive=1 Consumed 1124/5000 over 5 mins, projected consumption over window: 13311, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/feedback/git/trees/heads/master?recursive=1 Consumed 1125/5000 over 5 mins, projected consumption over window: 13322, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/git-flow-sprout/git/trees/heads/master?recursive=1 Consumed 1127/5000 over 5 mins, projected consumption over window: 13346, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/genie/git/trees/heads/master?recursive=1 Consumed 1126/5000 over 5 mins, projected consumption over window: 13334, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xx/git/trees/heads/master?recursive=1 Consumed 1128/5000 over 5 mins, projected consumption over window: 13358, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/geckoboard-push/git/trees/heads/master?recursive=1 Consumed 1129/5000 over 5 mins, projected consumption over window: 13370, will exceed quota 37 mins before reset occurs at 12:09:58Z
informer_1  | [warn] c.m.s.GitHub - MISS 200 GET https://api.github.com/repos/XXXXXXXXXXXX/xxx/git/trees/heads/master?recursive=1 Consumed 1130/5000 over 5

Reference: #41 (comment)

Allow custom messages on a per-project basis

Driven by @TBonnin on the Frontend team, let's try to drive a short snippet of infromation to the developer, at the exact moment they need it.

Configuration might look like:

{
    "checkpoints": {
        "PROD": {
            "url": "https://frontend.gutools.co.uk/deploys?stage=PROD&pageSize=50",
            "overdue": "30M"
            "messages": {
              "seen" : "README.md"
              "overdue" : "docs/bad-deploy.md"
            }
        }
    }
}

This would insert the text instead of the default "Please check your changes!" message.

image

Probably require adding a Map[PullRequestCheckpointStatus,String-Path-Thing] to the CheckpointDetails case class.

Don't spam

This is bad.

image

This bot should send a maximum of three emails IMO before it stops nagging people. Or it could scale up the loop frequency (eg. 5 seconds, 10s, 30s, 2mins, 5mins etc).

At the moment it's just irritating and team members are even filtering its emails (eg. any github notification!) to skip the inbox.

Raise visibility of diagnostic information, especially when things are going wrong

Although Prout has a very useful diagnostic UI, ie: https://prout-bot.herokuapp.com/view/guardian/support-frontend

image

...it's currently not well known to users of Prout - the URL for the diagnostic is not easily discoverable. Consequently, users can miss out on useful information like this (see guardian/support-frontend#5152):

PROD - https://support.theguardian.com/uk
โŒ Could not read from this url, got java.net.ProtocolException: Too many follow-up requests: 21

There are a couple of things that could be done about this:

  • Add a link to Prout's diagnostic UI in the comments Prout writes on PRs - the only problem with that is that I think that Prout currently does not know it's own hostname - that would have to be supplied through configuration.
  • Supply details of checkpoint failure in the comment when a PR is overdue - this might be more fun to do! Note that we can use the existing diagnostic information available in the UI, we just need to make it in markdown. When the checkpoint:
    • does supply a git id, but it's old : state that it's old, and perhaps even supply a link to a diff between what's there and what this PR would supply
    • can be read, but no git id can be found : provide a link to a tutorial explaining how to embed a git commit id in the HTTP response
    • can not even be successfully read as an HTTP endpoint : supply the exception

Support checkpoint urls that require cookies

Some Guardian endpoints like https://support.theguardian.com/uk/contribute now require an Okta cookie, and will redirect endlessly if the cookie can't be dropped (see eg guardian/support-frontend#5152 (comment)):

$ curl -I https://support.theguardian.com/uk/contribute
HTTP/2 303
location: /oauth/authorize

Giving us an error like this:

Could not read from this url, got java.net.ProtocolException: Too many follow-up requests: 21

We wouldn't want Prout to maintain cookies across separate checkpoint snapshots (each snapshot should be isolated), but when taking a single snapshot, which might redirect (eg in order to acquire cookies), it could be that we do want to maintain cookies.

Prout currently uses OkHttp as the HTTP client used to take checkpoint snapshots:

val client = new OkHttpClient()

Switch HTTP client to java.net.http.HttpClient ?

Documentation on how to get OkHttp to store cookies between requests (with a CookieJar) is limited, but Java 9 introduced an alternative HTTP client, java.net.http.HttpClient:

...which seems to supply all of Prout's requirements in a HTTP client, including this new one for cookies:

Of course, switching to the JDK HTTP client would also mean we'd get to drop a dependency, which would be nice!

[Suggestion] allow to expose the commit id through other ways

Using a comment in the HTML works only for HTML websites. This does not play well with other kind of projects (APIs for instance).

Would it be possible to expose the commit id in other ways ? I see 2 potential ways:

  • exposing it in a header
  • exposing a dedicated API endpoint returning info about the API (and having the commit id as one of the info in the JSON). This solution would of course only be useful for APIs (and especially APIs having such an endpoint already)

Users confused when Prout ignores PRs that don't touch configured folders

At the moment, Prout only interacts with PRs that touch folders within the project that are next to, or below, a .prout.json config file. This makes sense, because the project might contain many other folders that end up getting deployed to other destinations- that might have other checkpoints, or no checkpoint at all.

Multi-folder support?

This PR didn't touch the dashboard folder (only shared-lib/src/...), and so was correctly ignored by Prout: https://github.com/guardian/ophan/pull/1265/files - but code in shared-lib/src/... does end up deployed to the Ophan Dashboard, so it would be nice to know about it being seen at that checkpoint.

Diagnostics?

It would also be good to have an authenticated endpoint that users can look at to see how Prout regards their project (what is the status of the PRs? which folders is Prout watching?) - any user with push access to a given repo should be able to see that information. Timing attacks in establishing that?! Shouldn't be an issues so long as we are just initially validating the user has push access to the repo, and then checking that it's on Prout's whitelist.

cc @philwills

Heroku template is out of date

The Heroku template only demands that PROUT_GITHUB_ACCESS_TOKEN is specified.

However, looking at conf/application.conf, GITHUB_APP_CLIENT_ID and GITHUB_APP_CLIENT_SECRET are also required config variables.

Without specifying these I get a failure on heroku startup:

Aug 04 03:02:47 app/web.1:  Oops, cannot start the server. 
Aug 04 03:02:47 app/web.1:  Configuration error: Configuration error[application.conf @ file:/app/target/universal/stage/conf/application.conf: 16: Could not resolve substitution to a value: ${GITHUB_APP_CLIENT_ID}] 
Aug 04 03:02:47 app/web.1:      at play.api.Configuration$.configError(Configuration.scala:178) 
Aug 04 03:02:47 app/web.1:      at play.api.Configuration$.load(Configuration.scala:103) 
Aug 04 03:02:47 app/web.1:      at play.core.server.ProdServerStart$.readServerConfigSettings(ProdServerStart.scala:81) 
Aug 04 03:02:47 app/web.1:      at play.core.server.ProdServerStart$.start(ProdServerStart.scala:42) 
Aug 04 03:02:47 app/web.1:      at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27) 
Aug 04 03:02:47 app/web.1:      at play.core.server.ProdServerStart.main(ProdServerStart.scala) 
Aug 04 03:02:47 app/web.1:  Caused by: com.typesafe.config.ConfigException$UnresolvedSubstitution: application.conf @ file:/app/target/universal/stage/conf/application.conf: 16: Could not resolve substitution to a value: ${GITHUB_APP_CLIENT_ID} 

(I suspect this means the readme is out of date too.)

Update other build configuration

The master branch of this repository has been migrated to main using the master-to-main tool.

Please check any build related configuration and update as required:

  • TeamCity - See the required steps in the migrating.md document
  • Change snyk github integration(s) - it uses the default branch, but you will need to delete and reimport the project+file as this is the only way to refresh the default branch at present.
  • Any other externally configured analysis tooling your team is using e.g. travis CI

It's probably a good idea to merge test PR to main once this is complete, to make sure that everything is working as expected. ๐Ÿ™‚

Make it easier to test if the configure Travis Token is valid

@jorgeazevedo pointed out that https://github.com/guardian/support-frontend hasn't been kicking off it's post-deploy tasks for over a week - it took us a lot of digging to realise that someone had refreshed the Travis token at https://travis-ci.org/account/preferences and that we just needed to update PROUT_TRAVIS_TOKEN_OPENSOURCE in our Heroku settings - once that was done we merged a test PR and Prout successfully triggered a post-deploy-build.

Would be great if the diagnostics page at https://prout-bot.herokuapp.com/view/guardian/support-frontend could test the Travis credentials to see if they are still valid.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.