Skip to content

Commit a144128

Browse files
committed
Merge branch 'main' into debug/merge-generation
2 parents ab42149 + a95085f commit a144128

640 files changed

Lines changed: 19770 additions & 19360 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/rules/git-commit.mdc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: git commit format spec
3+
globs:
4+
alwaysApply: false
5+
---
6+
# Git Commit Format
7+
8+
Always use git commit -s to sign off on the commit
9+
Format: `<type>(scope): <description>`
10+
11+
Types:
12+
- `feat` - New feature
13+
- `fix` - Bug fix
14+
- `docs` - Documentation
15+
- `style` - Formatting
16+
- `refactor` - Code changes
17+
- `test` - Tests
18+
- `chore` - Maintenance

.github/actions/build-docker-image/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
outputs:
1010
image:
1111
description: Image that was built
12-
value: crowddotdev/${{ inputs.image }}:${{ steps.version-generator.outputs.IMAGE_VERSION }}
12+
value: sjc.ocir.io/axbydjxa5zuh/${{ inputs.image }}:${{ steps.version-generator.outputs.IMAGE_VERSION }}
1313

1414
runs:
1515
using: composite
@@ -26,7 +26,7 @@ runs:
2626

2727
- name: Login to docker repository
2828
shell: bash
29-
run: echo ${{ env.DOCKERHUB_PASSWORD }} | docker login -u ${{ env.DOCKERHUB_USERNAME }} --password-stdin
29+
run: echo '${{ env.ORACLE_DOCKER_PASSWORD }}' | docker login sjc.ocir.io -u '${{ env.ORACLE_DOCKER_USERNAME }}' --password-stdin
3030

3131
- name: Build and push docker image
3232
shell: bash

.github/actions/node/builder/index.js

Lines changed: 887 additions & 1342 deletions
Large diffs are not rendered by default.

.github/actions/node/src/inputs.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,20 @@ const getBuildInputs = (): IBuildInput => {
2121
}
2222

