-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Expand file tree
/
Copy pathgenerate-connector-registries.yml
More file actions
127 lines (113 loc) · 5.06 KB
/
generate-connector-registries.yml
File metadata and controls
127 lines (113 loc) · 5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Generate Connector Registries
on:
workflow_dispatch:
inputs:
gitref:
description: "The git ref to check out from the repository"
required: false
type: string
force:
description: "Force resync of all latest/ directories even if version markers are current. Useful when metadata changes without a version bump."
required: false
type: boolean
default: false
connector-name:
description: "A connector name to limit the latest/ resync scope (e.g. 'source-faker'). Leave empty to compile all connectors."
required: false
type: string
pr:
description: "Associated pull request number, for linking in notifications."
required: false
type: string
workflow_call:
inputs:
pr:
description: "Associated pull request number, for linking in notifications."
required: false
type: string
permissions:
contents: read
concurrency:
# Only allow one active run, and one pending run.
# This prevents race conditions between multiple runs of this workflow.
group: generate-connector-registry
# If a new run is triggered while there's already one in-progress,
# allow the in-progress run to finish.
cancel-in-progress: false
jobs:
compile-registries:
name: Compile Registries (ops CLI)
runs-on: ubuntu-24.04
env:
REGISTRY_STORE: "coral:prod"
steps:
- name: Checkout Airbyte
uses: actions/checkout@8edcb1bdb4e267140fa742c62e395cd74f332709 # v4.2.2
with:
ref: ${{ github.event.inputs.gitref || github.ref }}
submodules: true
- name: Install uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
- name: Install Ops CLI
run: uv tool install airbyte-internal-ops
- name: Compile Registries
id: compile-registries
env:
GCS_CREDENTIALS: ${{ secrets.METADATA_SERVICE_PROD_GCS_CREDENTIALS }}
FORCE_FLAG: ${{ inputs.force == true && '--force' || '' }}
CONNECTOR_NAME_FLAG: ${{ inputs.connector-name && format('--connector-name {0}', inputs.connector-name) || '' }}
shell: bash
run: >
airbyte-ops registry store compile
--store "${REGISTRY_STORE}"
--with-secrets-mask
--with-legacy-migration v1
${FORCE_FLAG}
${CONNECTOR_NAME_FLAG}
- name: Build notification context
id: notification-context
if: always()
run: |
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
PR_NUMBER="${{ inputs.pr }}"
CONNECTOR_NAME="${{ inputs.connector-name }}"
FORCE="${{ inputs.force }}"
if [[ -n "$PR_NUMBER" && "$PR_NUMBER" != "0" ]]; then
RUN_URL="${RUN_URL}?pr=${PR_NUMBER}"
echo "pr-text=\nPR: <${{ github.server_url }}/${{ github.repository }}/pull/${PR_NUMBER}|#${PR_NUMBER}>" >> $GITHUB_OUTPUT
else
echo "pr-text=" >> $GITHUB_OUTPUT
fi
DETAILS=""
if [[ -n "$CONNECTOR_NAME" ]]; then
DETAILS="${DETAILS}\nConnector: \`${CONNECTOR_NAME}\`"
fi
if [[ "$FORCE" == "true" ]]; then
DETAILS="${DETAILS}\nForce: true"
fi
echo "details-text=${DETAILS}" >> $GITHUB_OUTPUT
echo "run-url=${RUN_URL}" >> $GITHUB_OUTPUT
- name: Notify Slack on Registry Compile Success
if: steps.compile-registries.outcome == 'success'
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
with:
payload: |
{
"channel": "#connector-publish-updates",
"username": "Connectors CI/CD Bot",
"text": "☑️ *Registry Compile SUCCESS*${{ steps.notification-context.outputs.details-text }}${{ steps.notification-context.outputs.pr-text }}\nReference: <https://connectors.airbyte.com/files/registries/v0/cloud_registry.json|Cloud Registry> · <https://connectors.airbyte.com/files/registries/v0/oss_registry.json|OSS Registry> · <https://console.cloud.google.com/storage/browser/prod-airbyte-cloud-connector-metadata-service/registries/v0|GCS Bucket> · <${{ steps.notification-context.outputs.run-url }}|CI Logs>"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.PUBLISH_ON_MERGE_SLACK_WEBHOOK }}
- name: Notify Slack on Registry Compile Failure
if: always() && steps.compile-registries.outcome == 'failure'
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
with:
payload: |
{
"channel": "#connector-publish-updates",
"username": "Connectors CI/CD Bot",
"text": "❌ *Registry Compile FAILED*${{ steps.notification-context.outputs.details-text }}\n<${{ steps.notification-context.outputs.run-url }}|View workflow run>${{ steps.notification-context.outputs.pr-text }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.PUBLISH_ON_MERGE_SLACK_WEBHOOK }}