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

⚙ Streamline github actions workflows #498

Closed
3 tasks
MatMoore opened this issue Jun 26, 2024 · 2 comments · Fixed by #532 or #536
Closed
3 tasks

⚙ Streamline github actions workflows #498

MatMoore opened this issue Jun 26, 2024 · 2 comments · Fixed by #532 or #536
Assignees
Labels
production-ready Non-functional things

Comments

@MatMoore
Copy link
Contributor

MatMoore commented Jun 26, 2024

Purpose

We have reviewed our workflow and environment usage; see miro diagram: https://miro.com/app/board/uXjVK8MOx_c=/

Now we are in beta and are about to onboard our first users, this is a good time to make sure our github actions workflows

  • supports our desired workflow and doesn't get in the way of it
  • ensure code passes through all the quality gates before it can reach production

We have decided we can deploy automatically to test, without manual approval, but we should have manual approval before deploying to production (and possibly pre-production).

Before we hit approve we want to notify users and stakeholders of what's changed. We also intend to create Github releases prior to rolling out to live, in order to

  1. track compatibility with datahub versions
  2. allow our frontend releases to be consumed by other government departments.

Proposal

  • Rename existing workflows and remove unused ones
    • test (test-and-deploy.yml) -> "Test and deploy branch to dev"
    • test (test-datahub-client.yml)-> Remove, as long as the tests get run in the above workflow
  • Extend the CI/CD workflow that runs on main (.github/workflows/deploy.yml)
    • Auto-deploy to Test (if unit tests pass - make this
    • Gated deploys to preprod and prod
    • Trigger this workflow when a tag/release is created, rather than merge to main
  • "Release Datahub Client library" -> Merge with .github/workflows/deploy.yml
  • Keep GHA running tests on each push but try to solve "hanging open actions" issue: jobs left in "waiting" state if we choose not to deploy to dev (this creates a lot of notification spam)

Acceptance criteria

  • One workflow_dispatch action to test and deploy manually from any branch into dev
  • One CI/CD workflow, triggered by the creation of a release, which runs tests, automatically builds and deploys to test, and pushes the library to PyPI. Steps and approvals for subsequent deploys into preprod and prod.
  • Every workflow has a unique name
@MatMoore MatMoore converted this from a draft issue Jun 26, 2024
@MatMoore
Copy link
Contributor Author

MatMoore commented Jun 26, 2024

Example of jobs left in a waiting state: https://github.com/ministryofjustice/find-moj-data/actions/workflows/test-and-deploy.yml

Github treats the deploy to dev as a thing that has to happen, but actually it is optional, and we don't need to do it for every single push.

  • Can these actions be invalidated by later jobs on the same branch?
  • Should we take this out of the workflow entirely and just have a workflow_action trigger for dev?

@MatMoore MatMoore changed the title Streamline github actions workflows ⚙ Streamline github actions workflows Jun 26, 2024
@MatMoore
Copy link
Contributor Author

Should deployment be triggered by creating a github release, instead of merge to main? This syncs up the deployment to MOJ with the release & versioning process.

@jemnery jemnery added the production-ready Non-functional things label Jun 27, 2024
@tom-webber tom-webber self-assigned this Jul 8, 2024
@tom-webber tom-webber moved this from Todo to In Progress in Data Catalogue Jul 10, 2024
@tom-webber tom-webber linked a pull request Jul 11, 2024 that will close this issue
@tom-webber tom-webber moved this from In Progress to Review in Data Catalogue Jul 12, 2024
@github-project-automation github-project-automation bot moved this from Review to Done in Data Catalogue Jul 12, 2024
@tom-webber tom-webber linked a pull request Jul 12, 2024 that will close this issue
@tom-webber tom-webber reopened this Jul 12, 2024
@tom-webber tom-webber removed the status in Data Catalogue Jul 12, 2024
@tom-webber tom-webber moved this to Review in Data Catalogue Jul 12, 2024
@github-project-automation github-project-automation bot moved this from Review to Done in Data Catalogue Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
production-ready Non-functional things
Projects
Status: Done ✅
3 participants