Skip to content

Commit

Permalink
Add change.created description field (#155)
Browse files Browse the repository at this point in the history
This commit adds a new optional field to the dev.cdevents.change.created
event.  This field, description, should be used to describe the change,
e.g. a GitHub PR.

An example of the description field could be something like

"This PR addresses a new bug that was introduced in some PR"

Signed-off-by: xibz <impactbchang@gmail.com>
Co-authored-by: benjamin-j-powell <benjamin_j_powell@apple.com>
  • Loading branch information
xibz and benjamin-j-powell authored Aug 15, 2023
1 parent c7d7cf8 commit b6df4e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions examples/change_created.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
"version": "0.4.0-draft",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"source": "/event/source/123",
"type": "dev.cdevents.change.created.0.1.2",
"type": "dev.cdevents.change.created.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z"
},
"subject": {
"id": "mySubject123",
"source": "/event/source/123",
"type": "change",
"content": {
"description": "This PR address a bug from a recent PR",
"repository": {
"id": "TestRepo/TestOrg",
"source": "https://example.org"
}
}
}
}
}
10 changes: 7 additions & 3 deletions schemas/changecreated.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"type": {
"type": "string",
"enum": [
"dev.cdevents.change.created.0.1.2"
"dev.cdevents.change.created.0.2.0"
],
"default": "dev.cdevents.change.created.0.1.2"
"default": "dev.cdevents.change.created.0.2.0"
},
"timestamp": {
"type": "string",
Expand Down Expand Up @@ -60,6 +60,10 @@
},
"content": {
"properties": {
"description": {
"type": "string",
"minLength": 1
},
"repository": {
"properties": {
"id": {
Expand Down Expand Up @@ -112,4 +116,4 @@
"context",
"subject"
]
}
}
4 changes: 3 additions & 1 deletion source-code-version-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ A `change` identifies a proposed set of changes to the content of a `repository`
| id | `String` | See [id](spec.md#id-subject)| `1234`, `featureBranch123` |
| source | `URI-Reference` | See [source](spec.md#source-subject) | `my-git.example`|
| type | `String` | See [type](spec.md#type-subject) | `change` |
| description | `String` | Description associated with the change, e.g. A pull request's description | `This PR addresses a fix for some feature`|
| repository | `Object` ([`repository`](#repository)) | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` |

## Events
Expand Down Expand Up @@ -148,7 +149,7 @@ A branch inside the Repository was deleted.

A source code change was created and submitted to a repository specific branch. Examples: PullRequest sent to Github, MergeRequest sent to Gitlab, Change created in Gerrit.

- Event Type: __`dev.cdevents.change.created.0.1.2`__
- Event Type: __`dev.cdevents.change.created.0.2.0`__
- Predicate: created
- Subject: [`change`](#change)

Expand All @@ -157,6 +158,7 @@ A source code change was created and submitted to a repository specific branch.
| id | `String` | See [id](spec.md#id-subject)| `1234`, `featureBranch123` ||
| source | `URI-Reference` | See [source](spec.md#source-subject) | `my-git.example/an-org/a-repo`| |
| type | `String` | See [type](spec.md#type-subject) | `change` | |
| description | `String` | Description associated with the change, e.g. A pull request's description | `This PR addresses a fix for some feature`| |
| repository | `Object` | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` | |

### [`change reviewed`](examples/change_reviewed.json)
Expand Down

0 comments on commit b6df4e2

Please sign in to comment.