diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..bf78fe7 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,4 @@ +## Checklist +- [ ] I have read the [CONTRIBUTING.md]() +- [ ] I certify that my `preview` and `released` lists for Events/Metrics/Alerts are correct +- [ ] I certify that all Events/Metrics/Alerts in `released` are properly tested and ready for production \ No newline at end of file diff --git a/.github/workflows/create_tag_on_main_merge.yaml b/.github/workflows/create_tag_on_main_merge.yaml index 496e0d8..192eec8 100644 --- a/.github/workflows/create_tag_on_main_merge.yaml +++ b/.github/workflows/create_tag_on_main_merge.yaml @@ -2,13 +2,14 @@ name: Bump version on: push: branches: - - master + - main + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 with: # Fetches entire history, so we can analyze commits since last tag fetch-depth: 0 diff --git a/.github/workflows/pr_checklist_completion.yaml b/.github/workflows/pr_checklist_completion.yaml new file mode 100644 index 0000000..b7740fb --- /dev/null +++ b/.github/workflows/pr_checklist_completion.yaml @@ -0,0 +1,12 @@ +name: 'PR Tasks Completed Check' +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + task-check: + runs-on: ubuntu-latest + steps: + - uses: kentaro-m/task-completed-checker-action@v0.1.2 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..03da035 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,8 @@ +# See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file +# + +* @equinix/governor-digin-observability-architects +fabric* @equinix/governor-digin-fabric +resource_manager* @equinix/governor-qore-crh +access_manager* @equinix/governor-qore-crh +network_edge* @equinix/governor-ne-network-edge-engineering diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 91ec76a..f7ed232 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,6 +76,34 @@ Each contributed data schema requires the following attributes: * "metricNames" - - Object with list attributes `released` and `preview` that mark which environment the data schema is ready to suppport the given metric in. Only place types in the `released` list if it is fully tested and ready for production. Place it into the `preview` list if it is under development and should only be available in UAT. * "alertNames" - Object with list attributes `released` and `preview` that mark which environment the data schema is ready to suppport the given event type in. Only place types in the `released` list if it is fully tested and ready for production. Place it into the `preview` list if it is under development and should only be available in UAT. +## Process for Upgrading Event/Metric/Alert from Development to Production + +When adding a new event/metric/alert to a data schema always start by +entering it into the `preview` list. This list identifies *in development* +items and is the starting point for new events/metrics/alerts being added +into the repo. + +Once an event/metric/alert has been thoroughly tested in lower environments +you will remove that item from the `preview` list and move it to the +`released` list. This indicates that your item is not ready to be consumed +in production and the production Equinix Event Manager will pass these items +through to the consumers. + +It is imperative that you understand the responsibility involved for managing +your team's domain with regards to the `preview` and `released` lists in your +data schema files. The [CODEOWNERS](#codeowners) section describes how +responsibility is managed within the repo. Please review it thoroughly. + +## CODEOWNERS + +CODEOWNERS file will be in place to establish a Github team (Synced with Equinix IAM) responsible for the files along the domain path they are contributing to. This ensures that 1 member from each domain team and 1 architect will always be necessary to approve a Pull Request before it can be merged. + +This is critical because the responsibility of maintaining the `released` and `preview` lists outlined in the [Gating](#data-schema-gating-through-equinix-event-manager) section lies with the Domain owners and not the architects. Should any production defect be found the Domain owner is responsible for resolution + +When adding a new domain to the `jsonschema/equinix` directory, add an entry +to the CODEOWNERS file signifying which Github Team is responsible for +reviewing/approving PRs that modify the domain directory being added + ## Data Schema Versioning Versioning for data schemas is only based on major versions; there are no minor or patch versions. The major versions @@ -91,9 +119,3 @@ Not all data_schemas need to be moved to v2. Just the ones that have breaking ch The self service contribution model is setup to ensure the repo is always in a stable state that can be released to either UAT or production. Each time a Pull Request is merged into main a new version tag will be created based on SemVar for the commit names present in the change. This tag will always be available to the Equinix Event Manager for releases. This setup is possible because of our CODEOWNERSHIP model. - -## CODEOWNERS - -CODEOWNERS file will be in place to establish a Github team (Synced with Equinix IAM) responsible for the files along the domain path they are contributing to. This ensures that 1 member from each domain team and 1 architect will always be necessary to approve a Pull Request before it can be merged. - -This is critical because the responsibility of maintaining the `released` and `preview` lists outlined in the [Gating](#data-schema-gating-through-equinix-event-manager) section lies with the Domain owners and not the architects. Should any production defect be found the Domain owner is responsible for resolution \ No newline at end of file diff --git a/scripts/generate_json_catalog.py b/scripts/generate_json_catalog.py index c42c5bd..4f0f39f 100644 --- a/scripts/generate_json_catalog.py +++ b/scripts/generate_json_catalog.py @@ -11,16 +11,16 @@ def retrieve_json_schemas(): with open(root + "/" + file, "r") as eventFile: data = json.load(eventFile) events = { - sc.RELEASED: sorted(data[sc.EVENTS][sc.RELEASED]), - sc.PREVIEW: sorted(data[sc.EVENTS][sc.PREVIEW]) + sc.RELEASED: sorted(set(data[sc.EVENTS][sc.RELEASED])), + sc.PREVIEW: sorted(set(data[sc.EVENTS][sc.PREVIEW])) } metrics = { - sc.RELEASED: sorted(data[sc.METRICS][sc.RELEASED]), - sc.PREVIEW: sorted(data[sc.METRICS][sc.PREVIEW]) + sc.RELEASED: sorted(set(data[sc.METRICS][sc.RELEASED])), + sc.PREVIEW: sorted(set(data[sc.METRICS][sc.PREVIEW])) } alerts = { - sc.RELEASED: sorted(data[sc.ALERTS][sc.RELEASED]), - sc.PREVIEW: sorted(data[sc.ALERTS][sc.PREVIEW]) + sc.RELEASED: sorted(set(data[sc.ALERTS][sc.RELEASED])), + sc.PREVIEW: sorted(set(data[sc.ALERTS][sc.PREVIEW])) } newItem = { "url": data["$id"], diff --git a/scripts/generate_readme_event_catalog.py b/scripts/generate_readme_event_catalog.py index 4ff4774..b9b2780 100644 --- a/scripts/generate_readme_event_catalog.py +++ b/scripts/generate_readme_event_catalog.py @@ -10,7 +10,7 @@ def dropdowns(type, supported): dropdowns += "\n\n\n\n" if len(supported[sc.RELEASED]) > 0: dropdowns += "\n\n
\nReleased\n\n" - dropdowns += "
\n".join(map(lambda x: f"`{x}`", supported[sc.RELEASED])) + dropdowns += "
\n\n".join(map(lambda x: f"`{x}`", supported[sc.RELEASED])) dropdowns += "\n\n
\n""" return dropdowns if len(dropdowns) > 20 else ""