Skip to content

Commit f754f78

Browse files
authored
Merge pull request #65 from tinybirdco/fmt2
3.1.0
2 parents 6604526 + 87b2f48 commit f754f78

File tree

4 files changed

+12
-142
lines changed

4 files changed

+12
-142
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
required: false
1010
type: string
1111
default: .
12+
tb_format:
13+
description: "true to force formatting of Datafiles"
14+
required: false
15+
type: boolean
16+
default: false
1217
secrets:
1318
tb_admin_token:
1419
required: true
@@ -19,7 +24,7 @@ jobs:
1924
check:
2025
name: Datafiles checks
2126
runs-on: ubuntu-latest
22-
if: ${{ github.event.action != 'closed' }}
27+
if: ${{ inputs.tb_format && github.event.action != 'closed' }}
2328
steps:
2429
- name: Checkout code
2530
uses: actions/checkout@v4
@@ -41,16 +46,6 @@ jobs:
4146
files: |
4247
**/*.{datasource,incl,pipe}
4348
44-
- name: Check all the files
45-
if: ${{ steps.files.outputs.any_changed == 'true' }}
46-
shell: bash
47-
run: |
48-
for file in ${{ steps.files.outputs.all_changed_files }}; do
49-
if [[ $file != *.incl ]]; then
50-
tb check "$file"
51-
fi
52-
done
53-
5449
- name: Check formatting
5550
if: ${{ steps.files.outputs.any_changed == 'true' }}
5651
shell: bash
@@ -62,8 +57,6 @@ jobs:
6257
deploy:
6358
name: Deploy to CI Branch
6459
runs-on: ubuntu-latest
65-
needs:
66-
- check
6760
defaults:
6861
run:
6962
working-directory: ${{ inputs.data_project_dir }}
@@ -105,6 +98,9 @@ jobs:
10598
- name: Tinybird version
10699
run: tb --version
107100

101+
- name: Check all the data files syntax
102+
run: tb check
103+
108104
- name: Check auth
109105
run: tb --host ${{ secrets.tb_host }} --token ${{ secrets.tb_admin_token }} auth info
110106

.github/workflows/release.yml

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -55,76 +55,6 @@ jobs:
5555
--token ${{ secrets.tb_admin_token }} \
5656
release promote \
5757
--semver $VERSION
58-
rollback:
59-
runs-on: ubuntu-latest
60-
if: inputs.job_to_run == 'rollback'
61-
defaults:
62-
run:
63-
working-directory: ${{ inputs.data_project_dir }}
64-
steps:
65-
- uses: actions/checkout@master
66-
- uses: actions/setup-python@v5
67-
with:
68-
python-version: "3.11"
69-
architecture: "x64"
70-
cache: 'pip'
71-
72-
- name: Validate input
73-
run: |
74-
[[ "${{ secrets.tb_admin_token }}" ]] || { echo "Go to the tokens section in your Workspace, copy the 'admin token' and set TB_ADMIN_TOKEN as a Secret in your Git repository"; exit 1; }
75-
- name: Install Tinybird CLI
76-
run: |
77-
if [ -f "requirements.txt" ]; then
78-
pip install -r requirements.txt
79-
else
80-
pip install tinybird-cli
81-
fi
82-
- name: Tinybird version
83-
run: tb --version
84-
85-
- name: Rollback Release
86-
run: |
87-
source .tinyenv
88-
tb \
89-
--host ${{ secrets.tb_host }} \
90-
--token ${{ secrets.tb_admin_token }} \
91-
release rollback --yes
92-
rm:
93-
runs-on: ubuntu-latest
94-
if: inputs.job_to_run == 'rm'
95-
96-
defaults:
97-
run:
98-
working-directory: ${{ inputs.data_project_dir }}
99-
steps:
100-
- uses: actions/checkout@master
101-
- uses: actions/setup-python@v5
102-
with:
103-
python-version: "3.11"
104-
architecture: "x64"
105-
cache: 'pip'
106-
107-
- name: Validate input
108-
run: |
109-
[[ "${{ secrets.tb_admin_token }}" ]] || { echo "Go to the tokens section in your Workspace, copy the 'admin token' and set TB_ADMIN_TOKEN as a Secret in your Git repository"; exit 1; }
110-
- name: Install Tinybird CLI
111-
run: |
112-
if [ -f "requirements.txt" ]; then
113-
pip install -r requirements.txt
114-
else
115-
pip install tinybird-cli
116-
fi
117-
- name: Tinybird version
118-
run: tb --version
119-
120-
- name: Remove Release
121-
run: |
122-
source .tinyenv
123-
tb \
124-
--host ${{ secrets.tb_host }} \
125-
--token ${{ secrets.tb_admin_token }} \
126-
release rm \
127-
--semver $VERSION --force --yes
12858
12959
dry_run_rm_oldest_rollback:
13060
name: DRY-RUN Remove latest rollback Release

.gitlab/ci_cd.yaml

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -328,64 +328,6 @@ variables:
328328
release promote \
329329
--semver $VERSION
330330
331-
.release_rollback:
332-
stage: release
333-
image: ${IMAGE_BASE}
334-
script:
335-
- cd $CI_PROJECT_DIR/$DATA_PROJECT_DIR
336-
337-
# Create Python Virtual Environment
338-
- python -m venv .venv
339-
- source .venv/bin/activate
340-
341-
# Install Tinybird CLI
342-
- |
343-
if [ -f "requirements.txt" ]; then
344-
pip install -r requirements.txt
345-
else
346-
pip install tinybird-cli
347-
fi
348-
349-
# Tinybird version
350-
- tb --version
351-
352-
# Promote Release
353-
- |
354-
source .tinyenv
355-
tb \
356-
--host $TB_HOST \
357-
--token $TB_ADMIN_TOKEN \
358-
release rollback --yes
359-
360-
.release_rm:
361-
stage: release
362-
image: ${IMAGE_BASE}
363-
script:
364-
- cd $CI_PROJECT_DIR/$DATA_PROJECT_DIR
365-
366-
# Create Python Virtual Environment
367-
- python -m venv .venv
368-
- source .venv/bin/activate
369-
370-
# Install Tinybird CLI
371-
- |
372-
if [ -f "requirements.txt" ]; then
373-
pip install -r requirements.txt
374-
else
375-
pip install tinybird-cli
376-
fi
377-
378-
# Tinybird version
379-
- tb --version
380-
381-
# Promote Release
382-
- |
383-
source .tinyenv
384-
tb \
385-
--host $TB_HOST \
386-
--token $TB_ADMIN_TOKEN \
387-
release rm --semver $VERSION --force --yes
388-
389331
.dry_run_release_rm_oldest_rollback:
390332
stage: release
391333
image: ${IMAGE_BASE}

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
v3.1.0
22
========
33

4-
- Add new `check` job in GitHub Actions. It checks syntax and forces format Datafiles so there are no mismatches in the project when working from the UI and git.
4+
- Add new `check` job in GitHub Actions. It forces format Datafiles so there are no mismatches in the project when working from the UI and git. To activate it create set a `tb_format: true` input `tinybird_ci.yml`
5+
- Remove `rollback` and `rm` jobs from GitHub Actions
6+
- Remove `release_rollback` and `release_rm` from GitLab CI.
57

68
v3.0.0
79
========

0 commit comments

Comments
 (0)