Skip to content

Issue: Migrate Go Tooling and CI from finos/morphir to finos/morphir-go #34

@DamianReeves

Description

@DamianReeves

MIGRATION PLAN: Morphir-Go Consolidation & Tooling Modernization

1. Overview

This document outlines the procedure to migrate Go tooling, CI/CD, and build scripts from the finos/morphir umbrella repository to finos/morphir-go. A primary goal is to preserve the complete git history while modernizing the build system by replacing Just with mise.

2. Scope of Migration

Source Assets (finos/morphir)

  • cmd/morphir/: The core Go CLI application.
  • pkg/: All Go library packages (IR models, tooling, workspace).
  • scripts/: Development and maintenance scripts.
  • tests/bdd/: Behavioral testing suites.
  • .goreleaser.yaml: Distribution configuration.
  • .github/workflows/: Go-specific build/test/release actions.

Tooling Evolution

  • Deprecate: Justfile
  • Adopt: mise.toml and mise tasks for environment reproducibility and task orchestration.

3. History-Preserving Extraction

To ensure we do not lose the context of previous engineering efforts, use git-filter-repo to isolate the Go-specific history from the umbrella repo.

# Prepare a clean extraction
git clone https://github.com/finos/morphir.git morphir-extraction
cd morphir-extraction

# Filter for relevant paths only
git filter-repo \
  --path cmd/morphir/ \
  --path pkg/ \
  --path scripts/ \
  --path tests/bdd/ \
  --path .github/workflows/ \
  --path .goreleaser.yaml

# Rewrite import paths across history to reflect the new repository
git filter-repo --replace-text <(echo "github.com/finos/morphir==>github.com/finos/morphir-go")

4. Environment & Task Configuration (mise)

Following the "immutable environment" philosophy, create a mise.toml in the root of morphir-go to manage tool versions and tasks.

mise.toml

[tools]
go = "1.23.5"
node = "20"
golangci-lint = "latest"

[env]
GO111MODULE = "on"

[tasks.build]
description = "Build the morphir-go CLI"
run = "go build -o bin/morphir ./cmd/morphir"
sources = ["cmd/**/*.go", "pkg/**/*.go"]
outputs = ["bin/morphir"]

[tasks.test]
description = "Execute all unit and BDD tests"
run = "go test ./..."

[tasks.lint]
description = "Run golangci-lint"
run = "golangci-lint run"

[tasks.ci]
description = "Full CI verification suite"
depends = ["lint", "test", "build"]

5. Integration Steps

  1. Target Setup: In the existing finos/morphir-go repo, add the extracted source as a remote.
  2. Merge: git merge extraction/main --allow-unrelated-histories.
  3. Refactor: Remove any existing Justfile and replace it with the mise.toml tasks.
  4. CI Update: Update .github/workflows to use jdx/mise-action for environment setup.

6. Engineering Requirements

  • Immutability: Ensure Go domain models (Sum/Product types) remain immutable and consistent across the move.
  • Package Integrity: All package references must resolve to github.com/finos/morphir-go post-migration.
  • Testing: BDD tests must be fully operational via mise run test to validate the IR logic integrity.

7. Definition of Done

  • Git history for all Go assets preserved in morphir-go.
  • All imports updated to github.com/finos/morphir-go.
  • Justfile removed; mise handles all build tasks.
  • CI pipeline green on the new repository.
  • Downstream go install for the CLI works via the new URL.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions