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

Reformat the spec root page, add subjects and actions #26

Merged
merged 1 commit into from
Feb 16, 2022

Conversation

afrittoli
Copy link
Contributor

Restructure a the spec root page, add more sections and introduce
the initial terminology, including subjects and actions.

This provides the basis for restructuring the vocabulary and
defining the schemas that will be used to build the SDKs.

Partially addresses: #12
Related to: #11

Signed-off-by: Andrea Frittoli andrea.frittoli@gmail.com

@afrittoli afrittoli added the spec Specification - Core CDEvents label Feb 11, 2022
spec.md Outdated
Comment on lines 100 to 79
- long running, which stay in a running state until they're purposely stopped or
encounter a failure or a condition that prevents them from running - for
example a service or an environment
- run to completion, which independently stop after they accomplished (or
failed to) a specific task, or encounter a failure or a condition that
prevents them from continuing - for example a task run, a build or a test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternative names could be services vs jobs (or batches) - other idea? Does this distinction make sense?
I introduced these two groups as I think they have similar properties in terms of actions that are associated to them.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we are talking about long running jobs we probably need to explain why we recommend the user to use our events instead of using eg. Open Telemetry to monitor the application. Should this be then part of Continuous Operations bucket or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point, but not necessarily continuous operations - there are examples in the existing events - specifically environments and services.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we could have other subjects as artifact, branch, repository and change. Where would those fall?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would say those would all be long running

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry but you lost me. How can an artifact be long running? An artifact could be documentation, that is not something that will be run. It could of course be deployed but I wouldn't define it as long running.

Should we instead talk about "permanent subject" and "temporary subject"?

  • "Permanent subjects" would have a long lifespan and nothing will wait for it because it will not complete.
  • "Temporary subjects" would have a short lifespan that can have things waiting for it as it will complete.

Not sure about "permanent" and "temporary" but I hope you get the idea what I am out after.

If you think it will drag out this PR. Let us take it in another one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's the issue with the term "long running" - an artefact is not "running", but it continue to exists unless someone takes an explicit action to remove it.

The key differentiator between the two categories is that subjects in the first one naturally runs to completion after performing a job of some kind (taskrun, pipelinerun, build, test), while subjects in the second one will continue to exists unless someone of something takes an action to terminate them (service, environment, artifact).

I'm not quite sure what a good terminology could be for this.

There a couple of reasons for introducing the two categories:

  • events in each category are likely to share predicates
  • producers and consumers may expect different set of predicates
  • from a producer point of view, subject that run to completion won't have an explicit trigger when they complete, so setting up links might be challenging in the completion event

Defining the two groups and giving them a name may help reason about their predicates in general.
I created #27 to track this discussion

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, lets track it there

occurrence, or in case of a service, deployed in a valid action. Valid actions
are defined in the [vocabulary](#vocabulary).

## Context
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have not added anything to the common context for now. If we agree on the subject name, I will add a "subject id" as part of the optional context.
The context will also be expanded with links based on #10 and as discussed in the WG, but I will setup a dedicated PR for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add the subject in a follow-up PR

spec.md Outdated
__Note__: CDEvents adopts, wherever applicable, the terminology used by
[CloudEvents](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#notational-conventions).

This specification defines the following terms:
Copy link

Choose a reason for hiding this comment

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

The below is, I think, a verbatim (or close to verbatim) copy of the linked CloudEvents spec, so it might be nice to make this more clear.

Maybe "This specification borrows the following terms from the CloudEvents specification:"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uhm, that's what I was trying to express in L47 :)
I was debating about only including deltas from the CloudEvents spec, but I though I didn't want to create that kind of dependency, so attribution would be enough. I can make more clear in L50.

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 list below is not meant to be only a list of borrowed terms - subject and action for instance are not defined in CloudEvents, and some of the terms have been adapted to CDEvents.
What I could do is, for the terms that are identical, link the original definition on CloudEvents side.
I didn't go down that route though because we might want to change definitions over time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this sound better?

Note: CDEvents adopts, wherever applicable, the terminology used by
CloudEvents. Some of the definitions below are borrowed
from that specification.

Copy link
Contributor

Choose a reason for hiding this comment

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

As I noted in my comments I was a bit confused on where the terms ended. Could we just link to the terminology for CloudEvents or does it help the reader keeping it on this page? What would happen if CloudEvents changes it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heh, nice catch, the title level on "subject" or "action" is one too much :) I will fix that.

We could not just link to the terminology for CloudEvents because it's not an 100% match - CloudEvents terms are more focused on routing, while CDEvents are more focused on the data part and its semantics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, finally I included links to terms which are borrowed from CloudEvents, I hope that make things clearer :)
Thanks for the feedback on this

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, just one question. Why not keep this part of the event definition? I think it adds value but there might be something I am missing.

Events will contain two types of information: the Event Data representing the Occurrence and Context metadata providing contextual information about the Occurrence. A single occurrence MAY result in more than one event.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that part may not be fitting for CDEvents - we haven't fully designed it yet, so I didn't want to include it until I was sure how it was going to be.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
Copy link
Contributor

@m-linner-ericsson m-linner-ericsson left a comment

Choose a reason for hiding this comment

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

Thanks for starting this! Had a couple of concerns.

spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated
Comment on lines 100 to 79
- long running, which stay in a running state until they're purposely stopped or
encounter a failure or a condition that prevents them from running - for
example a service or an environment
- run to completion, which independently stop after they accomplished (or
failed to) a specific task, or encounter a failure or a condition that
prevents them from continuing - for example a task run, a build or a test
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are talking about long running jobs we probably need to explain why we recommend the user to use our events instead of using eg. Open Telemetry to monitor the application. Should this be then part of Continuous Operations bucket or something?

spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
@afrittoli afrittoli force-pushed the root_spec branch 4 times, most recently from bd39761 to f38a7c8 Compare February 16, 2022 08:09
@afrittoli afrittoli added this to the v0.1 milestone Feb 16, 2022
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
@erkist
Copy link

erkist commented Feb 16, 2022

Once Emil's changes are considered, you can assume approval from me.

Restructure a the spec root page, add more sections and introduce
the initial terminology, including subjects and predicates.

This provides the basis for restructuring the vocabulary and
defining the schemas that will be used to build the SDKs.

Partially addresses: cdevents#12
Related to: cdevents#11

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
@m-linner-ericsson
Copy link
Contributor

@afrittoli To enable other people outside our group to understand this I think we need full examples of a couple of scenarios. These examples could be based on cloud event bindings.

@afrittoli
Copy link
Contributor Author

@afrittoli To enable other people outside our group to understand this I think we need full examples of a couple of scenarios. These examples could be based on cloud event bindings.

I totally agree - this PR is not meant to be comprehensive - I'm trying to set here the base terminology so that we can update the rest, define examples etc

@afrittoli
Copy link
Contributor Author

Thanks everyone for the great input on this. I'll go ahead and merge, and start working on the next parts.

@afrittoli afrittoli merged commit a9a6c17 into cdevents:main Feb 16, 2022
afrittoli added a commit to cdevents/cdevents.dev that referenced this pull request Feb 16, 2022
Sync the changes in cdevents/spec#26

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Specification - Core CDEvents
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants