Skip to content

Add managed_files config for updating arbitrary files on release#81

Merged
zachdaniel merged 1 commit intozachdaniel:masterfrom
jimsynz:feat/managed-files
Mar 24, 2026
Merged

Add managed_files config for updating arbitrary files on release#81
zachdaniel merged 1 commit intozachdaniel:masterfrom
jimsynz:feat/managed-files

Conversation

@jimsynz
Copy link
Copy Markdown
Contributor

@jimsynz jimsynz commented Mar 24, 2026

Summary

  • Adds a managed_files configuration option that allows updating version strings in an arbitrary list of files during release
  • Each entry is a tuple: {path, :mix}, {path, :string}, or {path, replace_fn, pattern_fn} for custom replacements
  • Useful for poncho apps or other projects that need to update multiple mix.exs files or other versioned files
  • Existing manage_mix_version? and manage_readme_version options continue to work and are merged into the managed files list

Example config

config :git_ops,
  managed_files: [
    {"apps/my_app/mix.exs", :mix},
    {"apps/my_other_app/mix.exs", :mix},
    {"README.md", :string},
    {"package.json", fn v -> "\"version\": \"#{v}\"" end, fn v -> "\"version\": \"#{v}\"" end}
  ]

Changes

  • GitOps.Config — new managed_files/0 that merges manage_mix_version?, manage_readme_version, and the new managed_files config into a single list of desugared {path, replace_fn, pattern_fn} tuples
  • GitOps.VersionReplace — replaced update_mix_project/4 and update_readme/4 with a single update_managed_file/4 that operates on desugared 3-tuples
  • Mix.Tasks.GitOps.Release — unified the separate mix.exs and README handling into a single loop over managed files
  • Updated tests and README documentation

Test plan

  • All 115 existing tests pass
  • Compiler clean (warnings-as-errors)
  • Formatter clean
  • Credo clean (2 pre-existing issues only)
  • Dialyzer clean

Adds a `managed_files` configuration option that allows updating version
strings in an arbitrary list of files during release. This is useful for
poncho apps or other projects that need to update multiple mix.exs files
or other versioned files.

Each entry is a tuple: `{path, :mix}`, `{path, :string}`, or
`{path, replace_fn, pattern_fn}` for custom replacements.

The existing `manage_mix_version?` and `manage_readme_version` options
continue to work and are merged into the managed files list.
@zachdaniel zachdaniel merged commit d5755df into zachdaniel:master Mar 24, 2026
@zachdaniel
Copy link
Copy Markdown
Owner

🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants