Updating your Saltext¶
Copier allows you to keep your Salt extension repository up to date with the latest best practices. Updating fetches the latest template release, uses your saved answers as defaults, and applies your customizations.
Manual update¶
Manual updates let you:
Update answers to existing questions
Provide answers to new questions
Resolve merge conflicts when customized files change in the template
Workflow¶
Ensure you are in your project’s root directory and run:
git switch main && git switch -c copier-update copier update --trust
Review your previous answers and provide answers to any new questions.
Check for and resolve any merge conflicts:
git status
Remove any unwanted regenerated boilerplate files (a subset of
ls src/**/*_mod.py tests/**/test_*.py
).[1]Review, then stage the changes:
git status git diff git add .
Run
pre-commit
on the entire repository and ensure it passes:pre-commit run -a
Commit and submit the update via a PR:
git add . && git commit -m "Update to Copier template 0.3.7" && git push
Skip reviewing answers¶
To skip reviewing existing answers:
copier update --trust --skip-answered
Always use default answers¶
To skip new questions and use defaults:
copier update --trust --skip-answered --defaults
Hint
This command is non-interactive.
Update to a specific version¶
To update to a specific template version:
copier update --trust --skip-answered --vcs-ref=0.3.7
Automatic update¶
RenovateBot supports updating Copier templates. If your repository is hosted within the salt-extensions
GitHub organization, automated PRs for template updates will be provided in the future. Review these carefully before merging.
Important
This feature is not yet implemented due to an outstanding issue in Copier.