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

Add outcome to buildfinished event #179

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

xibz
Copy link
Contributor

@xibz xibz commented Jan 8, 2024

Changes

This PR addresses a missing field of, outcome, that should exist in the build.finished event.

This follows the outcome of taskRun.finished, except that it utilizes an enum value instead. Users should be able to pass any string they want to, but we should also have some sane enums so consumers and producers do not have several ways of representing the same thing.

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

@xibz xibz requested a review from a team as a code owner January 8, 2024 19:14
This commit adds the outcome enum to the buildfinished event

Signed-off-by: benjamin-j-powell <[email protected]>
"outcome": {
"type": "string",
"minLength": 1,
"enum": [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The biggest difference here between outcome in taskRun.finished is this. I really think we should be utilizing enums to provide at least some consistent defaults for users.

Copy link
Contributor

Choose a reason for hiding this comment

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

Absolutely! And that is also stated for the taskRun.finished and pipelineRun.finished in their md doc (core.md). The json schemas for those events lack those enum definitions, and there is an issue to fix that - #159 . I believe the outcome enums for the build.finished event should have similar values as the enum for the outcomes of taskRun.finished and pipelineRun.finished.

}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unsure why we want this non-newline for files? Newlines at the ending character is pretty standard, e.g. vim, emacs, all defaults to this (and IDEs). So this may have been due to this being code generated and forgetting the newline? Im unsure.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, all files should end with an empty line I believe

@@ -20,9 +20,9 @@
"type": {
"type": "string",
"enum": [
"dev.cdevents.build.finished.0.1.1"
"dev.cdevents.build.finished.0.1.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be -draft

@xibz xibz marked this pull request as draft January 29, 2024 04:14
@@ -3,15 +3,16 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.build.finished.0.1.1",
"type": "dev.cdevents.build.finished.0.1.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

-draft is needed here too

"enum": [
"passed",
"failed",
"cancelled"
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to describe the meaning of values in the enum, to help consistency in adoption.
Does cancelled refer to use cancelled or system cancelled or both? Would a "timed-out" build count as cancelled (as in cancelled by the system because of taking too long?).

@afrittoli
Copy link
Contributor

@xibz - main is now open for v0.5 development - could you rebase this PR?

"type": "string",
"minLength": 1,
"enum": [
"passed",
Copy link
Contributor

Choose a reason for hiding this comment

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

These enums don't match the core.md doc on pipelineRun.finished. Same for taskRun.finished.

@e-backmark-ericsson
Copy link
Contributor

This PR overlaps somewhat with #238 . Should they be combined?

@e-backmark-ericsson
Copy link
Contributor

See also #215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants