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

copier support #25556

Closed
20 of 51 tasks
rarkins opened this issue Nov 2, 2023 · 4 comments · Fixed by #29215
Closed
20 of 51 tasks

copier support #25556

rarkins opened this issue Nov 2, 2023 · 4 comments · Fixed by #29215
Labels
help wanted Help is needed or welcomed on this issue new package manager New package manager support priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Nov 2, 2023

New package manager questionnaire

Did you read our documentation on adding a package manager?

Basics

What's the name of the package manager?

Copier

What language(s) does this package manager support?

It is a tool that generates/scaffolds any text files, according to the template. The templates are Git repos, and they use Git tags for versioning.

How popular is this package manager?

Currently, 1.3k stars on GitHub, and 139 forks.

Does this language have other (competing?) package managers?

  • Yes (give names).
  • Cookiecutter
  • Yeoman

What are the big selling points for this package manager?

It is not for updating dependencies, but it is intended to keep the scaffolded code up-to-date.

For example, README file is part of scaffolding, and if a badge needs to be updated, the automatic re-run of copier (executed by Renovatebot) would prepare a PR to update the badge.

Detecting package files

What kind of package files, and names, does this package manager use?

Every project scaffolded using copier has the following file: .copier-answers.yml

Which fileMatch pattern(s) should Renovate use?

Probably something like .copier-answers.yml

Do many users need to extend the fileMatch pattern for custom file names?

Probably something like (.*)\.copier-answers.yml$

  • Yes, provide details.
  • No.

Is the fileMatch pattern going to get many "false hits" for files that have nothing to do with package management?

IMHO not.

Parsing and Extraction

Can package files have "local" links to each other that need to be resolved?

No.

Package file parsing method

The package files should be:

  • Parsed together (in serial).
  • Parsed independently.

Which format/syntax does the package file use?

  • JSON
  • TOML
  • YAML
  • Custom (explain below)

How should we parse the package files?

  • Off the shelf parser.
  • Using regex.
  • Custom-parsed line by line.
  • Other.

Does the package file have different "types" of dependencies?

  • Yes, production and development dependencies.
  • No, all dependencies are treated the same.

List all the sources/syntaxes of dependencies that can be extracted

The YAML file contains the following fields:

  • _commit, typically Git tag, e.g. v2.7.0. PEP 440
  • _src_path: The template path, e.g. git@github.com:pawamoy/copier-poetry.git`

Describe which types of dependencies above are supported and which will be implemented in future

The template doesn't have to be a Git repo, it could be also a local path. But this is not interesting for Renovate, IMHO.

When executing copier, it uses the latest version according to PEP-440, but e.g. latest commit from a branch could be specified manually: https://copier.readthedocs.io/en/latest/generating/#copying-dirty-changes

Versioning

What versioning scheme does the package file(s) use?

PEP 440

Does this versioning scheme support range constraints, like ^1.0.0 or 1.x?

  • Supports range constraints (for example: ^1.0.0 or 1.x), provide details.
  • No.

Lookup

Is a new datasource required?

  • Yes, provide details.
  • No.

Will users want (or need to) set a custom host or custom registry for Renovate's lookup?

  • Yes, provide details.
  • IMHO same as when updating e.g. Git submodule.
  • No.

Where can Renovate find the custom host/registry?

  • No custom host or registry is needed.
  • In the package file(s), provide details.
  • IMHO same as e.g. Git submodule.
  • In some other file inside the repository, provide details.
  • User needs to configure Renovate where to find the information, provide details.

Are there any constraints in the package files that Renovate should use in the lookup procedure?

  • Yes, there are constraints on the parent language (for example: supports only Python v3.x), provide details.
  • copier requires Python 3.8 or newer
  • Yes, there are constraints on the parent platform (for example: only supports Linux, Windows, etc.), provide details.
  • Yes, some other kind of constraint, provide details.
  • Requires Git 2.27 or newer.
  • No constraints.

Will users need the ability to configure language or other constraints using Renovate config?

  • Yes, provide details.
  • No.

Artifacts

Does the package manager use a lock file or checksum file?

  • Yes, uses lock file.
  • Yes, uses checksum file.
  • Yes, uses lock file and checksum file.
  • No lock file or checksum.

Is the locksum or checksum mandatory?

  • Yes, locksum is mandatory.
  • Yes, checksum is mandatory.
  • Yes, lock file and checksum are mandatory.
  • No mandatory locksum or checksum.
  • Package manager does not use locksums or checksums.

If lockfiles or checksums are used: what tool and exact commands should Renovate use to update one (or more) package versions in a dependency file?

Package manager cache

Does the package manager use a cache?

  • Yes, provide details.
  • No.

If the package manager uses a cache, how can Renovate control the cache?

  • Package manager does not use a cache.
  • Controlled via command line interface, provide details.
  • Controlled via environment variables, provide details.

Should Renovate keep a cache?

  • Yes, ignore/disable the cache.
  • Same as for e.g. Git submodules.
  • No.

Generating a lockfile from scratch

Renovate can perform "lock file maintenance" by getting the package manager to generate a lockfile from scratch.
Can the package manager generate a lockfile from scratch?

  • Yes, explain which command Renovate should use to generate the lockfile.
  • No, the package manager does not generate a lockfile from scratch.
  • No, the package manager does not use lockfiles.

Other

What else should we know about this package manager?

Originally posted by @augi in #25538 (comment)

@rarkins rarkins added type:feature Feature (new functionality) new package manager New package manager support priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Nov 2, 2023
@renovatebot renovatebot deleted a comment from github-actions bot Nov 2, 2023
@ThomasSanson
Copy link

Dear @rarkins and the Renovate Team,

I am writing to propose a substantial extension for the integration of Copier within Renovate, focusing on the management of multiple models and the automation of the update process. Please find below the key aspects of my suggestion, supported by the official Copier documentation: Applying Multiple Templates to the Same Subproject.

Management of Multiple Models:

  • Automatic Identification of Copier Files: It would be most beneficial if Renovate could automatically detect Copier configuration files, typically named .copier-answers.xxx.yml. These files may reside in various locations, including the root or specific directories such as .config/copier/.
  • Reading and Analysing Content: Each configuration file should be meticulously read to ascertain the current versions of the models being utilised.
  • Verification of Updates: A comparison of the recorded versions with the latest available models, based on Git tags, would be most advantageous.

Automated Update Process:

  • Automatic Generation of Issues and Merge Requests: Should there be an identification of outdated versions, the generation of corresponding issues and merge requests would be most prudent.
  • Execution of Updates with Copier: Employing the command copier update --force --answer-files .config/copier/.copier-answers.xxx.yml (or an appropriate path) for each model requiring an update would be exceedingly efficient.

This integration would markedly improve the management of dependencies and configurations in complex projects, by automating processes and ensuring consistent coherence and currency. This development would enhance the utility of Renovate in more complex development scenarios, providing superior support for environments where Copier is extensively used for code maintenance and configuration.

I am most grateful for your consideration of this proposal, which I believe could greatly enrich Renovate's capabilities in managing projects utilising Copier.

Kind regards,

@ThomasSanson
Copy link

Hi team,

Just following up here. Any updates or further thoughts would be greatly appreciated.

Thanks !

@rarkins
Copy link
Collaborator Author

rarkins commented Jan 4, 2024

This proposal is accepted - PRs welcome

@rarkins rarkins added the help wanted Help is needed or welcomed on this issue label Jan 4, 2024
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 38.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Help is needed or welcomed on this issue new package manager New package manager support priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants