finos / finos/morphir-go

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

Open
#34 0 comments 1 reaction 2 assignees Claimed by @DamianReeves View on GitHub
Dominant language
Go
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

# 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.

```bash
# 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
```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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.