alphagov / govuk-prototype-kit

Rapidly create HTML prototypes of GOV.UK services
https://prototype-kit.service.gov.uk
MIT License
301 stars 236 forks source link

Pull request review apps are not working #1011

Closed lfdebrux closed 3 years ago

lfdebrux commented 3 years ago

Description of the issue

When a pull request is opened we are expecting govuk-design-system-ci to deploy review apps to Heroku (see for example https://github.com/alphagov/govuk-prototype-kit/pull/1008#event-4612963877).

However currently open and new pull requests are not being deployed, for example https://github.com/alphagov/govuk-prototype-kit/pull/1010 does not have a deploy.

Steps to reproduce the issue

Create a pull request against this repo.

Actual vs expected behaviour

I'm expecting a GitHub event saying a review app has been deployed to appear on the pull request, but I am not seeing that.

lfdebrux commented 3 years ago

We are using Heroku review apps functionality for review apps on this repo.

Looks like Heroku and GitHub have somehow become disconnected for this repo (although they are still connected for govuk-frontend 🤔). When I look at the existing pipeline for this repo https://dashboard.heroku.com/pipelines/f0879aaf-21f5-4430-a1d5-7adc4740a066 it asks me to connect to GitHub.

Connect this pipeline to GitHub to enable additional features such as review apps, automatic deploys, and Heroku CI.

I'm going to try clicking the "Connect to GitHub" button.

lfdebrux commented 3 years ago

Got the same error @vanitabarrett mentioned, "admin access to repository required"

The Heroku documentation states that Heroku needs admin access to create a service hook on the repo, and @vanitabarrett suggested that previously it was necessary to give the GitHub account @govuk-design-system-ci admin access to the repo, so I will see if that is possible.

lfdebrux commented 3 years ago

As a member of the Design System Developers team I was able to give @govuk-design-system-ci admin access to this repo. I see that in alphagov/govuk-frontend @govuk-design-system-ci also has admin access; I wonder if it has to have admin access the whole time?

I have now successfully connected Heroku to this GitHub repo, see https://dashboard.heroku.com/pipelines/f0879aaf-21f5-4430-a1d5-7adc4740a066/settings.

lfdebrux commented 3 years ago

I've enabled review apps for this repo, using similar settings to how govuk-frontend is configured:

lfdebrux commented 3 years ago

Hmm, it looks like the aren't quite working because the apps have been deployed but are asking for a username and password 🤔

I'm not sure whether for review apps a username and password should be required, or if we can just disable auth (either by setting the environment to development or the envvar USE_AUTH to false).

The alphagov/govuk-frontend apps don't seem to have this problem so I don't have that as an example...

lfdebrux commented 3 years ago

@joelanman suggests they should be password protected with username/password govuk/govuk, I will make that change.