From e19a1a4820467c3638f68513ac1ce2dc1c62843b Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:15:26 +0100 Subject: [PATCH 1/2] Move deployment attributes to the registry --- .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + .github/ISSUE_TEMPLATE/change_proposal.yaml | 1 + .github/ISSUE_TEMPLATE/new-conventions.yaml | 1 + docs/attributes-registry/README.md | 1 + docs/attributes-registry/deployment.md | 16 +++++++++++++++ docs/resource/deployment-environment.md | 2 +- model/registry/deployment.yaml | 22 +++++++++++++++++++++ model/resource/deployment_environment.yaml | 17 ++-------------- 8 files changed, 45 insertions(+), 16 deletions(-) create mode 100644 docs/attributes-registry/deployment.md create mode 100644 model/registry/deployment.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 08dca47531..af114720bf 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -26,6 +26,7 @@ body: - area:code - area:container - area:db + - area:deployment - area:destination - area:device - area:disk diff --git a/.github/ISSUE_TEMPLATE/change_proposal.yaml b/.github/ISSUE_TEMPLATE/change_proposal.yaml index edaa3a4a75..b7cf3bbd8f 100644 --- a/.github/ISSUE_TEMPLATE/change_proposal.yaml +++ b/.github/ISSUE_TEMPLATE/change_proposal.yaml @@ -19,6 +19,7 @@ body: - area:code - area:container - area:db + - area:deployment - area:destination - area:device - area:disk diff --git a/.github/ISSUE_TEMPLATE/new-conventions.yaml b/.github/ISSUE_TEMPLATE/new-conventions.yaml index 8a72b6bff2..687664f8e4 100644 --- a/.github/ISSUE_TEMPLATE/new-conventions.yaml +++ b/.github/ISSUE_TEMPLATE/new-conventions.yaml @@ -28,6 +28,7 @@ body: - area:code - area:container - area:db + - area:deployment - area:destination - area:device - area:disk diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index 00ff6ad8e6..76d9ce6c4d 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -34,6 +34,7 @@ Currently, the following namespaces exist: * [Code](code.md) * [Container](container.md) * [DB](db.md) (database) +* [Deployment](deployment.md) * [Destination](destination.md) * [Device](device.md) * [Disk](disk.md) diff --git a/docs/attributes-registry/deployment.md b/docs/attributes-registry/deployment.md new file mode 100644 index 0000000000..7e4ad484ed --- /dev/null +++ b/docs/attributes-registry/deployment.md @@ -0,0 +1,16 @@ +# Deployment + +## Deployment Attributes + +| Attribute | Type | Description | Examples | +|---|---|---|---| +| `deployment.environment` | string | Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). [1] | `staging`; `production` | + +**[1]:** `deployment.environment` does not affect the uniqueness constraints defined through +the `service.namespace`, `service.name` and `service.instance.id` resource attributes. +This implies that resources carrying the following attribute combinations MUST be +considered to be identifying the same service: + +* `service.name=frontend`, `deployment.environment=production` +* `service.name=frontend`, `deployment.environment=staging`. + diff --git a/docs/resource/deployment-environment.md b/docs/resource/deployment-environment.md index faba4a47d9..12301f3ae5 100644 --- a/docs/resource/deployment-environment.md +++ b/docs/resource/deployment-environment.md @@ -9,7 +9,7 @@ | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `deployment.environment` | string | Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). [1] | `staging`; `production` | Recommended | +| [`deployment.environment`](../attributes-registry/deployment.md) | string | Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). [1] | `staging`; `production` | Recommended | **[1]:** `deployment.environment` does not affect the uniqueness constraints defined through the `service.namespace`, `service.name` and `service.instance.id` resource attributes. diff --git a/model/registry/deployment.yaml b/model/registry/deployment.yaml new file mode 100644 index 0000000000..ffc0050eab --- /dev/null +++ b/model/registry/deployment.yaml @@ -0,0 +1,22 @@ +groups: + - id: registry.deployment + prefix: deployment + type: attribute_group + brief: > + This document defines attributes for software deployments. + attributes: + - id: environment + type: string + stability: experimental + brief: > + Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) + (aka deployment tier). + note: | + `deployment.environment` does not affect the uniqueness constraints defined through + the `service.namespace`, `service.name` and `service.instance.id` resource attributes. + This implies that resources carrying the following attribute combinations MUST be + considered to be identifying the same service: + + * `service.name=frontend`, `deployment.environment=production` + * `service.name=frontend`, `deployment.environment=staging`. + examples: ['staging', 'production'] diff --git a/model/resource/deployment_environment.yaml b/model/resource/deployment_environment.yaml index bc2574386a..c45aec499e 100644 --- a/model/resource/deployment_environment.yaml +++ b/model/resource/deployment_environment.yaml @@ -1,22 +1,9 @@ groups: - id: deployment - prefix: deployment type: resource brief: > The software deployment. attributes: - - id: environment - type: string - stability: experimental - brief: > - Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) - (aka deployment tier). - note: | - `deployment.environment` does not affect the uniqueness constraints defined through - the `service.namespace`, `service.name` and `service.instance.id` resource attributes. - This implies that resources carrying the following attribute combinations MUST be - considered to be identifying the same service: + - ref: deployment.environment + requirement_level: recommended - * `service.name=frontend`, `deployment.environment=production` - * `service.name=frontend`, `deployment.environment=staging`. - examples: ['staging', 'production'] From 0885e33fbf8d5c2fafabcb575cac21767e46ca18 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:14:43 +0100 Subject: [PATCH 2/2] Fix lint --- model/resource/deployment_environment.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/model/resource/deployment_environment.yaml b/model/resource/deployment_environment.yaml index c45aec499e..c9a54bc7fa 100644 --- a/model/resource/deployment_environment.yaml +++ b/model/resource/deployment_environment.yaml @@ -6,4 +6,3 @@ groups: attributes: - ref: deployment.environment requirement_level: recommended -