-
Notifications
You must be signed in to change notification settings - Fork 71
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
add support for arbitrary with
values for beaker.yml workflow
#858
Conversation
Example `.sync.yml` snippet: .github/workflows/ci.yml: with: hosts: master,replica,client
75a9497
to
97ac939
Compare
@@ -22,6 +22,9 @@ jobs: | |||
<%- if @configs['acceptance_tests'] && Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].any? -%> | |||
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2 | |||
with: | |||
<%- if @configs['with'] -%> | |||
<%= @configs['with'].to_yaml.split("\n")[1..-1].join.gsub(/^/, ' ' * 6) %> | |||
<%- end -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very familiar with modulesync and this config, but if @configs['with']
is a hash why bother manipulating it as a multi line string and not just:
<%- if @configs['with'] -%>
<%- @configs['with'].each do |k,v| -%>
<%= k %>: <%= v %>
<%- end -%>
<%- end -%>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because yaml is sensitive to indention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a plan to refactor all .sync.yml files so that we in the end could end up with this being something like:
<%- if @configs['acceptance_tests'] && Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].any? -%>
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
<%- else -%>
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v2
<%- end -%>
<%- if @configs['with'] -%>
with:
<%- @configs['with'].each do |k,v| -%>
<%= k %>: <%= v %>
<%- end -%>
<%- end -%>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you volunteered...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@h-haaks send us a PR :) and we could also switch to json if that's easier. I don't mind it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do I actually test my changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #887
I'll start working right away :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you spin up a PR against this repo it will do a noop msync to all repos as a CI job and print you the diff. And please run msync against our puppet-example repo and provide a real PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #888
I'm closing this. Please reopen it if needed :) |
Example
.sync.yml
snippet:Related to: