Skip to content

Add hack/sync-mint-embed script to automate embed file sync #2965

Description

@fullsend-ai-retro

What happened

Renovate opened PR #2854 to bump functions-framework-go from v1.9.0 to v1.9.2 in internal/mint/go.mod. CI ran make lint-all which executes pre-commit run --all-files. The lint-mint-embed-sync hook detected that internal/mint/go.mod and go.sum differ from their .embed counterparts in internal/dispatch/gcf/mintsrc/, printing two DESYNC errors. The PR has been open since 2026-07-01 with auto-merge enabled but blocked by this CI failure. No human or agent review occurred because CI never passed.

What could go better

The repo has hack/lint-mint-embed-sync to detect desync but no companion script to fix it. The AGENTS.md documents a manual copy process for syncing these files. This means any change to internal/mint/ — whether from Renovate, a code agent, or a human — requires manual knowledge of the embed sync requirement. A fixer script would enable automation (Renovate postUpgradeTasks, pre-commit auto-fix hooks) and reduce the cognitive burden on contributors.

Proposed change

Create hack/sync-mint-embed that performs the inverse of the lint script:

  1. For each non-test file in internal/mint/, copy it to internal/dispatch/gcf/mintsrc/<name>.embed. For go.mod, apply the replace-directive rewrite (=> ../mintcore=> ./mintcore) before writing.
  2. For each non-test file in internal/mintcore/, copy it to internal/dispatch/gcf/mintsrc/mintcore/<name>.embed.
  3. Add a Makefile target sync-mint-embed: hack/sync-mint-embed.

The logic should mirror hack/lint-mint-embed-sync exactly (same file iteration, same go.mod special case, same test-file exclusion) to guarantee that running sync followed by lint always succeeds.

Validation criteria

Running hack/sync-mint-embed && hack/lint-mint-embed-sync exits 0 after any modification to files in internal/mint/ or internal/mintcore/. Verify by modifying internal/mint/go.mod and confirming the sync script updates internal/dispatch/gcf/mintsrc/go.mod.embed with the correct replace-directive rewrite.


Generated by retro agent from #2854

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/dispatchWorkflow dispatch and triggerscomponent/mintToken mint and cross-boundary credentialsfeatureFeature-category issue awaiting human prioritizationpriority/mediumNormal priority, plan for next cycleready-for-triageRetro-filed issue awaiting triage agenttriagedTriaged but awaiting human prioritizationtype/choreMaintenance and housekeeping tasks

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions