Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

Conversation

@petr-muller
Copy link
Member

@petr-muller petr-muller commented Aug 27, 2018

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/jobs

The --from and --to arguments can be combined arbitrarily.

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 27, 2018
@petr-muller
Copy link
Member Author

/cc @bbguimaraes @stevekuznetsov

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.
}

} else {
fmt.Fprintf(os.Stderr, "ci-operator-prowgen needs at least one of `--to-{file,dir,release-repo}` options\n")
Copy link
Contributor

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?

Copy link
Member Author

@petr-muller petr-muller Aug 27, 2018

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

@stevekuznetsov PTAL now

@stevekuznetsov
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 28, 2018
@openshift-ci-robot
Copy link

[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

Details 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

@openshift-merge-robot openshift-merge-robot merged commit cf0de90 into openshift:master Aug 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. 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.

4 participants