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

Adding basic support for Imports (template composing) #4

Closed
wants to merge 1 commit into from

Conversation

robzienert
Copy link
Member

As mentioned, some pipeline templates can get really long. This is a first pass at offering the ability for people to breakup templates into multiple files.

@spinnaker/reviewers PTAL

Copy link

@jeyrschabu jeyrschabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds simple enough. Any plans to support a full fledge import?

@robzienert
Copy link
Member Author

Not sure. I think the mental burden on users may be a little much if people start spreading root-level stage definitions all over the place. Would like to see how this initial set of capabilities works for people, and if it is truly necessary and not unreasonable, we could revisit.

become ignored:

* `source`: Imports cannot inherit from other templates or other Imports.
* `imports`: Imports cannot include other Imports.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about why this wouldn't be allowed (not sure if it would be a good idea, but I'm imagining someone might want to put together a module that's composed of other modules).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No technical reason except limiting scope of the feature. Definitely some niceities in allowing recursive imports, though.


Imports can be included into a Template or Configuration using the Template
Loader syntax. The Partials and Modules contained in an Import are automatically
namespaced onced imported as `{{importId}}.{{partialId|moduleId}}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if you should be able to define some sort of aliasing of your imported modules/partials. I'm envisioning a case where you want to use a parent template, but you want to override a module/partial that it uses with an imported module/partial.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thought!

@robzienert robzienert closed this Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants