Skip to content

Commit ef72058

Browse files
authored
Merge branch 'main' into release-databricks-adapter
2 parents 91ecc8d + 5d88251 commit ef72058

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
lines changed

.github/workflows/checking_labels.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
name: "Checking Labels"
22

3+
#Workflow to provide needed information for a remote workflow trigger through testing label.
4+
35
permissions:
46
issues: write
57

8+
#Will be triggered if label is added to a pull request with the main branch as target.
69
on:
710
pull_request:
811
types: [labeled]
912
branches:
1013
- main
1114

15+
#Concurrency group to avoid grabbing false artifacts.
1216
concurrency:
1317
group: trigger-group
1418
cancel-in-progress: false
1519

16-
jobs:
17-
checking-labels:
20+
# Checking if the 'testing' label is attached to the Pull Request.
21+
# Saving information about testing label and PR ID as artifact for further processing.
22+
jobs:
23+
checking-labels:
1824
runs-on: ubuntu-latest
1925
steps:
2026
- name:
@@ -37,4 +43,4 @@ jobs:
3743
- uses: actions/upload-artifact@v4
3844
with:
3945
name: prid
40-
path: prid/
46+
path: prid/

.github/workflows/trigger_remote_workflow.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
name: "Trigger remote Workflow"
22

3+
#Workflow to trigger cicd workflow after checking trigger access.
4+
35
permissions:
46
issues: write
57
id-token: write
68
contents: write
79

8-
on:
10+
#Running after the 'Checking Labels' workflow.
11+
on:
912
workflow_run:
1013
workflows: [Checking Labels]
1114
types: [completed]
1215

13-
concurrency:
16+
#Concurrency group to avoid grabbing false artifacts.
17+
concurrency:
1418
group: trigger-group
1519
cancel-in-progress: false
1620

@@ -19,7 +23,8 @@ jobs:
1923
runs-on: ubuntu-latest
2024
steps:
2125

22-
- name: Generate token
26+
#generating token to trigger the pipeline in cicd repository.
27+
- name: Generate token
2328
id: generate_token
2429
uses: actions/create-github-app-token@v1
2530
with:
@@ -28,18 +33,21 @@ jobs:
2833
owner: ${{ github.repository_owner }}
2934
repositories: "datavault4dbt,datavault4dbt-ci-cd"
3035

31-
- name: Checking User Identity
36+
#Checking if creator of PR is member of internal development team.
37+
- name: Checking User Identity
3238
id: user_affiliation
3339
uses: tspascoal/get-user-teams-membership@v2
3440
with:
3541
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
3642
username: ${{ github.actor }}
3743
team: 'Datavault4dbt Devs'
3844

39-
- name: Outpu Team Membership
45+
#Team Membership output for debugging
46+
- name: Output Team Membership
4047
run: echo "Member of datavault4dbt dev team; ${{ steps.user_affiliation.outputs.isTeamMember }}"
4148

42-
- name: downloading-artifacts
49+
#Grabbing the artifacts of 'checking labels' workflow.
50+
- name: downloading-artifacts
4351
id: download-artifact
4452
uses: dawidd6/action-download-artifact@v6
4553
with:
@@ -49,7 +57,7 @@ jobs:
4957
skip_unpack: false
5058
path: ./
5159
allow_forks: true
52-
60+
5361
- name: extract-artifact
5462
id: extract-artifact
5563
run: |
@@ -61,12 +69,13 @@ jobs:
6169
- name: Checkout
6270
uses: actions/checkout@v3
6371

64-
- name: Create a new branch based on the PR ID
72+
- name: Create a new branch based on the PR ID
6573
run: |
6674
git fetch origin pull/${{ steps.extract-artifact.outputs.prid }}/head:pull/${{ steps.extract-artifact.outputs.prid }}
6775
git push -u origin pull/${{ steps.extract-artifact.outputs.prid }}
6876
69-
#Will only be triggered if external PRs is approved before
77+
#Trigger the workflow if creator of PR is not a member of development team.
78+
#Will only be triggered if external PRs is approved before.
7079
- name: Call Workflow
7180
if: ${{ steps.user_affiliation.outputs.isTeamMember == 'false'}}
7281
env:
@@ -79,6 +88,7 @@ jobs:
7988
/repos/ScalefreeCOM/datavault4dbt-ci-cd/actions/workflows/reusable-workflow.yml/dispatches \
8089
-f "ref=main" -f "inputs[pr_branch]=pull/${{ steps.extract-artifact.outputs.prid }}" -f "inputs[all_env]=true" -f "inputs[pr_id]=${{ steps.extract-artifact.outputs.prid }}" -f "inputs[remote-triggered]=true"
8190
91+
#Trigger workflow if member of development team added testing label to PR.
8292
- name: trigger-labeled-workflow
8393
if: ${{ steps.extract-artifact.outputs.labels == 'true' && steps.user_affiliation.outputs.isTeamMember == 'true'}}
8494
env:

macros/staging/fabric/stage.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@
172172
{%- set error_value_rsrc = var('datavault4dbt.default_error_rsrc', 'ERROR') -%}
173173
{%- set unknown_value_rsrc = var('datavault4dbt.default_unknown_rsrc', 'SYSTEM') -%}
174174

175-
{#- Setting the rsrc default datatype and length -#}
176-
{%- set rsrc_default_dtype = var('datavault4dbt.rsrc_default_dtype', 'VARCHAR') -%}
175+
{#- Setting the rsrc default datatype -#}
176+
{%- set rsrc_default_dtype = datavault4dbt.string_default_dtype(type=rsrc) -%}
177177

178178
{{ datavault4dbt.prepend_generated_by() }}
179179

macros/tables/fabric/rec_track_sat.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
{%- set rsrc_unknown = var('datavault4dbt.default_unknown_rsrc', 'SYSTEM') -%}
99
{%- set rsrc_error = var('datavault4dbt.default_error_rsrc', 'ERROR') -%}
1010

11-
{# Setting the rsrc and stg_alias default datatype and length #}
12-
{%- set rsrc_default_dtype = var('datavault4dbt.rsrc_default_dtype', 'VARCHAR(400)') -%}
13-
{%- set stg_default_dtype = var('datavault4dbt.stg_default_dtype', 'VARCHAR(400)') -%}
11+
{# Setting the rsrc and stg_alias default datatypes #}
12+
{%- set rsrc_default_dtype = datavault4dbt.string_default_dtype(type=rsrc) -%}
13+
{%- set stg_default_dtype = datavault4dbt.string_default_dtype(type=stg) -%}
1414
{%- set ns = namespace(last_cte = '', source_included_before = {}, source_models_rsrc_dict={}, has_rsrc_static_defined=true) -%}
1515

1616
{%- if source_models is not mapping and not datavault4dbt.is_list(source_models) -%}

0 commit comments

Comments
 (0)