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

Introduce templates for new packages #14144

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hellcp-work
Copy link
Contributor

@hellcp-work hellcp-work commented Apr 12, 2023

Introduces a simple template support to new project creation. Currently only supports one type of a package, SUSE style RPM, but it can be easily expanded to support everything that may be needed.

To verify:

  1. Create a new project for templates
  2. Set the OBS:PackageTemplates attribute on the project
  3. Create a package in the template project
  4. Create a file with name like: {{ package.name }}.extension.liquid and contents like {{ user.name }} (other options are in src/api/app/services/package_service/templater/{project,package,user}_drop.rb files)
  5. Go to any other project
  6. Click a create new package button
  7. Write metadata about the new package
  8. Select the template you created in the template project
  9. Observe the package be initialized with a set of files

TODO:

  • Create test data
  • Create tests
  • Write documentation for the feature

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Apr 12, 2023
@hellcp-work
Copy link
Contributor Author

@eduardoj eduardoj added the review-app Apply this label if you want a review app started label Apr 12, 2023
@obs-bot
Copy link
Collaborator

obs-bot commented Apr 12, 2023

Review app will appear here: http://obs-reviewlab.opensuse.org/hellcp-work-templates

@hennevogel
Copy link
Member

This would require code changes and deployments for every template change. I'm not sure this is such a good idea.

@hellcp-work hellcp-work marked this pull request as draft April 17, 2023 08:02
@hennevogel hennevogel removed the review-app Apply this label if you want a review app started label Oct 24, 2023
@hellcp-work
Copy link
Contributor Author

This would require code changes and deployments for every template change. I'm not sure this is such a good idea.

I went for a similar mechanism to image templates now. I implemented basic templating with liquid, in order to prefill some metadata, to avoid having to do that manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants