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

Templates - Second Pass #616

Closed
10 of 16 tasks
petey opened this issue Jun 19, 2017 · 2 comments
Closed
10 of 16 tasks

Templates - Second Pass #616

petey opened this issue Jun 19, 2017 · 2 comments
Labels

Comments

@petey
Copy link
Contributor

petey commented Jun 19, 2017

Background See #470

   steps: 
       - test: echo test
       - publish: echo publish

Inside user's screwdriver.yaml:

main:
   template: mytemplate@1
   steps: 
       - pretest: echo hello
       - posttest: echo goodbye

Translates into:

   steps:
       - pretest: echo hello
       - test: echo test
       - posttest: echo goodbye
       - publish: echo publish
main:
   template: mytemplate@1
   steps: 
       - publish: echo not publishing

Translate into:

   steps:
       - test: echo test
       - publish: echo not publishing

Nice to have:

  • Publish multiple templates from one repo

Changelog

2017-7-6

  • Added PR link for wrapping steps

2017-7-10

  • Added PR link for create, validate, and publish documentation
  • Added documentation requirements for wrapping and overriding steps

2017-7-13

  • Added PR links for data schema and models for tagging

2017-7-14

  • Added PR link for tagging API, tags in config-parser

2017-7-24

  • Added checkbox for template namespacing

2017-7-28

  • Added links to template tagging module and documentation PRs

2018-3-19

  • Added link to template namespace issue
@d2lam
Copy link
Member

d2lam commented Jul 11, 2017

Template tagging

For template tagging, we decided to have a new table called templateTags.
This will be a map of tag and version.
1 version can be mapped to multiple tags, but 1 tag can only be mapped to 1 version.

Example: mytemplate@1.2.0 can be tagged as stable and latest

The templateTags table will look like this

id name tag version
1 mytemplate stable 1.2.0
2 mytemplate latest 1.2.0

If they retag stable with version 1.1.0, then the table will look like

id name tag version
1 mytemplate stable 1.1.0
2 mytemplate latest 1.2.0

Permissions

We will only allow build scope for now. Only the pipeline that first creates the template has the permission to tag it.

@FenrirUnbound
Copy link
Collaborator

Some notes with using it as of writing:

  1. Tagging in a build isn't easy

The publishing operation does not make it easy to determine what version was published. The only indicator about the new version is this message:

Template FenrirUnbound/my-template@1.2.18 was successfully published

In order to determine the exact version that was published, we need to:

  • save the output of the publish to a file
  • parse the file for the exact version that was published
  • save that version to be used with the tagging operation

This problem kind of goes away if the template owner explicitly defines a major.minor.patch version in their sd-template.yaml. The oddities with this method is that you have to be sure to change it in two places, and you can't run more than one build without a code change.

  1. Defining the --name value should be implied

Having an option for --name to be provided is nice to explicitly define the template to tag. It would be more convenient to have that value determined by the sd-template.yaml file. The publish operation determines the name based on the sd-template.yaml file so I would expect that the tagging operation would infer the same value.

This was referenced Mar 16, 2018
@tkyi tkyi changed the title Job Templates - Second Pass Templates - Second Pass Jun 6, 2018
@jithine jithine closed this as completed Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants