Overview

Filegen 6.0 introduces Copier-based generation for DevOps and Backstage templates, while legacy goals continue to work for other file types.

What Uses Copier (New)

Template Init Goal Update Goal

DevOps (Kubernetes, Skaffold)

filegen:copier-init -Dcopier.template=devops

filegen:copier-update -Dcopier.template=devops

Backstage (catalog-info.yaml)

filegen:copier-init -Dcopier.template=backstage

filegen:copier-update -Dcopier.template=backstage

All Standard (currently DevOps + Backstage)

filegen:copier-init

filegen:copier-update

What Uses Legacy Goals (Unchanged)

File Type Goal

Jenkins pipeline config

filegen:jenkins-yaml

Verification & Validation (VV) config

filegen:generate-vv

DIBR (Deployment, Installation, Backout, Rollback) guide

filegen:generate-dibr

Why Copier? Static vs. Dynamic Templates

Filegen 5.x used static template generation: files were generated once and never updated. This created significant maintenance challenges over time. Filegen 6.0 adopts Copier-based dynamic templates which fundamentally change how configuration files are managed.

Aspect Static Generation (5.x) Copier Templates (6.0)

Updates

Overwrites all files, then manually revert unwanted changes

Automatic - copier-update merges changes intelligently

Customizations

Lost on regeneration

Preserved via 3-way merge

Bug fixes

Require manual intervention across all services

Roll out via template update

Consistency

Drift over time as teams make ad-hoc changes

Convergence via shared template

Audit trail

None - no record of original template

.copier-answers/ tracks template origin and version

Best practices

Frozen at generation time

Continuously improved

The Real-World Problem

Consider a typical scenario with static generation:

  1. You generate Kubernetes configs for 20 services in January

  2. In March, you discover a security issue requiring a label change

  3. In May, the team adds a new Skaffold profile everyone needs

  4. In July, resource limits need adjustment based on production data

With static generation, each change requires:

  • Re-running filegen, which overwrites all generated files

  • Manually reverting unwanted changes file-by-file using git diff/git checkout

  • Risk of accidentally losing intentional customizations

  • Each update becomes increasingly tedious as customizations accumulate

With Copier templates:

# Copier CLI - Fix is added to template once, then for each service:
copier update -a .copier-answers/devops.yaml

# Maven equivalent
mvn filegen:copier-update -Dcopier.template=devops

# Review changes, resolve conflicts, done

Key Benefits

Updateable Configurations

Re-run updates to incorporate template improvements without regenerating from scratch. The template repository becomes a living source of best practices that all services can adopt.

Intelligent 3-Way Merge

Copier compares three versions: (1) the original template when you first ran it, (2) your current files with local modifications, and (3) the new template version. This allows it to:

  • Automatically merge non-conflicting changes

  • Preserve your intentional customizations

  • Only prompt you when there’s a genuine conflict

    This is the same algorithm Git uses for merges, applied to template management.

Auto-Detection from pom.xml

The template reads your pom.xml to automatically populate:

  • artifactId → service name, image name, deployment name

  • groupId → namespace hints

  • version → image tags

  • description → Backstage catalog descriptions

    This eliminates manual entry errors and ensures consistency.

Version Pinning and Rollback

The .copier-answers/devops.yaml file records exactly which template version was used:

_commit: abc123def
_src_path: https://coderepo.../ngss-devops-template.git
Never edit the Copier answers files directly as these are managed by Copier itself. See https://copier.readthedocs.io/en/stable/updating/#never-change-the-answers-file-manually.

This enables:

  • Reproducing the exact configuration at any point

  • Updating to a specific version: copier-update -Dcopier.version=v2.0.0

  • Rolling back if a new version causes issues

    See Template Versioning for details on selecting versions, checking for updates, and using pre-releases.

Separation of Concerns

Infrastructure best practices live in the template repository, not scattered across service repos. The DevOps team can improve the template, and service teams adopt changes at their own pace.

Next Steps

Continue to Migration Steps for detailed instructions.