Skip to content

Merge insight-front repository into the insight monorepo #1818

Description

@mitasovr

Goal

Merge the constructorfabric/insight-front repository into the constructorfabric/insight monorepo under src/frontend/, preserving git history.

Why it's cheap

The monorepo already treats the frontend as a component: src/frontend/helm/ is a first-class subchart of the umbrella chart (image ghcr.io/constructorfabric/insight-front), and build-images.yml already accepts a frontend_tag via cross-repo workflow_dispatch from insight-front's docker.yml. Only the sources and CI need to move. There are no path collisions (src/frontend/ contains only helm/; the front repo has no helm/ dir) and no JS tooling in the monorepo to conflict with. API coupling is relative /api/* paths only — no shared types or codegen.

Plan

Phase 0 — preparation (insight-front)

Phase 1 — import history into src/frontend/

git clone https://github.com/constructorfabric/insight-front.git /tmp/front-merge
cd /tmp/front-merge && git filter-repo --to-subdirectory-filter src/frontend

cd insight && git checkout -b merge/insight-front
git remote add front /tmp/front-merge && git fetch front
git merge --allow-unrelated-histories front/main

Cleanup commit in the same PR (history keeps everything, working tree gets trimmed):

  • drop src/frontend/{cypilot,.agents,.codex,.windsurf,.claude,.github} (duplicates the monorepo's cf-studio tooling); replace the near-empty front AGENTS.md/CLAUDE.md with a short src/frontend/AGENTS.md;
  • drop dead eslint-plugin-local/ (compiled dist/ only, referenced nowhere);
  • drop front's LICENSE/NOTICE/SECURITY.md (monorepo has its own).

⚠️ The merge PR must land as a merge commit, not squash — squashing destroys the imported history. Needs a temporary branch-protection exception / admin merge.

Phase 2 — CI/CD

  1. New frontend-ci.yml (port of front's ci.yml: test / lint / typecheck / diff-coverage ≥80%) with paths: [src/frontend/**] and working-directory: src/frontend; its scripts/ci/*.py move to src/frontend/scripts/ci/.
  2. build-images.yml: add frontend to the dorny/paths-filter set + a build job (context src/frontend). Keep the image name ghcr.io/constructorfabric/insight-front so charts, values, and environments stay untouched.
  3. Simplify the release: remove the frontend_tag dispatch input and insight-front's dispatch-umbrella job; publish-chart bumps src/frontend/helm/Chart.yaml appVersion directly when the frontend filter fires — same as api-gateway/analytics/identity. Side benefits: closes the documented manual-frontend-tag-pinning gap (deployment DESIGN.md) and fixes the amd64-only image (front's build matrix is amd64+arm64).
  4. Note: e2e-bronze-to-api, functional-k3s, openapi-specs have no path filters, so frontend PRs will trigger heavy backend e2e. Either accept or add path filters in a separate PR (they are required checks — handle carefully).

Phase 3 — dev ergonomics

  • docker-compose.yml: FRONTEND_MODE=built/dev builds from src/frontend instead of a sibling clone; remove the "git clone insight-front" branch from deploy/compose/insight-init.sh.
  • Optional: JS hooks in .pre-commit-config.yaml, a src/frontend/ rule in CODEOWNERS.
  • Keep front's README as src/frontend/README.md, fix links; add a frontend section to the root README.

Phase 4 — cutover

  1. Land the merge PR; verify the first push to main builds the frontend image and publish-chart bumps the umbrella with the frontend appVersion.
  2. Transfer open issues (works within the org), incl. Silver identity: validate on real data #156/YouTrack: validate bronze on real data #157 (BFF auth), dbt parse broken on main: duplicate model name "to_class_people" after MS Entra merge (#363) + CI gap #195 (KPI trend badge), [FE-08] Migrate API layer to Analytics API spec (per-metric queries, Connector Manager, Identity Service) #68 (nginx non-root).
  3. Archive insight-front (do not delete — monorepo specs reference insight-front#66); point its README to the monorepo.
  4. Add the frontend CI jobs to the required checks on main.

Risks

  • Merge-commit vs branch protection — agree with admins up front.
  • Verify the Playwright container and ubuntu-24.04-arm runners work in the monorepo's CI.
  • Unmerged frontend branches after cutover can only be carried over via cherry-pick.

Estimate

Phases 1–3 are one careful PR plus ~a day of CI debugging; cutover is ~an hour of admin work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions