Skip to content

Commit

Permalink
Update service environment to be a ref
Browse files Browse the repository at this point in the history
The service environment is a ref to an environment in the schemas
and it should be a ref, i.e. a combination of id and source because
the id is only unique when combined to the source.

As in other cases, if the source of the environment is the same as
the source of the main subject (the service), it may be omitted.

The spec only includes today the environmentId as string - update
it to be an object (reference to environment).

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
  • Loading branch information
afrittoli committed Oct 19, 2022
1 parent 1640f65 commit 8201649
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions continuous-deployment-pipeline-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A `service` can represent for example a binary that is running, a daemon, an app
|-------|------|-------------|----------|
| id | `String` | Uniquely identifies the subject within the source. | `service/myapp`, `daemonset/myapp` |
| source | `URI-Reference` | [source](../spec.md#source) from the context | `staging/tekton`, `tekton-dev-123`|
| environmentId | `String` | Id of the environment where the service runs | `dev`, `staging`, `production`, `ci-123`|
| environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` |
| artifactId | `Purl` | Identifier of the artifact deployed with this service | `pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c` |

## Events
Expand Down Expand Up @@ -100,7 +100,7 @@ This event represents a new instance of a service that has been deployed
| Field | Type | Description | Examples | Mandatory ✅ \| Optional ⚪ |
|-------|------|-------------|----------|----------------------------|
| id | `String` | Uniquely identifies the subject within the source. | `service/myapp`, `daemonset/myapp` ||
| environmentId | `String` | Id of the environment where the service is deployed| `dev`, `staging`, `production`, `ci-123`||
| environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` ||
| artifactId | `Purl` | Identifier of the artifact deployed with this service | `0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `927aa808433d17e315a258b98e2f1a55f8258e0cb782ccb76280646d0dbe17b5`, `six-1.14.0-py2.py3-none-any.whl` ||

### `service upgraded`
Expand All @@ -114,7 +114,7 @@ This event represents an existing instance of a service that has been upgraded t
| Field | Type | Description | Examples | Mandatory ✅ \| Optional ⚪ |
|-------|------|-------------|----------|----------------------------|
| id | `String` | Uniquely identifies the subject within the source. | `service/myapp`, `daemonset/myapp` ||
| environmentId | `String` | Id of the environment where the service runs | `dev`, `staging`, `production`, `ci-123`||
| environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` ||
| artifactId | `Purl` | Identifier of the artifact deployed with this service |`pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c` ||

### `service rolledback`
Expand All @@ -128,7 +128,7 @@ This event represents an existing instance of a service that has been rolled bac
| Field | Type | Description | Examples | Mandatory ✅ \| Optional ⚪ |
|-------|------|-------------|----------|----------------------------|
| id | `String` | Uniquely identifies the subject within the source. | `service/myapp`, `daemonset/myapp` ||
| environmentId | `String` | Id of the environment where the service runs | `dev`, `staging`, `production`, `ci-123`||
| environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` ||
| artifactId | `Purl` | Identifier of the artifact deployed with this service | `pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427`, `pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c` ||

### `service removed`
Expand All @@ -142,7 +142,7 @@ This event represents the removal of a previously deployed service instance and
| Field | Type | Description | Examples | Mandatory ✅ \| Optional ⚪ |
|-------|------|-------------|----------|----------------------------|
| id | `String` | Uniquely identifies the subject within the source. | `service/myapp`, `daemonset/myapp` ||
| environmentId | `String` | Id of the environment where the service runs | `dev`, `staging`, `production`, `ci-123`||
| environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` ||

### `service published`

Expand All @@ -155,4 +155,4 @@ This event represents an existing instance of a service that has an accessible U
| Field | Type | Description | Examples | Mandatory ✅ \| Optional ⚪ |
|-------|------|-------------|----------|----------------------------|
| id | `String` | Uniquely identifies the subject within the source. | `service/myapp`, `daemonset/myapp` ||
| environmentId | `String` | Id of the environment where the service runs | `dev`, `staging`, `production`, `ci-123`||
| environment | `Object` ([`environment`](#environment)) | Reference for the environment where the service runs | `{"id": "1234"}`, `{"id": "maven123, "source": "tekton-dev-123"}` ||
2 changes: 1 addition & 1 deletion source-code-version-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ A `change` identifies a proposed set of changes to the content of a `repository`
|-------|------|-------------|----------|
| id | `String` | Uniquely identifies the subject within the source. | `1234`, `featureBranch123` |
| source | `URI-Reference` | [source](../spec.md#source) from the context | `my-git.example`|
| repository | `Object` | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` |
| repository | `Object` ([`repository`](#repository)) | A reference to the repository where the change event happened | `{"id": "an-org/a-repo"}` |

## Events

Expand Down

0 comments on commit 8201649

Please sign in to comment.