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

this should be merged only after openshift/ci-operator#121 is merged

/hold

Parse ci-operator config files as YAML instead of JSON. Generated jobs do not change, except for the ConfigMap part, where we generate the filename to always be a .yaml, so we won't be able to generate jobs for .json files in the directory-walking mode. (I need to fix this)

@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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 31, 2018
@petr-muller
Copy link
Member Author

/cc @stevekuznetsov

@stevekuznetsov
Copy link
Contributor

so we won't be able to generate jobs for .json files in the directory-walking mode. (I need to fix this)

I don't understand this -- care to elaborate?

Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

/lgtm

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

petr-muller commented Sep 3, 2018

I don't understand this -- care to elaborate?

I will rectify the underlying problem, but to explain: When passed --from-dir, the generator walks the directory and searches for all *.json (before) / *.yaml (after) files there. It considers its filename, without extension, to be a branch name. Based on the branch name, it then generates the jobs, including this part:

- name: CONFIG_SPEC
  valueFrom:
    configMapKeyRef:
      key: branch.yaml

The key: branch.yaml part should match the source filename, but the source filename is not stored anywhere, just the branch part is, and the key: branch.yaml is generated simply by sprintf("%s.yaml"). Therefore, in the --from-dir mode, it needs to ignore *.json files because it would still generate key: <name>.yaml for such files, which would be broken. If the generator wants to support legacy json files (or even YAML files with the .yml suffix), it will need to correctly propagate full filename to this field.

Which is what I will do in next 20 minutes :)

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 3, 2018
@petr-muller
Copy link
Member Author

petr-muller commented Sep 3, 2018

Fixed now. The diff is slightly obfuscated by 6620518 which just collapses all those string, string, string, string to a struct. I can PR is separately if you want.

@stevekuznetsov
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 4, 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

@petr-muller
Copy link
Member Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 4, 2018
@openshift-merge-robot openshift-merge-robot merged commit 3b43319 into openshift:master Sep 4, 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants