Skip to content

Commit

Permalink
feature/finish-db-models (#7)
Browse files Browse the repository at this point in the history
* Finish the base model definitions

* Add tests for checking primary keys and indexes

* Add model indexes

* Rename ignore classes global

* Fix MatterStatus primary keys and indexes

* Attempt to build on all platforms

* Fix tests

* Install graphviz depending on platform

* Remove "yes" command to install commands

* Try without libgraphviz-dev on mac and windows

* Replace pygraphviz dep with pydot

* Drop libgraphviz-dev from dep install

* Clean up the rest of the workflow files after build changes

* Update CRON timing to 10:24:00

* Move graphviz to actual requirements instead of test deps
  • Loading branch information
Jackson Maxfield Brown committed Nov 7, 2020
1 parent 93d941f commit 1c9bb27
Show file tree
Hide file tree
Showing 7 changed files with 431 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
python-version: 3.8
- name: Install graphviz
run: |
sudo apt-get install graphviz libgraphviz-dev -y
sudo apt-get install graphviz
- name: Install Dependencies
run: |
pip install --upgrade pip
Expand Down
29 changes: 22 additions & 7 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,39 @@ on:
branches:
- main
schedule:
# <minute [0,59]> <hour [0,23]> <day of the month [1,31]> <month of the year [1,12]> <day of the week [0,6]>
# <minute [0,59]> <hour [0,23]> <day of the month [1,31]>
# <month of the year [1,12]> <day of the week [0,6]>
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
# Run every Monday at 18:00:00 UTC (Monday at 10:00:00 PST)
- cron: '0 18 * * 1'
# Run every Monday at 18:00:00 UTC (Monday at 10:24:00 PST)
# (Since these CRONs are used by a lot of people -
# let's be nice to the servers and schedule it _not_ on the hour)
- cron: '24 18 * * 1'

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install graphviz
- name: Install graphviz (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install graphviz
- name: Install graphviz (Mac)
if: matrix.os == 'macOS-latest'
run: |
brew install graphviz
- name: Install graphviz (Windows)
if: matrix.os == 'windows-latest'
run: |
sudo apt-get install graphviz libgraphviz-dev -y
choco install graphviz
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -44,7 +59,7 @@ jobs:
python-version: 3.8
- name: Install graphviz
run: |
sudo apt-get install graphviz libgraphviz-dev -y
sudo apt-get install graphviz
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,29 @@ on: pull_request

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install graphviz
- name: Install graphviz (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install graphviz
- name: Install graphviz (Mac)
if: matrix.os == 'macOS-latest'
run: |
brew install graphviz
- name: Install graphviz (Windows)
if: matrix.os == 'windows-latest'
run: |
sudo apt-get install graphviz libgraphviz-dev -y
choco install graphviz
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -36,7 +48,7 @@ jobs:
python-version: 3.8
- name: Install graphviz
run: |
sudo apt-get install graphviz libgraphviz-dev -y
sudo apt-get install graphviz
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -58,7 +70,7 @@ jobs:
python-version: 3.8
- name: Install graphviz
run: |
sudo apt-get install graphviz libgraphviz-dev -y
sudo apt-get install graphviz
- name: Install Dependencies
run: |
pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions cdp_backend/bin/create_cdp_database_uml.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _construct_dot_file(output_file: str):

# First pass: create nodes for each model
for model_name, cls in inspect.getmembers(models, inspect.isclass):
if model_name not in ["Model", "datetime"]:
if model_name not in models._BUILD_IGNORE_CLASSES:
# Attach fields for each model by using the Example
fields = []
m = cls.Example()
Expand Down Expand Up @@ -106,7 +106,7 @@ def _construct_dot_file(output_file: str):

# Second pass: Create DAG
for model_name, cls in inspect.getmembers(models, inspect.isclass):
if model_name not in ["Model", "datetime"]:
if model_name not in models._BUILD_IGNORE_CLASSES:
# Attach fields for each model by using the Example
m = cls.Example()

Expand Down
Loading

0 comments on commit 1c9bb27

Please sign in to comment.