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

  1. Ensure you are in your project’s root directory and run:

    git switch main && git switch -c copier-update
    copier update --trust
    
  2. Review your previous answers and provide answers to any new questions.

  3. Check for and resolve any merge conflicts:

    git status
    
  4. Review, then stage the changes:

    git status
    git diff
    git add .
    
  5. Run pre-commit on the entire repository and ensure it passes:

    pre-commit run -a
    
  6. Commit and submit the update via a PR:

    git add . && git commit -m "Update to Copier template 0.4.2" && 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.4.2

Automatic update

RenovateBot supports updating Copier templates. If your repository is hosted within the salt-extensions organization, you will receive automated PRs for template updates. Review these carefully before merging and ensure CI is passing since Renovate will submit merge conflicts - it adds a PR comment warning about them though.

Hint

When an update introduces a new Copier template question, the automated PR uses the default value. If you want to use a custom one, just perform a manual update.