-
Notifications
You must be signed in to change notification settings - Fork 17
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
Feature: Add zones input variable to optional sync a subset of zones in the configuration #104
Conversation
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.
Thank you so much for working this out and suggesting the change, @maikelpoot! 🙇 Please forgive my delays in following up on your pull request.
I'm a little concerned that we're relying on the runner's /bin/bash
to handle space-separated zones. Is it safe to assume any runner a user selects in their workflow will have a /bin/bash
that does the needful?
The steps below failed in my macOS workstation's default /bin/zsh
:
% _config=fixtures/configs/dynamic-zones.yaml
% ZONES="test1.octodns-sync. test2.octodns-sync."
% _zones=$ZONES
% octodns-sync --config-file=$_config $_zones
[...]
octodns.manager.ManagerException: Requested zone "test1.octodns-sync. test2.octodns-sync." not found in config
However, the same steps succeeded in /bin/bash. I'm OK with merging the input as you wrote it, and re-evaluating if anyone has trouble using it.
Before we merge it, please add the new input to README.md:
### `zones`
Space separated list of zones to sync, leave empty to sync all zones in the config file.
Default: `""` (empty string)
And to docs/CHANGELOG.md:
## [Unreleased]
### Added
- ([#104](https://github.com/solvaholic/octodns-sync/pull/104)) Add input **zones** to allow syncing a subset of configured zones.
(I did try to make those doc changes myself, and did not have permission to update maikelpoot:zones.)
No worries, we are all busy :)
It should as your action defines the command to be run with the bash shell. For zsh the line could be altered to
Yeah sorry, as i changed our production repo to use "my" fork/branch it seemed best to disable that option. Added the requested changes to the documentation. test.sh: X="A B C"
echo "Normal: ./test2.sh \${X}"
./test2.sh ${X}
echo "Word splitting: ./test2.sh \${=X}"
./test2.sh ${=X} test2.sh: % cat test2.sh
#!/bin/zsh
echo 1 $1
echo 2 $2
echo 3 $3
edit: split quote and reply |
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.
Thank you @maikelpoot! 🙇
Thanks for adding those, and thinking through this:
Given that and the |
Description
This PR will add the a zones input to utilize the "zone" parameter from octodns-sync to only sync specific zones from the configuration.
Motivation and Context
We use the octodns-sync action to dry-run the zone changes in a PR.
But in most PR's only 1 or 2 zones are changed to it's a bit wasteful in api-calls and time to dry-run all the zones and not only the changed zones.
The octodns-sync application has support for this but the github action did not yet.
How Has This Been Tested?
This has been tested by creating a fork, and switching our real-world (staging and production) repo's over to the fork.
In combination with the
tj-actions/changed-files
github action, our PR's only dry-run altered zone yaml files.Snippet from our GithubAction
Anything else?
Output of real PR (domain and target are redacted):
This sync only took 4 seconds to run, before (with all zones) a sync would take about 2.5 minutes (159 seconds).