2323
const getPushInputs = (): IPushInput => {
24-
const username = process.env.DOCKERHUB_USERNAME
24+
const username = process.env.ORACLE_DOCKER_USERNAME
2525
if (!username) {
26-
core.error('No DockerHub username found in DOCKERHUB_USERNAME environment variable!')
27-
throw new Error('No DockerHub username found in DOCKERHUB_USERNAME environment variable!')
26+
core.error('No Oracle Docker username found in ORACLE_DOCKER_USERNAME environment variable!')
27+
throw new Error(
28+
'No Oracle Docker username found in ORACLE_DOCKER_USERNAME environment variable!',
29+
)
2830
}
2931

30-
const password = process.env.DOCKERHUB_PASSWORD
32+
const password = process.env.ORACLE_DOCKER_PASSWORD
3133
if (!password) {
32-
core.error('No DockerHub password found in DOCKERHUB_PASSWORD environment variable!')
33-
throw new Error('No DockerHub password found in DOCKERHUB_PASSWORD environment variable!')
34+
core.error('No Oracle Docker password found in ORACLE_DOCKER_PASSWORD environment variable!')
35+
throw new Error(
36+
'No Oracle Docker password found in ORACLE_DOCKER_PASSWORD environment variable!',
37+
)
3438
}
3539

3640
return {

.github/actions/node/src/steps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export const pushStep = async (): Promise<void> => {
7171
// do a docker login
7272
const exitCode = await exec.exec('docker', [
7373
'login',
74+
'sjc.ocir.io',
7475
'--username',
7576
pushInput.dockerUsername,
7677
'--password',

.github/workflows/lf-oracle-production-deploy.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99

1010
env:
1111
CLOUD_ENV: lf-oracle-production
12-
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
13-
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
12+
ORACLE_DOCKER_USERNAME: ${{ secrets.ORACLE_DOCKER_USERNAME }}
13+
ORACLE_DOCKER_PASSWORD: ${{ secrets.ORACLE_DOCKER_PASSWORD }}
1414
ORACLE_USER: ${{ secrets.ORACLE_USER }}
1515
ORACLE_TENANT: ${{ secrets.ORACLE_TENANT }}
1616
ORACLE_REGION: ${{ secrets.ORACLE_REGION }}
@@ -23,14 +23,14 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v2
26-
26+
2727
- name: Install OCI
2828
run: |
2929
curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh > install.sh
3030
chmod +x install.sh
3131
./install.sh --accept-all-defaults
3232
echo "OCI_CLI_DIR=/home/runner/bin" >> $GITHUB_ENV
33-
33+
3434
- name: Update PATH
3535
run: echo "${{ env.OCI_CLI_DIR }}" >> $GITHUB_PATH
3636

.github/workflows/lf-oracle-staging-deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99

1010
env:
1111
CLOUD_ENV: lf-oracle-staging
12-
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
13-
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
12+
ORACLE_DOCKER_USERNAME: ${{ secrets.ORACLE_DOCKER_USERNAME }}
13+
ORACLE_DOCKER_PASSWORD: ${{ secrets.ORACLE_DOCKER_PASSWORD }}
1414
ORACLE_USER: ${{ secrets.ORACLE_USER }}
1515
ORACLE_TENANT: ${{ secrets.ORACLE_TENANT }}
1616
ORACLE_REGION: ${{ secrets.ORACLE_REGION }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright The Linux Foundation and each contributor to LFX.
2+
# SPDX-License-Identifier: MIT
3+
name: PR Title Lint
4+
on:
5+
pull_request:
6+
# By default, a workflow only runs when a pull_request's activity type is opened, synchronize, or reopened. We
7+
# explicity override here so that PR titles are re-linted when the PR text content is edited.
8+
#
9+
# Possible values: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
10+
types: [opened, edited, reopened, synchronize]
11+
12+
jobs:
13+
pr-title-lint:
14+
uses: linuxfoundation/lfx-ui/.github/workflows/_pr-title-lint.yml@main

.github/workflows/tinybird-ci.yml

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
name: Tinybird CI
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, synchronize]
6+
paths:
7+
- 'services/libs/tinybird/**'
8+
workflow_dispatch:
9+
10+
env:
11+
DATA_PROJECT_DIR: services/libs/tinybird
12+
GIT_DEPTH: 300
13+
USE_LAST_PARTITION: true
14+
15+
jobs:
16+
check:
17+
name: Datafiles checks
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Install Tinybird CLI
26+
run: |
27+
if [ -f "${{ env.DATA_PROJECT_DIR }}/requirements.txt" ]; then
28+
pip install -r ${{ env.DATA_PROJECT_DIR }}/requirements.txt
29+
else
30+
pip install tinybird-cli
31+
fi
32+
33+
- name: Get changed files
34+
id: files
35+
uses: tj-actions/changed-files@v42
36+
with:
37+
files: |
38+
**/*.{datasource,incl,pipe}
39+
40+
- name: Check formatting
41+
if: ${{ steps.files.outputs.any_changed == 'true' }}
42+
shell: bash
43+
run: |
44+
for file in ${{ steps.files.outputs.all_changed_files }}; do
45+
tb fmt --diff "$file"
46+
done
47+
48+
deploy:
49+
name: Deploy to CI Branch
50+
runs-on: ubuntu-latest
51+
defaults:
52+
run:
53+
working-directory: ${{ env.DATA_PROJECT_DIR }}
54+
steps:
55+
- uses: actions/checkout@v4
56+
with:
57+
fetch-depth: ${{ env.GIT_DEPTH }}
58+
ref: ${{ github.event.pull_request.head.sha }}
59+
60+
- uses: actions/setup-python@v5
61+
with:
62+
python-version: "3.11"
63+
architecture: "x64"
64+
cache: pip
65+
66+
- name: Set environment variables
67+
run: |
68+
_ENV_FLAGS="${{ env.USE_LAST_PARTITION == 'true' && '--last-partition ' || '' }}--wait"
69+
_NORMALIZED_BRANCH_NAME=$(echo $DATA_PROJECT_DIR | rev | cut -d "/" -f 1 | rev | tr '.-' '_')
70+
GIT_BRANCH=${GITHUB_HEAD_REF}
71+
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
72+
echo "_ENV_FLAGS=$_ENV_FLAGS" >> $GITHUB_ENV
73+
echo "_NORMALIZED_BRANCH_NAME=$_NORMALIZED_BRANCH_NAME" >> $GITHUB_ENV
74+
if [ -f .tinyenv ]; then grep -v '^#' .tinyenv >> $GITHUB_ENV; fi
75+
echo >> $GITHUB_ENV
76+
77+
- name: Install Tinybird CLI
78+
run: |
79+
if [ -f "requirements.txt" ]; then
80+
pip install -r requirements.txt
81+
else
82+
pip install tinybird-cli
83+
fi
84+
85+
- name: Tinybird version
86+
run: tb --version
87+
88+
- name: Check all the data files syntax
89+
run: tb check
90+
91+
- name: Check auth
92+
run: tb --host ${{ secrets.TB_HOST }} --token ${{ secrets.TB_ADMIN_TOKEN }} auth info
93+
94+
- name: Try delete previous Branch
95+
run: |
96+
output=$(tb --host ${{ secrets.TB_HOST }} --token ${{ secrets.TB_ADMIN_TOKEN }} branch ls)
97+
BRANCH_NAME="tmp_ci_${_NORMALIZED_BRANCH_NAME}_${{ github.event.pull_request.number }}"
98+
if echo "$output" | grep -q "\b$BRANCH_NAME\b"; then
99+
tb --host ${{ secrets.TB_HOST }} --token ${{ secrets.TB_ADMIN_TOKEN }} branch rm $BRANCH_NAME --yes
100+
else
101+
echo "Skipping clean up: The Branch '$BRANCH_NAME' does not exist."
102+
fi
103+
104+
- name: Create new test Branch
105+
run: |
106+
tb \
107+
--host ${{ secrets.TB_HOST }} \
108+
--token ${{ secrets.TB_ADMIN_TOKEN }} \
109+
branch create tmp_ci_${_NORMALIZED_BRANCH_NAME}_${{ github.event.pull_request.number }} \
110+
${_ENV_FLAGS}
111+
112+
- name: Deploy changes to the test Branch
113+
run: |
114+
source .tinyenv || true
115+
DEPLOY_FILE=./deploy/${VERSION}/deploy.sh
116+
if [ ! -f "$DEPLOY_FILE" ]; then
117+
echo "$DEPLOY_FILE not found, running default tb deploy command"
118+
tb deploy ${CI_FLAGS}
119+
tb release ls
120+
fi
121+
122+
- name: Custom deployment to the test Branch
123+
run: |
124+
source .tinyenv || true
125+
DEPLOY_FILE=./deploy/${VERSION}/deploy.sh
126+
if [ -f "$DEPLOY_FILE" ]; then
127+
echo "$DEPLOY_FILE found"
128+
if ! [ -x "$DEPLOY_FILE" ]; then
129+
echo "Error: You do not have permission to execute '$DEPLOY_FILE'. Run:"
130+
echo "> chmod +x $DEPLOY_FILE"
131+
echo "and commit your changes"
132+
exit 1
133+
else
134+
$DEPLOY_FILE
135+
fi
136+
fi
137+
138+
test:
139+
name: Run tests
140+
runs-on: ubuntu-latest
141+
needs:
142+
- deploy
143+
defaults:
144+
run:
145+
working-directory: ${{ env.DATA_PROJECT_DIR }}
146+
steps:
147+
- uses: actions/checkout@v4
148+
with:
149+
fetch-depth: 0
150+
ref: ${{ github.event.pull_request.head.sha }}
151+
152+
- uses: actions/setup-python@v5
153+
with:
154+
python-version: "3.11"
155+
architecture: "x64"
156+
cache: pip
157+
158+
- name: Set environment variables
159+
run: |
160+
_ENV_FLAGS="--last-partition --wait"
161+
_NORMALIZED_BRANCH_NAME=$(echo $DATA_PROJECT_DIR | rev | cut -d "/" -f 1 | rev | tr '.-' '_')
162+
GIT_BRANCH=${GITHUB_HEAD_REF}
163+
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
164+
echo "_ENV_FLAGS=$_ENV_FLAGS" >> $GITHUB_ENV
165+
echo "_NORMALIZED_BRANCH_NAME=$_NORMALIZED_BRANCH_NAME" >> $GITHUB_ENV
166+
if [ -f .tinyenv ]; then grep -v '^#' .tinyenv >> $GITHUB_ENV; fi
167+
echo >> $GITHUB_ENV
168+
169+
- name: Install Tinybird CLI
170+
run: |
171+
if [ -f "requirements.txt" ]; then
172+
pip install -r requirements.txt
173+
else
174+
pip install tinybird-cli
175+
fi
176+
177+
- name: Tinybird version
178+
run: tb --version
179+
180+
- name: Check auth
181+
run: tb --host ${{ secrets.TB_HOST }} --token ${{ secrets.TB_ADMIN_TOKEN }} auth info
182+
183+
- name: Use Branch
184+
run: |
185+
BRANCH_NAME="tmp_ci_${_NORMALIZED_BRANCH_NAME}_${{ github.event.pull_request.number }}"
186+
tb --host ${{ secrets.TB_HOST }} --token ${{ secrets.TB_ADMIN_TOKEN }} branch use $BRANCH_NAME
187+
188+
- name: Post deploy
189+
run: |
190+
POSTDEPLOY_FILE=./deploy/${VERSION}/postdeploy.sh
191+
if [ -f "$POSTDEPLOY_FILE" ]; then
192+
if ! [ -x "$POSTDEPLOY_FILE" ]; then
193+
echo "Error: You do not have permission to execute '$POSTDEPLOY_FILE'. Run:"
194+
echo "> chmod +x $POSTDEPLOY_FILE"
195+
echo "and commit your changes"
196+
exit 1
197+
else
198+
$POSTDEPLOY_FILE
199+
fi
200+
fi
201+
202+
- name: Get regression labels
203+
id: regression_labels
204+
uses: alrocar/get-labels-action@v1.0.1
205+
with:
206+
github_token: ${{ secrets.GITHUB_TOKEN }}
207+
label_key: regression
208+
209+
- name: Run pipe regression tests
210+
run: |
211+
source .tinyenv || true
212+
echo ${{ steps.regression_labels.outputs.labels }}
213+
REGRESSION_LABELS=$(echo "${{ steps.regression_labels.outputs.labels }}" | awk -F, '{for (i=1; i<=NF; i++) if ($i ~ /^--/) print $i}' ORS=',' | sed 's/,$//')
214+
echo "Regression labels: ${REGRESSION_LABELS}"
215+
216+
CONFIG_FILE=./tests/regression.yaml
217+
BASE_CMD="tb branch regression-tests"
218+
LABELS_CMD="$(echo ${REGRESSION_LABELS} | tr , ' ')"
219+
if [ -f ${CONFIG_FILE} ]; then
220+
echo "Config file '${CONFIG_FILE}' found, adding pull request labels as options"
221+
${BASE_CMD} -f ${CONFIG_FILE} --wait ${LABELS_CMD}
222+
else
223+
echo "Config file not found at '${CONFIG_FILE}', running with default values"
224+
${BASE_CMD} coverage --wait ${LABELS_CMD}
225+
fi

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ yarn-error.log*
2424
api-test/__pycache__/api_test.cpython-39-pytest-6.2.4.pyc
2525

2626
# python
27+
.venv/
2728
**/*-venv
2829
**/venv
2930
**/venv*
@@ -50,3 +51,11 @@ api-test/__pycache__/api_test.cpython-39-pytest-6.2.4.pyc
5051
docker/volume
5152

5253
services/libs/*/dist
54+
55+
**/.tinyb
56+
**/.tinyenv
57+
**/*copied_ranges.log*
58+
services/libs/tinybird/.diff_tmp
59+
60+
# custom cursor rules
61+
.cursor/rules/*.local.mdc

0 commit comments

Comments
 (0)