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

feat: Copier Scaffolder Action #20362

Closed
wants to merge 1 commit into from
Closed

feat: Copier Scaffolder Action #20362

wants to merge 1 commit into from

Conversation

mspiegel31
Copy link
Contributor

@mspiegel31 mspiegel31 commented Oct 4, 2023

Hey, I just made a Pull Request!

This is a scaffolder action to allow the creation of templates using the copier template engine. Copier is somewhat unique in the templating space, as it is version-aware. This means that templates generated from a project are able to stay up-to-date with the template as they are modified over time. Their update algorithm can be found here

Screenshots

Screenshot 2023-10-04 at 12 03 20 PM

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@github-actions github-actions bot added documentation Improvements or additions to documentation area:scaffolder Everything and all things related to the scaffolder project area labels Oct 4, 2023
@awanlin
Copy link
Collaborator

awanlin commented Oct 4, 2023

Hi @mspiegel31, just wanted to share this - #20266 - as it would be good to know the path forward before reviewing.

@freben can you provide some feedback, please?

@mspiegel31
Copy link
Contributor Author

@awanlin thanks for the heads-up! I think this would be great to have in backstage core, and this PR does add some extensions to @backstage/backend-common, so hopefully it's something that is worth looking at while #20266 is being worked through.

@awanlin
Copy link
Collaborator

awanlin commented Oct 4, 2023

Also there already seems to be a module: https://github.com/telia-oss/scaffolder-backend-module-copier

@awanlin
Copy link
Collaborator

awanlin commented Oct 4, 2023

@awanlin thanks for the heads-up! I think this would be great to have in backstage core, and this PR does add some extensions to @backstage/backend-common, so hopefully it's something that is worth looking at while #20266 is being worked through.

Let's wait to hear what @freben thinks 🤔

@mspiegel31
Copy link
Contributor Author

mspiegel31 commented Oct 4, 2023

Also there already seems to be a module: https://github.com/telia-oss/scaffolder-backend-module-copier

that's true! However, that module leverages the fetchContents function from @backstage/plugin-scaffolder-backend, which means that projects generated from templates won't have any version control information. Since that's the "killer feature" of copier, it doesn't make much sense to use that particular action.

additionally, it does look there are just some copy-pasted pieces from the cookiecutter action in that codebase. There is no such thing as a copier.json file, for example; copier uses yaml for its configuration.

tl;dr I think this PR gives a more feature-complete solution, and does provide a way to get the functionality asked for in #14416

@backstage-goalie
Copy link
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/backend-common packages/backend-common minor v0.19.7-next.1
example-backend packages/backend none v0.2.88-next.1
@backstage/plugin-scaffolder-backend-module-copier plugins/scaffolder-backend-module-copier major v0.0.0

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Uffizzi Preview deployment-37638 was deleted.

Signed-off-by: Mike Spiegel <mspiegel31@gmail.com>
@freben
Copy link
Member

freben commented Oct 5, 2023

In the spirit of open source, it'd be really nice to contribute the improvements to the existing open source plugin, I feel. Maybe reach out to them?

@mspiegel31
Copy link
Contributor Author

@freben I'll see what I can do. This PR does contain some enhancements to backend-common; are contributions to that module also affected by #20266 or is it just net-new plugins?

@tudi2d
Copy link
Member

tudi2d commented Oct 5, 2023

Tja @tobias-estefors (main contributor of Telia's scaffolder-backend-module-copier)! Would you be open for contribution on your scaffolder module? Would you be open to collaborate & review the changes? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:scaffolder Everything and all things related to the scaffolder project area documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants