Skip to content

Commit

Permalink
Merge branch 'main' into add-spring-support-policy
Browse files Browse the repository at this point in the history
  • Loading branch information
christinaausley authored Jul 31, 2024
2 parents d620a68 + d89eb6f commit 39ec838
Show file tree
Hide file tree
Showing 92 changed files with 1,779 additions and 259 deletions.
44 changes: 12 additions & 32 deletions .github/workflows/preview-env-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,12 @@ jobs:
secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_BUCKET_NAME;
secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_GCLOUD_SA_KEY;
- name: Find previous deployment or tear-down comment
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.number }}
body-includes: <!-- preview-env -->

- name: Upsert comment with build status
uses: peter-evans/create-or-update-comment@v4
uses: mshick/add-pr-comment@v2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body: |
:construction: The preview environment for the commit ${{ github.sha }} is being built. This usually takes 15-20 minutes. <!-- preview-env -->
edit-mode: replace
refresh-message-position: true
message: |
:construction: The preview environment for the commit ${{ github.sha }} is being built. This usually takes 15-20 minutes.
- name: Install Dependencies
run: npm ci
Expand Down Expand Up @@ -73,21 +64,12 @@ jobs:
env: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Find build status comment
uses: peter-evans/find-comment@v3
id: find-build-comment
with:
issue-number: ${{ github.event.number }}
body-includes: <!-- preview-env -->

- name: Update comment with upload status
uses: peter-evans/create-or-update-comment@v4
uses: mshick/add-pr-comment@v2
with:
comment-id: ${{ steps.find-build-comment.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body: |
:arrow_up: The preview environment build results for commit ${{ github.sha }} is being uploaded. This usually takes 3-4 minutes. <!-- preview-env -->
edit-mode: replace
refresh-message-position: true
message: |
:arrow_up: The preview environment build results for commit ${{ github.sha }} are being uploaded. This usually takes 3-4 minutes.
- name: Upload files to Google bucket
env:
Expand All @@ -105,12 +87,10 @@ jobs:
env_url: https://${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}/pr-${{ github.event.number }}/index.html

- name: Update comment with deployment status
uses: peter-evans/create-or-update-comment@v4
uses: mshick/add-pr-comment@v2
env:
BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}
with:
comment-id: ${{ steps.find-build-comment.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body: |
The preview environment relating to the commit ${{ github.sha }} has successfully been deployed. You can access it at [https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html](https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html) <!-- preview-env -->
edit-mode: replace
refresh-message-position: true
message: |
The preview environment relating to the commit ${{ github.sha }} has successfully been deployed. You can access it at [https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html](https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html)
27 changes: 8 additions & 19 deletions .github/workflows/preview-env-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,12 @@ jobs:
with:
credentials_json: ${{ steps.secrets.outputs.PREVIEW_ENV_GCLOUD_SA_KEY }}

- name: Find deployment status comment
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.number }}
body-includes: <!-- preview-env -->

- name: Update comment with tear-down warning
if: steps.find-comment.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
uses: mshick/add-pr-comment@v2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
body: |
:warning: Preview environment for commit ${{ github.sha }} is being deleted. This usually takes 2-3 minutes. <!-- preview-env -->
edit-mode: replace
refresh-message-position: true
message: |
:warning: Preview environment for commit ${{ github.sha }} is being deleted. This usually takes 2-3 minutes.
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
Expand All @@ -64,10 +55,8 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Update comment with tear-down status
if: steps.find-comment.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
uses: mshick/add-pr-comment@v2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
body: |
:broom: Preview environment for this PR has been torn down. <!-- preview-env -->
edit-mode: replace
refresh-message-position: true
message: |
:broom: Preview environment for this PR has been torn down.
249 changes: 249 additions & 0 deletions api/console-sm/console-sm-openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
openapi: 3.0.0
components:
examples: {}
headers: {}
parameters: {}
requestBodies: {}
responses: {}
schemas:
ConsoleSMAdminApi.UsageMetricsInstances:
properties:
total:
type: number
format: double
description: The number of usage metrics for a specific type.
required:
- total
type: object
additionalProperties: false
ConsoleSMAdminApi.UsageMetricsTaskUsers:
properties:
total:
type: number
format: double
description: The number of usage metrics for a specific type.
assignees:
items:
type: string
type: array
description: The users that tasks have been assigned to.
required:
- total
- assignees
type: object
additionalProperties: false
ConsoleSMAdminApi.UsageMetricsForCluster:
properties:
id:
type: string
description: The identifier of the cluster.
processInstances:
$ref: "#/components/schemas/ConsoleSMAdminApi.UsageMetricsInstances"
description: The usage metrics for started process instances.
decisionInstances:
$ref: "#/components/schemas/ConsoleSMAdminApi.UsageMetricsInstances"
description: The usage metrics for executed decision instances.
taskUsers:
$ref: "#/components/schemas/ConsoleSMAdminApi.UsageMetricsTaskUsers"
description: The usage metrics for assigned task users.
required:
- id
- processInstances
- decisionInstances
- taskUsers
type: object
additionalProperties: false
ConsoleSMAdminApi.Status:
type: string
enum:
- healthy
- unhealthy
- unknown
ConsoleSMAdminApi.ClusterType:
type: string
enum:
- automation
- management
ConsoleSMAdminApi.AppType:
type: string
enum:
- zeebe-broker
- zeebe-gateway
- operate
- tasklist
- optimize
- modeler
- console
- identity
- unknown
ConsoleSMAdminApi.App:
properties:
type:
$ref: "#/components/schemas/ConsoleSMAdminApi.AppType"
description:
What application is running in the cluster, like Zeebe, Operate,
Tasklist, ...
id:
type: string
description: Unique identifier of the application
status:
$ref: "#/components/schemas/ConsoleSMAdminApi.Status"
description: Indicates if an application is healthy or not
url:
type: string
description: The public URL of the application
generation:
type: string
description: This is the current version of the running application
readiness:
type: string
description: The readiness URL of the application
metrics:
type: string
description: The metrics URL of the application
required:
- type
- id
- status
- url
- generation
type: object
additionalProperties: false
ConsoleSMAdminApi.Cluster:
properties:
uuid:
type: string
description: Unique identifier of the cluster
name:
type: string
description: Name of the cluster
namespace:
type: string
description: Namespace the cluster is running in.
status:
$ref: "#/components/schemas/ConsoleSMAdminApi.Status"
description: Indicates if a cluster is healthy or not
generation:
type: string
description: This is the current version of the running cluster
type:
$ref: "#/components/schemas/ConsoleSMAdminApi.ClusterType"
description:
We're distinguishing between automation and management clusters.
Management clusters include applications that act globally in an
installed context, like Console or Modeler. Automation clusters are
the Zeebe clusters including applications like Operate, Tasklist and
Optimize.
apps:
items:
$ref: "#/components/schemas/ConsoleSMAdminApi.App"
type: array
description: The list of applications running in the cluster
required:
- uuid
- name
- namespace
- status
- generation
- type
- apps
type: object
additionalProperties: false
securitySchemes:
bearer:
type: http
scheme: bearer
bearerFormat: JWT
info:
title: Console SM Admin API
description: Access the administration API of Console SM.
version: 1.0.0
contact:
url: https://www.camunda.com
license:
name: License
url: https://docs.camunda.io/docs/reference/licenses/
paths:
/admin-api/usage-metrics:
get:
operationId: getUsageMetrics
responses:
"200":
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/ConsoleSMAdminApi.UsageMetricsForCluster"
"403":
description: Forbidden
"500":
description: Server-side error
description: Returns usage metrics for a specific cluster for a given time
range. The usage metrics are aggregated over the time range and include
number of started process instances, executed decision instances, and
assigned task users.
summary: Get usage metrics for clusters
tags:
- Usage Metrics
security:
- bearer: []
parameters:
- description: The unique identifier of the cluster
in: query
name: id
required: true
schema:
type: string
- description:
The start timestamp of the time range as UNIX timestamp in
milliseconds
in: query
name: start
required: true
schema:
format: double
type: number
- description: The end timestamp of the time range as UNIX timestamp in milliseconds
in: query
name: end
required: true
schema:
format: double
type: number
/admin-api/clusters:
get:
operationId: getClusters
responses:
"200":
description: Ok
content:
application/json:
schema:
items:
$ref: "#/components/schemas/ConsoleSMAdminApi.Cluster"
type: array
"403":
description: Forbidden
"500":
description: Server-side error
description:
Returns a list of all automation and management clusters. Each
cluster entry contains the running apps and their status.
summary: Get current clusters
tags:
- Clusters
security:
- bearer: []
parameters: []
servers:
- url: "{schema}://{host}:{port}"
variables:
host:
default: localhost
description: The hostname of the API server.
port:
default: "8080"
description: The port of the API server.
schema:
default: http
description: The schema of the API server.
19 changes: 19 additions & 0 deletions api/console-sm/generation-strategy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { makeServerDynamic } = require("../make-server-dynamic");
const removeDuplicateVersionBadge = require("../remove-duplicate-version-badge");

const outputDir = "docs/apis-tools/console-sm-api/specifications";
const specFile = "api/console-sm/console-sm-openapi.yaml";

function preGenerateDocs() {
makeServerDynamic(specFile);
}

function postGenerateDocs() {
removeDuplicateVersionBadge(`${outputDir}/console-sm-admin-api.info.mdx`);
}

module.exports = {
outputDir,
preGenerateDocs,
postGenerateDocs,
};
2 changes: 2 additions & 0 deletions api/generate-api-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ const { execSync } = require("child_process");
const operate = require("./operate/generation-strategy");
const zeebe = require("./zeebe/generation-strategy");
const tasklist = require("./tasklist/generation-strategy");
const consolesm = require("./console-sm/generation-strategy");
const camunda = require("./camunda/generation-strategy");
const apiStrategies = {
operate,
zeebe,
tasklist,
consolesm,
camunda,
};

Expand Down
Loading

0 comments on commit 39ec838

Please sign in to comment.