From c4f7125a7a0be90e4d28b89ce0bdea1663e29e36 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Wed, 8 May 2024 09:16:34 -0600 Subject: [PATCH 1/5] fix: look for change detection connection file in connections config folder --- src/sweeper/workspace_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sweeper/workspace_info.py b/src/sweeper/workspace_info.py index 6ef4719..0e0ab7d 100644 --- a/src/sweeper/workspace_info.py +++ b/src/sweeper/workspace_info.py @@ -81,7 +81,7 @@ def get_change_detection(): last_checked = checked_string.strftime("%m/%d/%Y") log.info(f"Last date change detection was checked: {last_checked}") - egdb = Path(config.get_config("CHANGE_DETECTION_CONNECTION")) + egdb = Path(config.get_config("CONNECTIONS_FOLDER")) / config.get_config("CHANGE_DETECTION_CONNECTION") cd_table = config.get_config("CHANGE_DETECTION_TABLE") egdb_conn = arcpy.ArcSDESQLExecute(str(egdb)) From 18c0d0d12cf57e8775967a6c7760606befa46db7 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Wed, 8 May 2024 09:37:58 -0600 Subject: [PATCH 2/5] docs: clarify default last checked date decision --- src/sweeper/workspace_info.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sweeper/workspace_info.py b/src/sweeper/workspace_info.py index 0e0ab7d..b25bec3 100644 --- a/src/sweeper/workspace_info.py +++ b/src/sweeper/workspace_info.py @@ -76,6 +76,7 @@ def get_change_detection(): if checked_date: checked_string = datetime.datetime.strptime(checked_date, "%Y-%m-%d") else: + #: this was a deliberate choice so that the first time sweeper is run, it won't processes all tables checked_string = datetime.date.today() last_checked = checked_string.strftime("%m/%d/%Y") From fb1bb4bddedd861e572fc1eadef6129c5e3eb325 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Wed, 8 May 2024 09:47:31 -0600 Subject: [PATCH 3/5] fix: upload code coverage after release Hoping to solve this error: https://docs.codecov.com/docs/error-reference#missing-base-report In the pull request codecov comment. --- .github/workflows/push.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 132a18b..fcdf741 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -62,3 +62,12 @@ jobs: - name: ๐Ÿš€ Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + + - name: ๐Ÿงช Run tests + run: pytest + + - name: โฌ†๏ธ Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./cov.xml From 0950d7dfec283b158af0e5e89ba3d0dd96b5330a Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Wed, 8 May 2024 09:54:38 -0600 Subject: [PATCH 4/5] fix: move release coverage upload to separate job --- .github/workflows/push.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index fcdf741..6efa86c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -63,6 +63,28 @@ jobs: - name: ๐Ÿš€ Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + upload-coverage: + runs-on: ubuntu-latest + needs: deploy-prod + + steps: + - name: โฌ‡๏ธ Set up code + uses: actions/checkout@v4 + with: + show-progress: false + + - name: ๐Ÿ Set up Python + uses: actions/setup-python@v5 + with: + cache: pip + cache-dependency-path: setup.py + + - name: ๐Ÿ— Install module + run: pip install .[tests] + + - name: โš™๏ธ Add config file + run: cp config.sample.json config.json + - name: ๐Ÿงช Run tests run: pytest From b2da1c52e3d86368f9542c182bba519d05d229e3 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Wed, 8 May 2024 10:17:04 -0600 Subject: [PATCH 5/5] fix: make --table-name and --change-detect mutually exclusive --- src/sweeper/__main__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sweeper/__main__.py b/src/sweeper/__main__.py index e8f789e..2728de3 100644 --- a/src/sweeper/__main__.py +++ b/src/sweeper/__main__.py @@ -4,12 +4,12 @@ sweeper Usage: - sweeper sweep duplicates --workspace= [--table-name= --verbose --try-fix --change-detect --scheduled --save-report= --backup-to=] - sweeper sweep empties --workspace= [--table-name= --verbose --try-fix --change-detect --scheduled --save-report= --backup-to=] - sweeper sweep invalids --workspace= [--table-name= --verbose --try-fix --change-detect --scheduled --save-report= --backup-to=] + sweeper sweep duplicates --workspace= [--table-name= | --change-detect] [--verbose --try-fix --scheduled --save-report= --backup-to=] + sweeper sweep empties --workspace= [--table-name= | --change-detect] [--verbose --try-fix --scheduled --save-report= --backup-to=] + sweeper sweep invalids --workspace= [--table-name= | --change-detect] [--verbose --try-fix --scheduled --save-report= --backup-to=] sweeper sweep addresses --workspace= --table-name= --field-name= [--verbose --try-fix --save-report= --backup-to=] - sweeper sweep metadata --workspace= [--table-name= --verbose --try-fix --change-detect --scheduled --save-report= --backup-to=] - sweeper sweep --workspace= [--table-name= --verbose --try-fix --change-detect --scheduled --save-report= --backup-to=] + sweeper sweep metadata --workspace= [--table-name= | --change-detect] [--verbose --try-fix --scheduled --save-report= --backup-to=] + sweeper sweep --workspace= [--table-name= | --change-detect] [--verbose --try-fix --scheduled --save-report= --backup-to=] Arguments: workspace - path to workspace eg: `c:\\my.gdb`