Skip to content

Commit 9f2446c

Browse files
authored
Merge pull request #591 from splitgraph/bugfix/sgr-cloud-generation
Fix various issues from e2e testing:
2 parents bb4a46a + 2f43624 commit 9f2446c

7 files changed

Lines changed: 16 additions & 40 deletions

File tree

splitgraph/cloud/project/generation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,11 @@ def generate_splitgraph_yml(
235235
"metadata": CM(
236236
{
237237
"description": "Sample dbt model",
238-
"readme": "## Sample dbt model\n\n"
239-
"This is an autogenerated model referencing data from:\n\n"
240-
+ "\n".join(f" * [/{r}](/{r})" for r in repository_names),
238+
"readme": {
239+
"text": "## Sample dbt model\n\n"
240+
"This is an autogenerated model referencing data from:\n\n"
241+
+ "\n".join(f" * [/{r}](/{r})" for r in repository_names)
242+
},
241243
}
242244
),
243245
}

splitgraph/cloud/project/github_actions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ def generate_job(
2929
steps.append(
3030
{
3131
"name": "Set up dbt Git URL",
32-
"run": 'echo "$CREDENTIALS_YML" > splitgraph.credentials.yml'
33-
+ '\nsed -i "s|\\$THIS_REPO_URL|https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY|g" splitgraph.credentials.yml',
32+
"run": [
33+
'echo "$CREDENTIALS_YML" > splitgraph.credentials.yml',
34+
'sed -i "s|\$THIS_REPO_URL|https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY|g" splitgraph.credentials.yml',
35+
],
3436
"shell": "bash",
3537
"env": {
3638
"CREDENTIALS_YML": "${{secrets.SPLITGRAPH_CREDENTIALS_YML}}",

splitgraph/cloud/project/templates.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,6 @@
5252
# if you are running a local Splitgraph engine and are developing this dbt model against it.
5353
profile: 'splitgraph_template'
5454
55-
# These configurations specify where dbt should look for different types of files.
56-
# The `model-paths` config, for example, states that models in this project can be
57-
# found in the "models/" directory. You probably won't need to change these!
58-
model-paths: ["models"]
59-
analysis-paths: ["analyses"]
60-
test-paths: ["tests"]
61-
seed-paths: ["seeds"]
62-
macro-paths: ["macros"]
63-
snapshot-paths: ["snapshots"]
64-
6555
target-path: "target" # directory which will store compiled SQL files
6656
clean-targets: # directories to be removed by `dbt clean`
6757
- "target"

test/splitgraph/cloud/project/snapshots/test_dbt/test_generate_dbt_project/splitgraph_template/dbt_project.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ config-version: 2
1515
# if you are running a local Splitgraph engine and are developing this dbt model against it.
1616
profile: 'splitgraph_template'
1717

18-
# These configurations specify where dbt should look for different types of files.
19-
# The `model-paths` config, for example, states that models in this project can be
20-
# found in the "models/" directory. You probably won't need to change these!
21-
model-paths: ["models"]
22-
analysis-paths: ["analyses"]
23-
test-paths: ["tests"]
24-
seed-paths: ["seeds"]
25-
macro-paths: ["macros"]
26-
snapshot-paths: ["snapshots"]
27-
2818
target-path: "target" # directory which will store compiled SQL files
2919
clean-targets: # directories to be removed by `dbt clean`
3020
- "target"

test/splitgraph/cloud/project/snapshots/test_generation/test_generate_project_with_dbt/generate_project_dbt/.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ jobs:
5757
splitgraph_api_key: ${{ secrets.SPLITGRAPH_API_KEY }}
5858
splitgraph_api_secret: ${{ secrets.SPLITGRAPH_API_SECRET }}
5959
- name: Set up dbt Git URL
60-
run: "echo \"$CREDENTIALS_YML\" > splitgraph.credentials.yml\nsed -i \"s|\\\
61-
$THIS_REPO_URL|https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY|g\"\
62-
\ splitgraph.credentials.yml"
60+
run:
61+
- echo "$CREDENTIALS_YML" > splitgraph.credentials.yml
62+
- sed -i "s|\$THIS_REPO_URL|https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY|g"
63+
splitgraph.credentials.yml
6364
shell: bash
6465
env:
6566
CREDENTIALS_YML: ${{secrets.SPLITGRAPH_CREDENTIALS_YML}}

test/splitgraph/cloud/project/snapshots/test_generation/test_generate_project_with_dbt/generate_project_dbt/dbt_project.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ config-version: 2
1515
# if you are running a local Splitgraph engine and are developing this dbt model against it.
1616
profile: 'splitgraph_template'
1717

18-
# These configurations specify where dbt should look for different types of files.
19-
# The `model-paths` config, for example, states that models in this project can be
20-
# found in the "models/" directory. You probably won't need to change these!
21-
model-paths: ["models"]
22-
analysis-paths: ["analyses"]
23-
test-paths: ["tests"]
24-
seed-paths: ["seeds"]
25-
macro-paths: ["macros"]
26-
snapshot-paths: ["snapshots"]
27-
2818
target-path: "target" # directory which will store compiled SQL files
2919
clean-targets: # directories to be removed by `dbt clean`
3020
- "target"

test/splitgraph/cloud/project/snapshots/test_generation/test_generate_project_with_dbt/generate_project_dbt/splitgraph.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,6 @@ repositories:
100100
tables: {}
101101
metadata:
102102
description: Sample dbt model
103-
readme: "## Sample dbt model\n\nThis is an autogenerated model referencing data\
104-
\ from:\n\n * [/myns/postgres_fdw](/myns/postgres_fdw)\n * [/myns/airbyte-postgres](/myns/airbyte-postgres)"
103+
readme:
104+
text: "## Sample dbt model\n\nThis is an autogenerated model referencing data\
105+
\ from:\n\n * [/myns/postgres_fdw](/myns/postgres_fdw)\n * [/myns/airbyte-postgres](/myns/airbyte-postgres)"

0 commit comments

Comments
 (0)