Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document template migration strategies across copier versions #348

Closed
4 tasks done
yajo opened this issue Feb 10, 2021 · 1 comment · Fixed by #428
Closed
4 tasks done

document template migration strategies across copier versions #348

yajo opened this issue Feb 10, 2021 · 1 comment · Fixed by #428
Assignees
Milestone

Comments

@yajo
Copy link
Member

yajo commented Feb 10, 2021

As Copier evolves, it will mean:

  • Old features deprecated.
  • New features landed.
  • Some features changed.

Specifically, Copier v6 will be one starting point for such situations.

However, there's one little big problem: when you upgrade one subproject from template v1 to v2, the template itself needs to be properly rendered in v1 to be compared to the subproject and extract the diff... well, we all know this at this point. But if Copier 6 renders differently the template v1 as compared to how Copier 5 would, then the template developer is on big trouble: How to evolve a subproject from a Copier v5-only template to a Copier v6-only template?

Hopefully, later Copier versions will not be so breaking, but v6 will be different and wants to introduce some new ideas.

Until now, the only important removals have been:

Not big problems. Copier v5 templates can live without those. But there are other features that can be more breaking:

So, to fix this situation, _min_copier_version will change a bit.

So, what does _min_copier_version: x.y.z mean?

  1. The template will not work with Copier < x.y.z. This is how it worked since it was introduced in Assert minimal copier version #198 for v3.1.0.
  2. The template will be supported until, at least, Copier (x+1).*.*
  3. The template will not work in Copier (x+2).*.* or later. A warning will be printed in Copier (x+1).*.*, specifying that the template may have some problems in newer versions.

So, Copier 6 will be backwards compatible with Copier 5 templates, and Copier 7 will be backwards compatible with Copier 6 templates, etc.

Starting from Copier 6, the field will default to 5.1.0, and starting from Copier 7, it will be required.

To implement this finely, some ideas:

After all, we need a way to be able to drop features safely at some point.

@yajo yajo self-assigned this Feb 10, 2021
@yajo yajo added this to the v6.0.0 milestone Feb 10, 2021
yajo added a commit that referenced this issue Feb 14, 2021
Targeting #348, from now on, if we cannot check the copier version or the installed version's major part is bigger than the template's minimal major part, there'll be proper warnings.
@yajo
Copy link
Member Author

yajo commented Feb 14, 2021

After triple-thinking this, I realized:

  • There are ways to implement the specified new features without breaking compatibility, so there's no need to be so strict.
  • Downstream templates can just have CI that checks no warnings happen, or that tests against several copier versions in a matrix.
  • Copier 6 supports (finally) recopying, so in case an update fails badly, you can workaround it by recopying.

So it seems I don't need to be sooo strict, at least for now.

Just, if a template uses an older min version, some behaviors might change for one major version lifecycle.

yajo added a commit that referenced this issue Feb 14, 2021
Targeting #348, from now on, if we cannot check the copier version or the installed version's major part is bigger than the template's minimal major part, there'll be proper warnings.
yajo added a commit that referenced this issue Apr 17, 2021
🤦‍♂️ it seems I forgot to document a lot of changes.

Merging this fixes #348 because it includes docs about template migration.
yajo added a commit that referenced this issue Apr 18, 2021
🤦‍♂️ it seems I forgot to document a lot of changes.

Merging this fixes #348 because it includes docs about template migration.
yajo added a commit that referenced this issue Apr 18, 2021
🤦‍♂️ it seems I forgot to document a lot of changes.

Merging this fixes #348 because it includes docs about template migration.
@yajo yajo changed the title Add more constrains to _min_copier_version document template migration strategies across copier versions Jun 16, 2021
yajo added a commit that referenced this issue Jul 17, 2021
Try to answer a good question: when you upgrade one subproject from template v1 to v2, the template itself needs to be properly rendered in v1 to be compared to the subproject and extract the diff... well, we all know this at this point. But if Copier 6 renders differently the template v1 as compared to how Copier 5 would, then the template developer is on big trouble: How to evolve a subproject from a Copier v5-only template to a Copier v6-only template?

Fix #348
@yajo yajo closed this as completed in #428 Jul 17, 2021
yajo added a commit that referenced this issue Jul 17, 2021
Try to answer a good question: when you upgrade one subproject from template v1 to v2, the template itself needs to be properly rendered in v1 to be compared to the subproject and extract the diff... well, we all know this at this point. But if Copier 6 renders differently the template v1 as compared to how Copier 5 would, then the template developer is on big trouble: How to evolve a subproject from a Copier v5-only template to a Copier v6-only template?

Fix #348
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant