Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: "Create release"

on:
workflow_dispatch:
inputs:
branch:
description: "Branch to be tagged"
required: true
default: master
tag:
description: "Tag for new version (v1.23.4)"
required: true
base_tag:
description: "Base tag to generate commit list for release notes"
required: true
skip_sdk_check:
description: "Skip sdk-go compatibility check"
type: boolean

jobs:
prepare-inputs:
name: "Prepare inputs"
runs-on: ubuntu-latest
outputs:
api_commit_sha: ${{ steps.pin_commits.outputs.api_commit_sha }}
api_go_commit_sha: ${{ steps.pin_commits.outputs.api_go_commit_sha }}
steps:
- name: Checkout api
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
fetch-tags: true
path: api

- name: Checkout api-go
uses: actions/checkout@v4
with:
repository: temporalio/api-go
ref: ${{ github.event.inputs.branch }}
submodules: true
path: api-go

- name: Validate inputs
env:
BRANCH: ${{ github.event.inputs.branch }}
TAG: ${{ github.event.inputs.tag }}
BASE_TAG: ${{ github.event.inputs.base_tag }}
working-directory: ./api
run: |
if ! [[ "${TAG}" =~ ^v.* ]]; then
echo "::error::Tag is not prefixed with 'v'"
exit 1
fi

if [[ -n "$(git tag -l "$TAG")" ]]; then
echo "::error::Tag already exists"
exit 1
fi

if [[ -z "$BASE_TAG" || -z "$(git tag -l "$BASE_TAG")" ]]; then
echo "::error::Base tag not specified or does not exist"
exit 1
fi

- name: Pin commits sha
id: pin_commits
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: ${{ github.event.inputs.branch }}
run: |
API_COMMIT_SHA=$(git -C ./api rev-parse HEAD)
API_GO_COMMIT_SHA=$(git -C ./api-go rev-parse HEAD)
API_GO_API_COMMIT_SHA=$(git -C ./api-go rev-parse HEAD:proto/api)
if [[ "${API_GO_API_COMMIT_SHA}" != "${API_COMMIT_SHA}" ]]; then
echo "::error::api-go ref ${API_GO_COMMIT_SHA} does not reference api ref ${API_COMMIT_SHA}, api-go repo might not be up-to-date."
exit 1
fi
echo "api_commit_sha=$API_COMMIT_SHA" >> "$GITHUB_OUTPUT"
echo "api_go_commit_sha=$API_GO_COMMIT_SHA" >> "$GITHUB_OUTPUT"

check-compatibility-sdk-go:
needs: prepare-inputs
if: ${{ github.event.inputs.skip_sdk_check == false || github.event.inputs.skip_sdk_check == 'false' }}
uses: temporalio/api-go/.github/workflows/check-sdk-compat.yml@master
with:
sdk_ref: latest
api_ref: ${{ needs.prepare-inputs.outputs.api_go_commit_sha }}

create-release:
name: "Create release"
needs: [prepare-inputs, check-compatibility-sdk-go]
if: |
!cancelled() &&
needs.prepare-inputs.result == 'success' &&
contains(fromJSON('["success", "skipped"]'), needs.check-compatibility-sdk-go.result)
runs-on: ubuntu-latest

steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.TEMPORAL_CICD_APP_ID }}
private-key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.prepare-inputs.outputs.api_commit_sha }}
token: ${{ steps.generate_token.outputs.token }}

- name: Create release
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
REF: ${{ needs.prepare-inputs.outputs.api_commit_sha }}
TAG: ${{ github.event.inputs.tag }}
BASE_TAG: ${{ github.event.inputs.base_tag }}
run: |
gh repo set-default ${{ github.repository }}
gh release create "$TAG" --target "$REF" --latest --generate-notes --notes-start-tag "$BASE_TAG" --draft

release-api-go:
needs: [prepare-inputs, create-release]
if: |
!cancelled() &&
needs.create-release.result == 'success'
uses: temporalio/api-go/.github/workflows/create-release.yml@master
with:
ref: ${{ needs.prepare-inputs.outputs.api_go_commit_sha }}
tag: ${{ github.event.inputs.tag }}
api_commit_sha: ${{ needs.prepare-inputs.outputs.api_commit_sha }}
base_tag: ${{ github.event.inputs.base_tag }}
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/trigger-api-go-delete-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Trigger api-go delete release"

on:
release:
types: [deleted]

jobs:
trigger-api-go-delete-release:
uses: temporalio/api-go/.github/workflows/delete-release.yml@master
with:
tag: ${{ github.event.release.tag_name }}
api_commit_sha: ${{ github.event.release.target_commitish }}
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/trigger-api-go-publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Trigger api-go publish release"

on:
release:
types: [published]

jobs:
trigger-api-go-publish-release:
uses: temporalio/api-go/.github/workflows/publish-release.yml@master
with:
tag: ${{ github.event.release.tag_name }}
api_commit_sha: ${{ github.event.release.target_commitish }}
secrets: inherit
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SHELL=/bin/bash -o pipefail
SHELL=bash -o pipefail

$(VERBOSE).SILENT:
############################# Main targets #############################
Expand Down
88 changes: 87 additions & 1 deletion openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -6367,6 +6367,10 @@
"versioningOverride": {
"$ref": "#/definitions/v1VersioningOverride",
"description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"title": "Priority metadata"
}
}
},
Expand Down Expand Up @@ -6552,6 +6556,10 @@
"versioningOverride": {
"$ref": "#/definitions/v1VersioningOverride",
"description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"title": "Priority metadata"
}
}
},
Expand Down Expand Up @@ -7179,6 +7187,10 @@
"useWorkflowBuildId": {
"type": "boolean",
"description": "If this is set, the activity would be assigned to the Build ID of the workflow. Otherwise,\nAssignment rules of the activity's Task Queue will be used to determine the Build ID."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"description": "Priority metadata. If this message is not present, or any fields are not\npresent, they inherit the values from the workflow."
}
}
},
Expand Down Expand Up @@ -9729,6 +9741,10 @@
"versioningOverride": {
"$ref": "#/definitions/v1VersioningOverride",
"description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"title": "Priority metadata"
}
},
"description": "NewWorkflowExecutionInfo is a shared message that encapsulates all the\nrequired arguments to starting a workflow in different contexts."
Expand Down Expand Up @@ -10100,6 +10116,10 @@
"lastDeployment": {
"$ref": "#/definitions/v1Deployment",
"description": "The deployment this activity was dispatched to most recently. Present only if the activity\nwas dispatched to a versioned worker."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"title": "Priority metadata"
}
}
},
Expand Down Expand Up @@ -10320,6 +10340,10 @@
"retryPolicy": {
"$ref": "#/definitions/v1RetryPolicy",
"description": "This is the retry policy the service uses which may be different from the one provided\n(or not) during activity scheduling. The service can override the provided one if some\nvalues are not specified or exceed configured system limits."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"title": "Priority metadata"
}
}
},
Expand Down Expand Up @@ -10452,6 +10476,36 @@
}
}
},
"v1Priority": {
"type": "object",
"properties": {
"priorityKey": {
"type": "integer",
"format": "int32",
"description": "Priority key is a positive integer from 1 to n, where smaller integers\ncorrespond to higher priorities (tasks run sooner). In general, tasks in\na queue should be processed in close to priority order, although small\ndeviations are possible.\n\nThe maximum priority value (minimum priority) is determined by server\nconfiguration, and defaults to 5.\n\nIf priority is not present (or zero), then the effective priority will be\nthe default priority, which is is calculated by (min+max)/2. With the\ndefault max of 5, and min of 1, that comes out to 3."
},
"fairnessKey": {
"type": "string",
"description": "Fairness key is a short string that's used as a key for a fairness\nbalancing mechanism. It may correspond to a tenant id, or to a fixed\nstring like \"high\" or \"low\". The default is the empty string.\n\nThe fairness mechanism attempts to dispatch tasks for a given key in\nproportion to its weight. For example, using a thousand distinct tenant\nids, each with a weight of 1.0 (the default) will result in each tenant\ngetting a roughly equal share of task dispatch throughput.\n\n(Note: this does not imply equal share of worker capacity! Fairness\ndecisions are made only at dispatch time based on queue statistics, not\ncurrent worker load.)\n\nAs another example, using keys \"high\" and \"low\" with weight 9.0 and 1.0\nrespectively will prefer dispatching \"high\" tasks over \"low\" tasks at a\n9:1 ratio, while allowing either key to use all worker capacity if the\nother is not present.\n\nAll fairness mechanisms, including rate limits, are best-effort and\nprobabilistic. The results may not match what a \"perfect\" algorithm with\ninfinite resources would produce. The more unique keys are used, the less\naccurate the results will be.\n\nFairness keys are limited to 64 bytes."
},
"fairnessWeight": {
"type": "number",
"format": "float",
"description": "Fairness weight for a task can come from multiple sources for\nflexibility. From highest to lowest precedence:\n1. Weights for a small set of keys can be overridden in task queue\n configuration with an API.\n2. It can be attached to the workflow/activity in this field.\n3. The default weight of 1.0 will be used.\nNote that if the weight for a key is attached in this field, for best\nresults, the same weight should be used for the same key for a reasonable\namount of time (minutes). It may change, but it may take some time for\nthe change to be reflected.\n\nThe recommended range of usable weights is [0.001, 1000]."
},
"fairnessRateLimit": {
"type": "number",
"format": "float",
"description": "The fairness mechanism can also enforce rate limits per fairness key.\nRate limits are specified in tasks dispatched per second.\nAs with weights, rate limits can come from different sources:\n1. Rate limits for a small set of keys can be overridden in task queue\n configuration with an API.\n2. It can be attached to the workflow/activity in this field.\n3. The \"default\" rate limit for keys that are not overridden can be set\n in task queue configuration also.\n4. Otherwise, a very high rate limit will be applied."
},
"orderingKey": {
"type": "string",
"format": "int64",
"description": "Ordering key is a positive integer from 1 to MaxInt64. After priority and\nfairness mechanisms are applied, tasks will be finally ordered by\nordering_key. Note that fine-grained values are allowed here, as opposed\nto priority.\n\nFor example, applications might use the start time of a workflow (in\nseconds since the unix epoch) as ordering key for the workflow and all\nactivities in it. This will have the effect of prioritizing activities of\nworkflows that were started earlier, encouring completing older workflows\nover making progress in newer ones."
}
},
"description": "Priority contains metadata that controls relative ordering of task processing\nwhen tasks are backed up in a queue. Initially, Priority will be used in\nmatching (workflow and activity) task queues. Later it may be used in history\ntask queues and in rate limiting decisions.\n\nPriority is attached to workflows and activities. By default, activities\ninherit Priority from the workflow that created them, but may override fields\nwhen an activity is started or modified.\n\nDespite being named \"Priority\", this message also contains fields that\ncontrol \"fairness\" mechanisms.\n\nFor all fields, the field not present or equal to zero/empty string means to\ninherit the value from the calling workflow, or if there is no calling\nworkflow, then use the default value.\n\nFor all fields other than fairness_key, the zero value isn't meaningful so\nthere's no confusion between inherit/default and a meaningful value. For\nfairness_key, the empty string will be interpreted as \"inherit\". This means\nthat if a workflow has a non-empty fairness key, you can't override the\nfairness key of its activity to the empty string.\n\nThe overall semantics of Priority are:\n1. First, consider \"priority\": higher priority (lower number) goes first.\n2. Next, consider fairness: try to dispatch tasks for different fairness keys\n in proportion to their weight.\n3. Finally, tasks may be ordered by an additional ordering key.\n\nApplications may use any subset of mechanisms that are useful to them and\nleave the other fields to use default values.\n\nNot all queues in the system may support the \"full\" semantics of all priority\nfields. (Currently only support in matching task queues is planned.)"
},
"v1ProtocolMessageCommandAttributes": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -10537,6 +10591,10 @@
"cancelRequested": {
"type": "boolean",
"description": "Will be set to true if the activity has been asked to cancel itself. The SDK should then\nnotify the activity of cancellation if it is still running."
},
"activityPaused": {
"type": "boolean",
"description": "Will be set to true if the activity is paused."
}
}
},
Expand Down Expand Up @@ -11154,6 +11212,10 @@
"useWorkflowBuildId": {
"type": "boolean",
"description": "If this is set, the activity would be assigned to the Build ID of the workflow. Otherwise,\nAssignment rules of the activity's Task Queue will be used to determine the Build ID."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"description": "Priority metadata. If this message is not present, or any fields are not\npresent, they inherit the values from the workflow."
}
}
},
Expand Down Expand Up @@ -11699,6 +11761,10 @@
"inheritBuildId": {
"type": "boolean",
"description": "If this is set, the child workflow inherits the Build ID of the parent. Otherwise, the assignment\nrules of the child's Task Queue will be used to independently assign a Build ID to it."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"description": "Priority metadata. If this message is not present, or any fields are not\npresent, they inherit the values from the workflow."
}
}
},
Expand Down Expand Up @@ -11816,6 +11882,10 @@
"inheritBuildId": {
"type": "boolean",
"description": "If this is set, the child workflow inherits the Build ID of the parent. Otherwise, the assignment\nrules of the child's Task Queue will be used to independently assign a Build ID to it."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"title": "Priority metadata"
}
}
},
Expand Down Expand Up @@ -12004,6 +12074,10 @@
"versioningOverride": {
"$ref": "#/definitions/v1VersioningOverride",
"description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"title": "Priority metadata"
}
}
},
Expand Down Expand Up @@ -13055,6 +13129,10 @@
"versioningInfo": {
"$ref": "#/definitions/v1WorkflowExecutionVersioningInfo",
"description": "Absent value means the workflow execution is not versioned. When present, the execution might\nbe versioned or unversioned, depending on `versioning_info.behavior` and `versioning_info.versioning_override`.\nExperimental. Versioning info is experimental and might change in the future."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"title": "Priority metadata"
}
},
"description": "Hold basic information about a workflow execution.\nThis structure is a part of visibility, and thus contain a limited subset of information."
Expand All @@ -13073,7 +13151,11 @@
"properties": {
"versioningOverride": {
"$ref": "#/definitions/v1VersioningOverride",
"description": "Versioning override in the mutable state after event has been applied."
"description": "Versioning override upserted in this event.\nIgnored if nil or if unset_versioning_override is true."
},
"unsetVersioningOverride": {
"type": "boolean",
"description": "Versioning override removed in this event."
}
}
},
Expand Down Expand Up @@ -13237,6 +13319,10 @@
"versioningOverride": {
"$ref": "#/definitions/v1VersioningOverride",
"description": "Versioning override applied to this workflow when it was started."
},
"priority": {
"$ref": "#/definitions/v1Priority",
"title": "Priority metadata"
}
},
"title": "Always the first event in workflow history"
Expand Down
Loading
Loading