Skip to content
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

Allow create prowjob with annotations #9057

Merged
merged 1 commit into from
Aug 15, 2018
Merged

Conversation

krzyzacy
Copy link
Member

So I need to store some extra into into the prowjob, however label is restricted to 256 chars and a certain charaterset, which I cannot store a string in run time (see #9045).. Try to make annotation first class

/area prow
/assign @stevekuznetsov @BenTheElder @cjwagner

@k8s-ci-robot k8s-ci-robot added area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 15, 2018
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 15, 2018
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 15, 2018
@stevekuznetsov
Copy link
Contributor

Adding structured data into annotations is an anti-pattern that is strongly not suggested in k/k. This is reminiscent of #6852. The current approach seems to be to add optional fields that are set only sometimes...

@krzyzacy
Copy link
Member Author

humm? It's not structured data, but only some urls that labels cannot take, which seems annotation would be appropriate?

@BenTheElder
Copy link
Member

Adding structured data into annotations is an anti-pattern that is strongly not suggested in k/k. This is reminiscent of #6852. The current approach seems to be to add optional fields that are set only sometimes...

Er regarding #6852 I don't see how adding another optional field first class would make things less muddy. Annotations are fine for controller managed data? Long also != structured.

The docs for annotations specifically call out use cases like this: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/

Build, release, or image information like timestamps, release IDs, git branch, PR numbers, image hashes, and registry address.

@stevekuznetsov
Copy link
Contributor

The impl here is fine
/lgtm
/hold

Is this data we otherwise hold in labels for GitHub jobs? Can we add this to spec somewhere? Sure, adding new fields is not going to be better, but it's at least structured and can at least be validated, if we wanted to. I was imagining the set of data the gerrit reporter would need (not any specific annotation) would be a structure with more semantic meaning than "all fields are strings and optional"

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Aug 15, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: krzyzacy, stevekuznetsov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

@krzyzacy
Copy link
Member Author

So each gerrit change contains an ID which is basically something like host+repo+SHA, and gerrit host is a url, repo can be /a/n/y/t/h/i/n/g, I have to store the ID in order to use that for reporting later, and that cannot be a label.

@krzyzacy
Copy link
Member Author

We can guard people from using this function to store a blob of json into annotations, if that's the concern. (Currently they can still do it via editing the metadata)

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 15, 2018
@k8s-ci-robot k8s-ci-robot merged commit fdea22f into kubernetes:master Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants