Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

GitHub Actions workflow for review apps #1771

Merged
merged 17 commits into from
Feb 20, 2025
Merged

GitHub Actions workflow for review apps #1771

merged 17 commits into from
Feb 20, 2025

Conversation

AP-Hunt
Copy link
Member

@AP-Hunt AP-Hunt commented Feb 12, 2025

What problem does this pull request solve?

Trello card: https://trello.com/c/veseFayX/581-github-actions-workflows-for-managing-review-apps

Implements the GitHub Actions workflows needed for the full lifecycle of a forms-admin review app. This is a large pull request necessarily, because it combines multiple streams of work that came before it, and addresses any and all integration problems that arise.

@sarahseewhy and I have paired on this extensively.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Has all relevant documentation been updated?

@AP-Hunt AP-Hunt force-pushed the review_apps_pr_workflow branch 14 times, most recently from d0a425e to ab50b2c Compare February 14, 2025 17:06
@sarahseewhy sarahseewhy force-pushed the review_apps_pr_workflow branch from d6bd7ae to 60a1bed Compare February 18, 2025 09:44
@AP-Hunt AP-Hunt force-pushed the review_apps_pr_workflow branch from 60a1bed to 965cc9b Compare February 18, 2025 10:39
Copy link

🎉 A review copy of this PR has been deployed! You can reach it at https://pr-1771.review.forms.service.gov.uk/.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

@AP-Hunt AP-Hunt changed the title WIP: workflow GitHub Actions workflow for review apps Feb 19, 2025
@AP-Hunt AP-Hunt force-pushed the review_apps_pr_workflow branch from 9fc95d3 to a1eb5ad Compare February 19, 2025 14:34
Copy link

🎉 A review copy of this PR has been deployed! You can reach it at https://pr-1771.review.forms.service.gov.uk/.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

@AP-Hunt AP-Hunt marked this pull request as ready for review February 19, 2025 15:04
@AP-Hunt AP-Hunt force-pushed the review_apps_pr_workflow branch from a1eb5ad to 59dae37 Compare February 19, 2025 16:21
Copy link

🎉 A review copy of this PR has been deployed! You can reach it at https://pr-1771.review.forms.service.gov.uk/.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

Copy link

🎉 A review copy of this PR has been deployed! You can reach it at https://pr-1771.review.forms.service.gov.uk/.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For more details please see the review app wiki page

Refactors the review apps GitHub Actions workflow to build the container image
on a hosted GitHub Actions runner, to take advantage of the image caches.
We removed the dependency on factory bot for seed data, so we no longer need to
install it inside the container before starting up.
When the PR closes (either by merging, or closing withotu merging), the review
app needs to be cleaned up.
Once a deployment is complete, we want to leave a comment on the PR telling
them where to find the review app.
sarahseewhy and others added 10 commits February 20, 2025 11:29
* Add label to enable Traefik basic authentication
* Credentials are configured in forms-deploy
We were previously using the Postgres 13.12 image from docker.io, but we
routinely hit issues with being rate limited by it. To avoid that, we use
Amazon's own registry, which contains mirrored images from docker.io, without
rate limits.
…-review-app job

When we built it in a separate job, we found that the container was faulty in
some way. In forms-deploy we have now configured CodeBuild to have Docker Hub
credentials, so the rate limits are not a concern anymore.
We want to make sure that the tag applied to the container being built in the
workflow is unique on each run, so that a re-run of a failed workflow will
result in a new container. There are many reasons for failure, and sometimes we
want the container to be built afresh.
In Traefik's configuration model, middlewares must be explicitly attached to
routers. We had not done that.
* Point Forms API base URL to localhost and configured port (9292) since tasks share the same network
* Use `html_url` which is the human readable version, `url` points to the GitHub API friendly URL
* Add link to review app URL
Write access to pull requests is needed for leaving comments. This is
accompanied by ADR041.
We can easily wait for the deployment to finish before leaving a comment to say
it's ready.
@AP-Hunt AP-Hunt force-pushed the review_apps_pr_workflow branch from 9741969 to 31e0d47 Compare February 20, 2025 11:29
Copy link

🎉 A review copy of this PR has been deployed! You can reach it at https://pr-1771.review.forms.service.gov.uk/.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For more details please see the review app wiki page

Copy link

🎉 A review copy of this PR has been deployed! You can reach it at https://pr-1771.review.forms.service.gov.uk/.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For more details please see the review app wiki page

Copy link
Contributor

@sarahseewhy sarahseewhy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing immediately stands out as needing to change, although we did pair on this quite a bit so maybe a fresh pair of eyes would be useful.

🪄

@AP-Hunt AP-Hunt merged commit 1102160 into main Feb 20, 2025
7 checks passed
@AP-Hunt AP-Hunt deleted the review_apps_pr_workflow branch February 20, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants