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

Template mixins #1359

Conversation

Adirio
Copy link
Contributor

@Adirio Adirio commented Feb 7, 2020

Description

  • 76 file templates did not require the domain but it was being injected.
  • 66 file templates did not require the repository but it was being injected.
  • 72 file templates did not require the multi-group flag but it was being injected.
  • 16 file templates did not require the boilerplate but it was being injected.
  • 27 file templates required the resource and they were being provided manually.

This PR creates mixins for domain, repository, multi-group, boilerplate and resource as proposed in #1358, that inject those fields from the universe only on those templates that need it.

Motivation

This PR is scoped under #1218
Closes #1358

Signed-off-by: Adrian Orive <[email protected]>
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 7, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @Adirio. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 7, 2020
Signed-off-by: Adrian Orive <[email protected]>
Signed-off-by: Adrian Orive <[email protected]>
@Adirio Adirio force-pushed the scaffold-enhancement/template-mixins branch from 903d6dd to 0929f3d Compare February 7, 2020 09:13
Signed-off-by: Adrian Orive <[email protected]>
@Adirio Adirio force-pushed the scaffold-enhancement/template-mixins branch from 0929f3d to 23c0628 Compare February 7, 2020 09:22
Signed-off-by: Adrian Orive <[email protected]>
@Adirio Adirio changed the title [WIP] Template mixins Template mixins Feb 7, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 7, 2020
@Adirio
Copy link
Contributor Author

Adirio commented Feb 7, 2020

@DirectXMan12 This PR will help with the new file interface that was proposed by #1226 (which is quite outdated). Could you take a look?

Despite saying that it has 43 modified files, most of the logic is in pkg/model/file/template.go.
pkg/model/universe.go updates the interface names in its inject method, pkg/scaffold/api.go and pkg/scaffold/webhook.go stop manually providing the resource, and the other 39 files are just using the mixin in the file templates.

@mengqiy mengqiy added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 20, 2020
Copy link
Member

@mengqiy mengqiy left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Adirio, mengqiy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 20, 2020
@mengqiy mengqiy added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 20, 2020
@Adirio Adirio deleted the scaffold-enhancement/template-mixins branch February 21, 2020 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Template mixins
3 participants