arches-querysets 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arches_querysets-0.1.0/.babelrc +7 -0
- arches_querysets-0.1.0/.browserslistrc +10 -0
- arches_querysets-0.1.0/.coveragerc +30 -0
- arches_querysets-0.1.0/.gitattributes +11 -0
- arches_querysets-0.1.0/.github/actions/build-and-test-branch/action.yml +109 -0
- arches_querysets-0.1.0/.github/actions/install-arches-applications/action.yml +29 -0
- arches_querysets-0.1.0/.github/workflows/main.yml +272 -0
- arches_querysets-0.1.0/.gitignore +23 -0
- arches_querysets-0.1.0/.pre-commit-config.yaml +34 -0
- arches_querysets-0.1.0/.prettierrc +4 -0
- arches_querysets-0.1.0/.stylelintrc.json +3 -0
- arches_querysets-0.1.0/LICENSE +674 -0
- arches_querysets-0.1.0/MANIFEST.in +1 -0
- arches_querysets-0.1.0/PKG-INFO +146 -0
- arches_querysets-0.1.0/README.md +110 -0
- arches_querysets-0.1.0/arches_querysets/__init__.py +0 -0
- arches_querysets-0.1.0/arches_querysets/apps.py +14 -0
- arches_querysets-0.1.0/arches_querysets/bulk_operations/__init__.py +0 -0
- arches_querysets-0.1.0/arches_querysets/bulk_operations/tiles.py +500 -0
- arches_querysets-0.1.0/arches_querysets/celery.py +13 -0
- arches_querysets-0.1.0/arches_querysets/datatypes/__init__.py +0 -0
- arches_querysets-0.1.0/arches_querysets/functions/__init__.py +0 -0
- arches_querysets-0.1.0/arches_querysets/hosts.py +11 -0
- arches_querysets-0.1.0/arches_querysets/locale/.gitkeep +0 -0
- arches_querysets-0.1.0/arches_querysets/lookups.py +116 -0
- arches_querysets-0.1.0/arches_querysets/management/__init__.py +0 -0
- arches_querysets-0.1.0/arches_querysets/management/commands/__init__.py +0 -0
- arches_querysets-0.1.0/arches_querysets/media/css/themes/_project.scss +6 -0
- arches_querysets-0.1.0/arches_querysets/media/img/favicon.png +0 -0
- arches_querysets-0.1.0/arches_querysets/media/js/reports/default.js +14 -0
- arches_querysets-0.1.0/arches_querysets/migrations/0001_initial.py +48 -0
- arches_querysets-0.1.0/arches_querysets/migrations/__init__.py +0 -0
- arches_querysets-0.1.0/arches_querysets/models.py +462 -0
- arches_querysets-0.1.0/arches_querysets/querysets.py +409 -0
- arches_querysets-0.1.0/arches_querysets/rest_framework/generic_views.py +28 -0
- arches_querysets-0.1.0/arches_querysets/rest_framework/permissions.py +18 -0
- arches_querysets-0.1.0/arches_querysets/rest_framework/serializers.py +477 -0
- arches_querysets-0.1.0/arches_querysets/rest_framework/view_mixins.py +201 -0
- arches_querysets-0.1.0/arches_querysets/search_components/__init__.py +0 -0
- arches_querysets-0.1.0/arches_querysets/search_indexes/__init__.py +0 -0
- arches_querysets-0.1.0/arches_querysets/settings.py +463 -0
- arches_querysets-0.1.0/arches_querysets/src/arches_querysets/declarations.d.ts +4 -0
- arches_querysets-0.1.0/arches_querysets/system_settings/readme.txt +8 -0
- arches_querysets-0.1.0/arches_querysets/urls.py +27 -0
- arches_querysets-0.1.0/arches_querysets/utils/datatype_transforms.py +267 -0
- arches_querysets-0.1.0/arches_querysets/utils/models.py +125 -0
- arches_querysets-0.1.0/arches_querysets/wsgi.py +39 -0
- arches_querysets-0.1.0/arches_querysets.egg-info/PKG-INFO +146 -0
- arches_querysets-0.1.0/arches_querysets.egg-info/SOURCES.txt +69 -0
- arches_querysets-0.1.0/arches_querysets.egg-info/dependency_links.txt +1 -0
- arches_querysets-0.1.0/arches_querysets.egg-info/requires.txt +10 -0
- arches_querysets-0.1.0/arches_querysets.egg-info/top_level.txt +1 -0
- arches_querysets-0.1.0/eslint.config.mjs +43 -0
- arches_querysets-0.1.0/gettext.config.js +43 -0
- arches_querysets-0.1.0/manage.py +30 -0
- arches_querysets-0.1.0/nodemon.json +5 -0
- arches_querysets-0.1.0/package-lock.json +20658 -0
- arches_querysets-0.1.0/package.json +34 -0
- arches_querysets-0.1.0/pyproject.toml +51 -0
- arches_querysets-0.1.0/setup.cfg +4 -0
- arches_querysets-0.1.0/tests/__init__.py +0 -0
- arches_querysets-0.1.0/tests/test_settings.py +75 -0
- arches_querysets-0.1.0/tsconfig.json +21 -0
- arches_querysets-0.1.0/vitest.config.mts +72 -0
- arches_querysets-0.1.0/vitest.setup.mts +13 -0
- arches_querysets-0.1.0/webpack/README.md +23 -0
- arches_querysets-0.1.0/webpack/webpack-utils/build-filepath-lookup.js +51 -0
- arches_querysets-0.1.0/webpack/webpack-utils/find-file.js +24 -0
- arches_querysets-0.1.0/webpack/webpack.common.js +516 -0
- arches_querysets-0.1.0/webpack/webpack.config.dev.js +51 -0
- arches_querysets-0.1.0/webpack/webpack.config.prod.js +40 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[run]
|
|
2
|
+
source =
|
|
3
|
+
arches_querysets/
|
|
4
|
+
|
|
5
|
+
omit =
|
|
6
|
+
*/python?.?/*
|
|
7
|
+
*/migrations/*
|
|
8
|
+
*/settings*.py
|
|
9
|
+
*/urls.py
|
|
10
|
+
*/wsgi.py
|
|
11
|
+
*/hosts.py
|
|
12
|
+
*/celery.py
|
|
13
|
+
*/__init__.py
|
|
14
|
+
|
|
15
|
+
data_file = coverage/python/.coverage
|
|
16
|
+
|
|
17
|
+
[report]
|
|
18
|
+
show_missing = true
|
|
19
|
+
|
|
20
|
+
exclude_lines =
|
|
21
|
+
pragma: no cover
|
|
22
|
+
|
|
23
|
+
[html]
|
|
24
|
+
directory = coverage/python/htmlcov
|
|
25
|
+
|
|
26
|
+
[xml]
|
|
27
|
+
output = coverage/python/coverage.xml
|
|
28
|
+
|
|
29
|
+
[json]
|
|
30
|
+
output = coverage/python/coverage.json
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
name: 'Build and test branch'
|
|
2
|
+
description: 'Builds and tests a branch'
|
|
3
|
+
inputs:
|
|
4
|
+
branch-type:
|
|
5
|
+
description: 'String denoting either `target` or `feature` branch'
|
|
6
|
+
required: true
|
|
7
|
+
project-name:
|
|
8
|
+
description: 'String denoting the name of the project'
|
|
9
|
+
required: true
|
|
10
|
+
secrets:
|
|
11
|
+
description: 'Secrets from main.yml as JSON'
|
|
12
|
+
runs:
|
|
13
|
+
using: 'composite'
|
|
14
|
+
steps:
|
|
15
|
+
- name: Install Java, GDAL, and other system dependencies
|
|
16
|
+
run: |
|
|
17
|
+
sudo apt update
|
|
18
|
+
sudo apt-get install libxml2-dev libpq-dev openjdk-8-jdk libgdal-dev libxslt-dev
|
|
19
|
+
echo Postgres and ES dependencies installed
|
|
20
|
+
shell: bash
|
|
21
|
+
|
|
22
|
+
- name: Set up Elasticsearch
|
|
23
|
+
uses: ankane/setup-elasticsearch@v1
|
|
24
|
+
with:
|
|
25
|
+
elasticsearch-version: 8
|
|
26
|
+
|
|
27
|
+
- name: Install Python packages
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
pip install '.[dev]'
|
|
31
|
+
echo Python packages installed
|
|
32
|
+
shell: bash
|
|
33
|
+
|
|
34
|
+
- name: Ensure frontend configuration files exist
|
|
35
|
+
run: |
|
|
36
|
+
python manage.py check
|
|
37
|
+
shell: bash
|
|
38
|
+
|
|
39
|
+
- name: Install Arches applications
|
|
40
|
+
uses: ./.github/actions/install-arches-applications
|
|
41
|
+
with:
|
|
42
|
+
secrets: ${{ inputs.secrets }}
|
|
43
|
+
|
|
44
|
+
- name: Install frontend dependencies
|
|
45
|
+
run: |
|
|
46
|
+
npm install
|
|
47
|
+
shell: bash
|
|
48
|
+
|
|
49
|
+
- name: Webpack frontend files
|
|
50
|
+
run: |
|
|
51
|
+
npm run build_test
|
|
52
|
+
shell: bash
|
|
53
|
+
|
|
54
|
+
- name: Check frontend formatting with prettier
|
|
55
|
+
run: |
|
|
56
|
+
npm run prettier:check
|
|
57
|
+
shell: bash
|
|
58
|
+
|
|
59
|
+
- name: Check backend formatting with black
|
|
60
|
+
run: |
|
|
61
|
+
black . --check --exclude=node_modules
|
|
62
|
+
shell: bash
|
|
63
|
+
|
|
64
|
+
- name: Check line endings on all but ontology (.xml) files
|
|
65
|
+
run: |
|
|
66
|
+
! git ls-files --eol | grep -v '.xml' | grep 'w/crlf\|w/mixed'
|
|
67
|
+
shell: bash
|
|
68
|
+
|
|
69
|
+
# - name: Run frontend tests
|
|
70
|
+
# run: |
|
|
71
|
+
# npm run vitest
|
|
72
|
+
# mv coverage/frontend/coverage.xml ${{ inputs.branch-type }}_branch_frontend_coverage.xml
|
|
73
|
+
# shell: bash
|
|
74
|
+
|
|
75
|
+
- name: Check for missing migrations
|
|
76
|
+
run: |
|
|
77
|
+
python manage.py makemigrations --check
|
|
78
|
+
shell: bash
|
|
79
|
+
|
|
80
|
+
- name: Ensure previous Python coverage data is erased
|
|
81
|
+
run: |
|
|
82
|
+
coverage erase
|
|
83
|
+
shell: bash
|
|
84
|
+
|
|
85
|
+
- name: Run Python unit tests
|
|
86
|
+
run: |
|
|
87
|
+
python -W default::DeprecationWarning -m coverage run manage.py test tests --settings="tests.test_settings"
|
|
88
|
+
shell: bash
|
|
89
|
+
|
|
90
|
+
- name: Generate Python report coverage
|
|
91
|
+
run: |
|
|
92
|
+
coverage report
|
|
93
|
+
coverage json
|
|
94
|
+
mv coverage/python/coverage.json ${{ inputs.branch-type }}_branch_python_coverage.json
|
|
95
|
+
shell: bash
|
|
96
|
+
|
|
97
|
+
# - name: Upload frontend coverage report as artifact
|
|
98
|
+
# uses: actions/upload-artifact@v4
|
|
99
|
+
# with:
|
|
100
|
+
# name: ${{ inputs.branch-type }}-branch-frontend-coverage-report
|
|
101
|
+
# path: ${{ inputs.branch-type }}_branch_frontend_coverage.xml
|
|
102
|
+
# overwrite: true
|
|
103
|
+
|
|
104
|
+
- name: Upload Python coverage report as artifact
|
|
105
|
+
uses: actions/upload-artifact@v4
|
|
106
|
+
with:
|
|
107
|
+
name: ${{ inputs.branch-type }}-branch-python-coverage-report
|
|
108
|
+
path: ${{ inputs.branch-type }}_branch_python_coverage.json
|
|
109
|
+
overwrite: true
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: 'Install Arches Applications'
|
|
2
|
+
description: 'Manually edit this file to install all Arches Applications declared in settings.py, but not declared in `pyproject.toml`'
|
|
3
|
+
inputs:
|
|
4
|
+
secrets:
|
|
5
|
+
description: 'Secrets from main.yml as JSON'
|
|
6
|
+
runs:
|
|
7
|
+
using: 'composite'
|
|
8
|
+
steps:
|
|
9
|
+
|
|
10
|
+
# Manually add any ARCHES_APPLICATIONS to this file if not already declared in `pyproject.toml`.
|
|
11
|
+
# Below is a template for adding an application in a private repository.
|
|
12
|
+
# Be sure to delete the `no-op step` if adding when updating this file.
|
|
13
|
+
|
|
14
|
+
- name: No-op step to maintain workflow structure
|
|
15
|
+
run: echo "No-op step"
|
|
16
|
+
shell: bash
|
|
17
|
+
|
|
18
|
+
# - name: Checkout ${my_arches_application_name}
|
|
19
|
+
# uses: actions/checkout@v4
|
|
20
|
+
# with:
|
|
21
|
+
# repository: ${my_arches_application_repository}/${my_arches_application_name}
|
|
22
|
+
# token: ${{ fromJSON(inputs.secrets).${my_github_personal_access_token} }}
|
|
23
|
+
# path: ${my_arches_application_name}
|
|
24
|
+
|
|
25
|
+
# - name: Install ${my_arches_application_name}
|
|
26
|
+
# run: |
|
|
27
|
+
# pip install ./${my_arches_application_name}
|
|
28
|
+
# echo ${my_arches_application_name} installed
|
|
29
|
+
# shell: bash
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
# push: -- just run on PRs for now
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build_target_branch:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
services:
|
|
13
|
+
postgres:
|
|
14
|
+
image: postgis/postgis:13-3.0
|
|
15
|
+
env:
|
|
16
|
+
POSTGRES_PASSWORD: postgis
|
|
17
|
+
POSTGRES_DB: arches_querysets
|
|
18
|
+
ports:
|
|
19
|
+
- 5432:5432
|
|
20
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
21
|
+
|
|
22
|
+
strategy:
|
|
23
|
+
fail-fast: false
|
|
24
|
+
matrix:
|
|
25
|
+
python-version: ["3.13"]
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: ${{ matrix.python-version }}
|
|
34
|
+
check-latest: true
|
|
35
|
+
|
|
36
|
+
- name: Checkout into target branch
|
|
37
|
+
uses: actions/checkout@v4
|
|
38
|
+
with:
|
|
39
|
+
repository: ${{ github.repository }}
|
|
40
|
+
ref: ${{ github.event.pull_request.base.ref }}
|
|
41
|
+
path: .
|
|
42
|
+
|
|
43
|
+
- name: Build and test branch
|
|
44
|
+
uses: ./.github/actions/build-and-test-branch
|
|
45
|
+
with:
|
|
46
|
+
secrets: ${{ toJSON(secrets) }}
|
|
47
|
+
project-name: 'arches_querysets'
|
|
48
|
+
branch-type: 'target'
|
|
49
|
+
|
|
50
|
+
build_feature_branch:
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
|
|
53
|
+
services:
|
|
54
|
+
postgres:
|
|
55
|
+
image: postgis/postgis:13-3.0
|
|
56
|
+
env:
|
|
57
|
+
POSTGRES_PASSWORD: postgis
|
|
58
|
+
POSTGRES_DB: arches_querysets
|
|
59
|
+
ports:
|
|
60
|
+
- 5432:5432
|
|
61
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
62
|
+
|
|
63
|
+
strategy:
|
|
64
|
+
fail-fast: false
|
|
65
|
+
matrix:
|
|
66
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
67
|
+
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@v4
|
|
70
|
+
|
|
71
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
72
|
+
uses: actions/setup-python@v5
|
|
73
|
+
with:
|
|
74
|
+
python-version: ${{ matrix.python-version }}
|
|
75
|
+
check-latest: true
|
|
76
|
+
|
|
77
|
+
- name: Checkout into feature branch
|
|
78
|
+
uses: actions/checkout@v4
|
|
79
|
+
with:
|
|
80
|
+
repository: ${{ github.repository }}
|
|
81
|
+
ref: ${{ github.ref }}
|
|
82
|
+
path: .
|
|
83
|
+
|
|
84
|
+
- name: Build and test branch
|
|
85
|
+
uses: ./.github/actions/build-and-test-branch
|
|
86
|
+
with:
|
|
87
|
+
secrets: ${{ toJSON(secrets) }}
|
|
88
|
+
project-name: 'arches_querysets'
|
|
89
|
+
branch-type: 'feature'
|
|
90
|
+
|
|
91
|
+
# check_frontend_coverage:
|
|
92
|
+
# runs-on: ubuntu-latest
|
|
93
|
+
# needs: [build_feature_branch, build_target_branch]
|
|
94
|
+
# steps:
|
|
95
|
+
# - uses: actions/checkout@v4
|
|
96
|
+
|
|
97
|
+
# - name: Set up Python
|
|
98
|
+
# uses: actions/setup-python@v5
|
|
99
|
+
# with:
|
|
100
|
+
# python-version: '3.x' # Use the latest available version
|
|
101
|
+
# check-latest: true
|
|
102
|
+
|
|
103
|
+
# - name: Download feature branch frontend coverage report artifact
|
|
104
|
+
# uses: actions/download-artifact@v4
|
|
105
|
+
# with:
|
|
106
|
+
# name: feature-branch-frontend-coverage-report
|
|
107
|
+
# path: .
|
|
108
|
+
|
|
109
|
+
# - name: Extract feature branch frontend coverage data
|
|
110
|
+
# shell: pwsh
|
|
111
|
+
# run: |
|
|
112
|
+
# [xml]$xml = Get-Content feature_branch_frontend_coverage.xml
|
|
113
|
+
# $metrics = $xml.coverage.project.metrics
|
|
114
|
+
|
|
115
|
+
# $statements = [double]$metrics.statements
|
|
116
|
+
# $coveredstatements = [double]$metrics.coveredstatements
|
|
117
|
+
# $conditionals = [double]$metrics.conditionals
|
|
118
|
+
# $coveredconditionals = [double]$metrics.coveredconditionals
|
|
119
|
+
# $methods = [double]$metrics.methods
|
|
120
|
+
# $coveredmethods = [double]$metrics.coveredmethods
|
|
121
|
+
# $elements = [double]$metrics.elements
|
|
122
|
+
# $coveredelements = [double]$metrics.coveredelements
|
|
123
|
+
|
|
124
|
+
# $statement_coverage = 0.0
|
|
125
|
+
# $conditional_coverage = 0.0
|
|
126
|
+
# $method_coverage = 0.0
|
|
127
|
+
# $element_coverage = 0.0
|
|
128
|
+
|
|
129
|
+
# if ($statements -gt 0) {
|
|
130
|
+
# $statement_coverage = ($coveredstatements / $statements) * 100
|
|
131
|
+
# }
|
|
132
|
+
# if ($conditionals -gt 0) {
|
|
133
|
+
# $conditional_coverage = ($coveredconditionals / $conditionals) * 100
|
|
134
|
+
# }
|
|
135
|
+
# if ($methods -gt 0) {
|
|
136
|
+
# $method_coverage = ($coveredmethods / $methods) * 100
|
|
137
|
+
# }
|
|
138
|
+
# if ($elements -gt 0) {
|
|
139
|
+
# $element_coverage = ($coveredelements / $elements) * 100
|
|
140
|
+
# }
|
|
141
|
+
|
|
142
|
+
# $nonZeroCount = 0
|
|
143
|
+
# $totalCoverage = 0.0
|
|
144
|
+
|
|
145
|
+
# if ($statements -gt 0) { $nonZeroCount++; $totalCoverage += $statement_coverage }
|
|
146
|
+
# if ($conditionals -gt 0) { $nonZeroCount++; $totalCoverage += $conditional_coverage }
|
|
147
|
+
# if ($methods -gt 0) { $nonZeroCount++; $totalCoverage += $method_coverage }
|
|
148
|
+
# if ($elements -gt 0) { $nonZeroCount++; $totalCoverage += $element_coverage }
|
|
149
|
+
|
|
150
|
+
# $feature_branch_frontend_coverage = 0.0
|
|
151
|
+
# if ($nonZeroCount -gt 0) {
|
|
152
|
+
# $feature_branch_frontend_coverage = $totalCoverage / $nonZeroCount
|
|
153
|
+
# }
|
|
154
|
+
|
|
155
|
+
# Write-Output "feature_branch_frontend_coverage=$feature_branch_frontend_coverage" | Out-File -Append $env:GITHUB_ENV
|
|
156
|
+
|
|
157
|
+
# - name: Download target branch frontend coverage report artifact
|
|
158
|
+
# continue-on-error: true
|
|
159
|
+
# uses: actions/download-artifact@v4
|
|
160
|
+
# with:
|
|
161
|
+
# name: target-branch-frontend-coverage-report
|
|
162
|
+
# path: .
|
|
163
|
+
|
|
164
|
+
# - name: Check if target branch frontend coverage report artifact exists
|
|
165
|
+
# run: |
|
|
166
|
+
# if [ -f target_branch_frontend_coverage.xml ]; then
|
|
167
|
+
# echo "target_branch_frontend_coverage_artifact_exists=true" >> $GITHUB_ENV
|
|
168
|
+
# else
|
|
169
|
+
# echo "Target branch coverage not found. Defaulting to 0% coverage."
|
|
170
|
+
# echo "target_branch_frontend_coverage_artifact_exists=false" >> $GITHUB_ENV
|
|
171
|
+
# fi
|
|
172
|
+
|
|
173
|
+
# - name: Extract target branch frontend coverage data
|
|
174
|
+
# if: ${{ env.target_branch_frontend_coverage_artifact_exists == 'true' }}
|
|
175
|
+
# shell: pwsh
|
|
176
|
+
# run: |
|
|
177
|
+
# [xml]$xml = Get-Content target_branch_frontend_coverage.xml
|
|
178
|
+
# $metrics = $xml.coverage.project.metrics
|
|
179
|
+
|
|
180
|
+
# $statements = [double]$metrics.statements
|
|
181
|
+
# $coveredstatements = [double]$metrics.coveredstatements
|
|
182
|
+
# $conditionals = [double]$metrics.conditionals
|
|
183
|
+
# $coveredconditionals = [double]$metrics.coveredconditionals
|
|
184
|
+
# $methods = [double]$metrics.methods
|
|
185
|
+
# $coveredmethods = [double]$metrics.coveredmethods
|
|
186
|
+
# $elements = [double]$metrics.elements
|
|
187
|
+
# $coveredelements = [double]$metrics.coveredelements
|
|
188
|
+
|
|
189
|
+
# $statement_coverage = 0.0
|
|
190
|
+
# $conditional_coverage = 0.0
|
|
191
|
+
# $method_coverage = 0.0
|
|
192
|
+
# $element_coverage = 0.0
|
|
193
|
+
|
|
194
|
+
# if ($statements -gt 0) {
|
|
195
|
+
# $statement_coverage = ($coveredstatements / $statements) * 100
|
|
196
|
+
# }
|
|
197
|
+
# if ($conditionals -gt 0) {
|
|
198
|
+
# $conditional_coverage = ($coveredconditionals / $conditionals) * 100
|
|
199
|
+
# }
|
|
200
|
+
# if ($methods -gt 0) {
|
|
201
|
+
# $method_coverage = ($coveredmethods / $methods) * 100
|
|
202
|
+
# }
|
|
203
|
+
# if ($elements -gt 0) {
|
|
204
|
+
# $element_coverage = ($coveredelements / $elements) * 100
|
|
205
|
+
# }
|
|
206
|
+
|
|
207
|
+
# $nonZeroCount = 0
|
|
208
|
+
# $totalCoverage = 0.0
|
|
209
|
+
|
|
210
|
+
# if ($statements -gt 0) { $nonZeroCount++; $totalCoverage += $statement_coverage }
|
|
211
|
+
# if ($conditionals -gt 0) { $nonZeroCount++; $totalCoverage += $conditional_coverage }
|
|
212
|
+
# if ($methods -gt 0) { $nonZeroCount++; $totalCoverage += $method_coverage }
|
|
213
|
+
# if ($elements -gt 0) { $nonZeroCount++; $totalCoverage += $element_coverage }
|
|
214
|
+
|
|
215
|
+
# $target_branch_frontend_coverage = 0.0
|
|
216
|
+
# if ($nonZeroCount -gt 0) {
|
|
217
|
+
# $target_branch_frontend_coverage = $totalCoverage / $nonZeroCount
|
|
218
|
+
# }
|
|
219
|
+
|
|
220
|
+
# Write-Output "target_branch_frontend_coverage=$target_branch_frontend_coverage" | Out-File -Append $env:GITHUB_ENV
|
|
221
|
+
|
|
222
|
+
# - name: Compare frontend feature coverage with target coverage
|
|
223
|
+
# if: github.event_name == 'pull_request'
|
|
224
|
+
# run: |
|
|
225
|
+
# feature_branch_frontend_coverage=${feature_branch_frontend_coverage}
|
|
226
|
+
# target_branch_frontend_coverage=${target_branch_frontend_coverage:-0.0}
|
|
227
|
+
|
|
228
|
+
# # Compare feature coverage with target coverage using floating-point comparison
|
|
229
|
+
# if awk -v feature="$feature_branch_frontend_coverage" -v target="$target_branch_frontend_coverage" 'BEGIN { exit (feature < target) ? 0 : 1 }'; then
|
|
230
|
+
# echo "Coverage decreased from $target_branch_frontend_coverage% to $feature_branch_frontend_coverage%. Please add or update tests to increase coverage."
|
|
231
|
+
# exit 1
|
|
232
|
+
# else
|
|
233
|
+
# echo "Feature branch coverage ($feature_branch_frontend_coverage%) >= Target branch coverage ($target_branch_frontend_coverage%)."
|
|
234
|
+
# fi
|
|
235
|
+
|
|
236
|
+
check_python_coverage:
|
|
237
|
+
runs-on: ubuntu-latest
|
|
238
|
+
needs: [build_feature_branch, build_target_branch]
|
|
239
|
+
steps:
|
|
240
|
+
- uses: actions/checkout@v4
|
|
241
|
+
|
|
242
|
+
- name: Set up Python
|
|
243
|
+
uses: actions/setup-python@v5
|
|
244
|
+
with:
|
|
245
|
+
python-version: '3.x' # Use the latest available version
|
|
246
|
+
check-latest: true
|
|
247
|
+
|
|
248
|
+
- name: Download feature branch Python coverage report artifact
|
|
249
|
+
uses: actions/download-artifact@v4
|
|
250
|
+
with:
|
|
251
|
+
name: feature-branch-python-coverage-report
|
|
252
|
+
path: .
|
|
253
|
+
|
|
254
|
+
- name: Download target branch Python coverage report artifact
|
|
255
|
+
uses: actions/download-artifact@v4
|
|
256
|
+
with:
|
|
257
|
+
name: target-branch-python-coverage-report
|
|
258
|
+
path: .
|
|
259
|
+
|
|
260
|
+
- name: Compare Python feature coverage with target coverage
|
|
261
|
+
if: github.event_name == 'pull_request'
|
|
262
|
+
run: |
|
|
263
|
+
feature_branch_python_coverage=$(cat feature_branch_python_coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
|
|
264
|
+
target_branch_python_coverage=$(cat target_branch_python_coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
|
|
265
|
+
|
|
266
|
+
# Compare feature coverage with target coverage using floating-point comparison
|
|
267
|
+
if awk -v feature="$feature_branch_python_coverage" -v target="$target_branch_python_coverage" 'BEGIN { exit (feature < target) ? 0 : 1 }'; then
|
|
268
|
+
echo "Coverage decreased from $target_branch_python_coverage% to $feature_branch_python_coverage%. Please add or update tests to increase coverage."
|
|
269
|
+
exit 1
|
|
270
|
+
else
|
|
271
|
+
echo "Feature branch coverage ($feature_branch_python_coverage%) >= Target branch coverage ($target_branch_python_coverage%)."
|
|
272
|
+
fi
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
*.pyc
|
|
2
|
+
*.log
|
|
3
|
+
node_modules
|
|
4
|
+
coverage/
|
|
5
|
+
arches_querysets/logs
|
|
6
|
+
arches_querysets/export_deliverables
|
|
7
|
+
arches_querysets/cantaloupe/*
|
|
8
|
+
arches_querysets/staticfiles
|
|
9
|
+
arches_querysets/media/packages
|
|
10
|
+
arches_querysets/media/build/
|
|
11
|
+
arches_querysets/uploadedfiles/*
|
|
12
|
+
arches_querysets/settings_local.py
|
|
13
|
+
webpack-stats.json
|
|
14
|
+
.vscode/
|
|
15
|
+
*.egg-info
|
|
16
|
+
.DS_STORE
|
|
17
|
+
CACHE
|
|
18
|
+
.tsconfig-paths.json
|
|
19
|
+
.frontend-configuration-settings.json
|
|
20
|
+
|
|
21
|
+
# Packaging
|
|
22
|
+
build/
|
|
23
|
+
dist
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
repos:
|
|
3
|
+
|
|
4
|
+
- repo: meta
|
|
5
|
+
hooks:
|
|
6
|
+
- id: check-hooks-apply
|
|
7
|
+
|
|
8
|
+
- repo: https://github.com/psf/black
|
|
9
|
+
rev: 24.4.2
|
|
10
|
+
hooks:
|
|
11
|
+
- id: black
|
|
12
|
+
args: [--quiet]
|
|
13
|
+
exclude: node_modules
|
|
14
|
+
|
|
15
|
+
- repo: local
|
|
16
|
+
hooks:
|
|
17
|
+
- id: prettier
|
|
18
|
+
name: prettier
|
|
19
|
+
entry: npm run prettier:fix
|
|
20
|
+
language: system
|
|
21
|
+
files: arches_querysets/src
|
|
22
|
+
- id: eslint
|
|
23
|
+
name: eslint
|
|
24
|
+
entry: npm run eslint:fix
|
|
25
|
+
language: system
|
|
26
|
+
files: arches_querysets/src
|
|
27
|
+
- id: typescript
|
|
28
|
+
name: typescript
|
|
29
|
+
entry: bash -c 'npm run ts:check'
|
|
30
|
+
language: system
|
|
31
|
+
types_or: [
|
|
32
|
+
"ts",
|
|
33
|
+
"vue",
|
|
34
|
+
]
|