-
Notifications
You must be signed in to change notification settings - Fork 20
Improve the frontend #5
Improve the frontend #5
Conversation
Old argument structure and naming was chaotic. Now the generator has the following options, consistently named and straightforward: --from-file: Read ci-operator config from this file --from-dir: Walk and process all ci-operator configs under directory --from-release-repo: Shortcut to --from-dir=$GOPATH/github.com/openshift/release/ci-operator/config --to-file: Write generated jobs into this single file --to-dir: Write generated jobs into files under directory --to-release-repo: Shortcut to --to-dir=$GOPATH/github.com/openshift/release/ci-operator/jobs The --from and --to arguments can be combined arbitrarily.
cmd/ci-operator-prowgen/main.go
Outdated
| } | ||
|
|
||
| } else { | ||
| fmt.Fprintf(os.Stderr, "ci-operator-prowgen needs at least one of `--to-{file,dir,release-repo}` options\n") |
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.
In a lot of our command-line tools we split up the input validation logic and execution logic so that when executing we can assume validity of input. Do you think that would potentially make this logic cleaner?
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.
Good point. Yeah, I knew this was borderline when I committed it. I will invest a bit more work to simplify it. But in the end there will always be four slightly different cases in the flow, as the directory and file processing are quite different.
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.
@stevekuznetsov PTAL now
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: petr-muller, stevekuznetsov The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Old argument structure and naming was chaotic. Now the generator has the
following options, consistently named and straightforward:
--from-file: Read ci-operator config from this file--from-dir: Walk and process all ci-operator configs under directory--from-release-repo:Shortcut to
--from-dir=$GOPATH/src/github.com/openshift/release/ci-operator/config--to-file: Write generated jobs into this single file--to-dir: Write generated jobs into files under directory--to-release-repo:Shortcut to
--to-dir=$GOPATH/src/github.com/openshift/release/ci-operator/jobsThe --from and --to arguments can be combined arbitrarily.