Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version all the files, update CI tests and vscode settings #77

Merged
merged 15 commits into from
Jun 29, 2023

Conversation

dave-connors-3
Copy link
Contributor

@dave-connors-3 dave-connors-3 commented Jun 21, 2023

this PR

  • adds versioned schema files for 1.5 + 1.6
  • leaves the originals in place until we get the greenlight to deprecate them from @benmosher
  • updates CI and the vscode settings to point the right versions at separate test files in the tests directory.
  • adds dependencies.yml support in 1.6

@benmosher
Copy link

an idea: storing files as e.g. schemas/{version}/dbt_project-{version}.json would be the teensiest bit redundant, but as the versions pile up, you won't end up with one super-heavy folder fulla schemata.

joellabes
joellabes previously approved these changes Jun 26, 2023
Copy link
Collaborator

@joellabes joellabes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ones I commented on are the only ones I looked at, assuming that the rest are renames and copy-pastes. If there's others that you'd like me to check please lmk!

I'm approving this since the suggested changes aren't mandatory but will make life easier in the future 🔮

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Comment on lines 4 to 9
PROJECT_SCHEMA_FILES = [
"./schemas/dbt_project.json",
"./schemas/dbt_project-1.5.json",
"./schemas/dbt_project-1.6.json"
]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be better as a query that lists all files matching the pattern dbt_project[\-\d\.]*\.json or something, instead of a hardcoded list that we have to remember to keep up to date

@@ -0,0 +1,22 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -0,0 +1,2 @@
projects:
- gnome: my_dbt_project
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,2 @@
projects:
- name: my_dbt_project
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dave-connors-3
Copy link
Contributor Author

@joellabes would love a quick re-review! I updated the folder paths per Ben's recommendation and added the matrix feature to make CI a lot DRYer. The only notable byproduct of that move was that schema.yml files in the tests directory are now named dbt_yml_files to match the name of the schema, so the matrix combos behave properly. Let me know if that is a dealbreaker for you in any way!

I also chose not to do the file regexing in validate_plusless_properties.py -- feels like a quarterly update of that variable as a part of the new version process is an OK amount of friction

joellabes
joellabes previously approved these changes Jun 27, 2023
Copy link
Collaborator

@joellabes joellabes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magnificent!

Comment on lines 35 to 39
- name: Validate dbt_project.yml sample files for dbt version ${{ matrix.dbt-version }}
run: |
npx ajv-cli test -s schemas/dbt_project-1.5.json -d tests/1.5/valid/dbt_project.yml --valid
npx ajv-cli test -s schemas/dbt_project-1.5.json -d tests/1.5/invalid/dbt_project.yml --invalid
- name: Validate resource yml sample files for dbt version 1.5
run: |
npx ajv-cli test -s schemas/dbt_yml_files-1.5.json -d tests/1.5/valid/schema.yml --valid
npx ajv-cli test -s schemas/dbt_yml_files-1.5.json -d tests/1.5/invalid/schema.yml --invalid
- name: Validate packages.yml sample files for dbt version 1.5
run: |
npx ajv-cli test -s schemas/packages-1.5.json -d tests/1.5/valid/packages.yml --valid
npx ajv-cli test -s schemas/packages-1.5.json -d tests/1.5/invalid/packages.yml --invalid
- name: Validate selectors.yml sample files for dbt version 1.5
run: |
npx ajv-cli test -s schemas/selectors-1.5.json -d tests/1.5/valid/selectors.yml --valid
npx ajv-cli test -s schemas/selectors-1.5.json -d tests/1.5/invalid/selectors.yml --invalid

- name: Validate dbt_project.yml sample files for dbt version 1.6
run: |
npx ajv-cli test -s schemas/dbt_project-1.6.json -d tests/1.6/valid/dbt_project.yml --valid
npx ajv-cli test -s schemas/dbt_project-1.6.json -d tests/1.6/invalid/dbt_project.yml --invalid
- name: Validate resource yml sample files for dbt version 1.6
run: |
npx ajv-cli test -s schemas/dbt_yml_files-1.6.json -d tests/1.6/valid/schema.yml --valid
npx ajv-cli test -s schemas/dbt_yml_files-1.6.json -d tests/1.6/invalid/schema.yml --invalid
- name: Validate packages.yml sample files for dbt version 1.6
run: |
npx ajv-cli test -s schemas/packages-1.6.json -d tests/1.6/valid/packages.yml --valid
npx ajv-cli test -s schemas/packages-1.6.json -d tests/1.6/invalid/packages.yml --invalid
- name: Validate selectors.yml sample files for dbt version 1.6
run: |
npx ajv-cli test -s schemas/selectors-1.6.json -d tests/1.6/valid/selectors.yml --valid
npx ajv-cli test -s schemas/selectors-1.6.json -d tests/1.6/invalid/selectors.yml --invalid

- name: Validate dependencies.yml sample files for dbt version 1.6
run: |
npx ajv-cli test -s schemas/dependencies-1.6.json -d tests/1.6/valid/dependencies.yml --valid
npx ajv-cli test -s schemas/dependencies-1.6.json -d tests/1.6/invalid/dependencies.yml --invalid
npx ajv-cli test -s schemas/${{ matrix.dbt-version }}/${{ matrix.dbt-file-name }}-${{ matrix.dbt-version }}.json -d tests/${{ matrix.dbt-version }}/valid/${{ matrix.dbt-file-name }}.yml --valid
npx ajv-cli test -s schemas/${{ matrix.dbt-version }}/${{ matrix.dbt-file-name }}-${{ matrix.dbt-version }}.json -d tests/${{ matrix.dbt-version }}/invalid/${{ matrix.dbt-file-name }}.yml --invalid

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:chefs-kiss:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shreks-kick:

@dave-connors-3
Copy link
Contributor Author

@joellabes i didn't mean to dismiss your stale review :( i moved the default files back to the root of the folder so the IDE validation doesn't break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants