ministryofjustice / modernisation-platform

A place for the core work of the Modernisation Platform • This repository is defined and managed in Terraform
https://user-guide.modernisation-platform.service.justice.gov.uk
MIT License
681 stars 290 forks source link

🐛 Instance-Sheduler build-test-push.yml failing to run #8027

Closed ASTRobinson closed 2 months ago

ASTRobinson commented 2 months ago

Expected Behavior

The build-test-push GitHub action should run the go tests on pull requests to ensure no breaking changes are merged in.

Actual Behavior

The docker image fails to build due to dependencies requiring a minimum go version of 1.21.

Steps to Reproduce the Problem

run workflow https://github.com/ministryofjustice/modernisation-platform-instance-scheduler/blob/main/.github/workflows/build-test-push.yml

Workaround

A temporary workaround to specify and manually install a specific Go version has been implemented here on PR https://github.com/ministryofjustice/modernisation-platform-instance-scheduler/pull/1216

Proposal / Suggestions

use one of the official Go Docker images for the build process 🐳 It'd save us having to manually install Go - and dependabot should be able to raise PRs to bump the docker image version, which will bump the Go version

also of note: but it looks like lambda/go:1 is being deprecated in favor of lambda/provided:al2 🧓 🐳

richgreen-moj commented 2 months ago

With this PR I've removed the need to install go at the "builder" stage and instead have used the golang base image to simplify the process.

It also replaces the base image of the final container with lambda/provided:al2 as lambda/go:1 is being deprecated.

This is merged into main and the workflow is working and passing tests. Over time the golang docker image should be kept up to date by dependabot in tandem with the other go dependencies that are being updated.

mikereiddigital commented 2 months ago

Looks good to me, @richgreen-moj.