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

2024-01-25 merge development --> staging #1140

Merged
merged 66 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
3e5b7d1
build: remove ref to script_domain (move to separate repo)
spwoodcock Jan 14, 2024
3cbaa95
docs: add CNAME for custom docs domain
spwoodcock Jan 14, 2024
fa562b2
build: move install.sh to fmtm-installer repo
spwoodcock Jan 14, 2024
0f7e855
ci: remove install script from pr labeller
spwoodcock Jan 14, 2024
359b682
docs: update info for using easy install script
spwoodcock Jan 14, 2024
f6c0243
build: add justfile to repo for basic commands (#1098)
spwoodcock Jan 15, 2024
6bc5eff
Merge branch 'development' of https://github.com/hotosm/fmtm into dev…
spwoodcock Jan 14, 2024
d4b20b1
refactor: organization routes/crud/schemas to use best practice (#1096)
spwoodcock Jan 16, 2024
f8cf65f
feat: add basic user role support to backend (#1094)
spwoodcock Jan 17, 2024
da5c95f
refactor: fix all pre-commit.ci linting errors (#1101)
spwoodcock Jan 17, 2024
c03f908
fix: editable vector layer in ol for project creation (#1102)
NSUWAL123 Jan 17, 2024
da99c41
fix: limit project area during create (#1109)
NSUWAL123 Jan 18, 2024
0ce89c9
fix: use organization_manager table for org admins
spwoodcock Jan 18, 2024
1322cd1
Merge pull request #1113 from hotosm/fix/use-org-admin-table
nrjadkry Jan 18, 2024
8ad3ec1
fix (newProjectDetails): searchInput - width increased (#1111)
NSUWAL123 Jan 18, 2024
1c5420b
fix (frontend): projection validity check using coordinates of extent…
NSUWAL123 Jan 18, 2024
ee8f1a8
docs: link to docs.hotosm.org for versioning info
spwoodcock Jan 18, 2024
c5b1cad
Merge branch 'development' of https://github.com/hotosm/fmtm into dev…
spwoodcock Jan 18, 2024
670c455
refactor: remove variable from docker install script
spwoodcock Jan 18, 2024
e67aeaa
ci: add py310 version to black code formatter
spwoodcock Jan 18, 2024
36af459
docs: add link to pre-commit info in docs
spwoodcock Jan 18, 2024
ed95c47
refactor: renaming for consistency with database (#1114)
spwoodcock Jan 18, 2024
4d7ba07
docs: update info about interactive api debugging port
spwoodcock Jan 18, 2024
0c01424
docs: add timestamp to doc pages via plugin
spwoodcock Jan 18, 2024
0db23d1
build: add git-revision-date-localized plugin to docs group
spwoodcock Jan 18, 2024
1a9aabc
ci: docs build use image from gh-workflows
spwoodcock Jan 18, 2024
b0bb274
build: upgrade osm-fieldwork-->0.4.1, osm-rawdata-->0.2.6
spwoodcock Jan 18, 2024
5704fe1
Fix condition in elif statement for Feature type detection
Jan 19, 2024
a3b2fc7
Merge pull request #1119 from hotosm/fix-data-extract
nrjadkry Jan 19, 2024
60399ca
Merge pull request #1117 from hotosm/build/upgrade-osm-pkgs
nrjadkry Jan 19, 2024
512b130
docs: update markdown links from inline to reference (footnote) style…
cordovez Jan 19, 2024
650f7c3
refactor: fix linting errors in project_crud
spwoodcock Jan 19, 2024
b44ebee
feat: paginated submissions by project (#1110)
Sujanadh Jan 19, 2024
10c31fc
fix: tile archive download for projects
spwoodcock Jan 19, 2024
126f80a
refactor: refactor odk appuser + qrcode function naming
spwoodcock Jan 19, 2024
1033e0f
refactor: add metadata_username to odk qr code as test
spwoodcock Jan 19, 2024
c74855e
docs: use code of conduct on docs.hotosm.org
spwoodcock Jan 21, 2024
e97ef2c
fix divide by square on multipolygon geojson
Jan 22, 2024
6b32142
Merge pull request #1125 from hotosm/fix-square-split
nrjadkry Jan 22, 2024
66b3607
build: upgrade fmtm-splitter v0.2.6 --> v1.0.0rc0 (#1122)
spwoodcock Jan 22, 2024
148de05
feat: add test coverage metric (#1129)
spwoodcock Jan 22, 2024
15345c5
docs: add coverage link to docs page sidebar
spwoodcock Jan 22, 2024
aa2680d
hotfix: geom type not populated with feature type
Jan 23, 2024
749431f
Merge pull request #1130 from hotosm/fix-geom-type
nrjadkry Jan 23, 2024
67a099f
ci: add simple smoke test to frontend deploy
spwoodcock Jan 23, 2024
36ae5d4
feat: organisation approval and admin endpoints (#1126)
nrjadkry Jan 23, 2024
8349c8c
ci: fix frontend smoke test with .env file
spwoodcock Jan 23, 2024
3060f19
refactor: update project dashboard to use deps functions (#1127)
Sujanadh Jan 23, 2024
9a9d728
feat: paginated submissions per task (#1128)
Sujanadh Jan 23, 2024
17ae34d
fix: Depends usage for task_submissions endpoint
spwoodcock Jan 23, 2024
0925773
build: replace project.private field with project.visibility enum (#1…
spwoodcock Jan 23, 2024
ebb07cd
ci: add sleep 5 for frontend smoke test dev startup
spwoodcock Jan 23, 2024
f3bea80
ci: replace black with ruff-format
spwoodcock Jan 24, 2024
d72b49f
build: update docker install script to handle root user
spwoodcock Jan 24, 2024
307b8ca
docs: add info about using pyright for type checking
spwoodcock Jan 24, 2024
35f5c11
ci: add tool.pyright config section to pyproject.toml
spwoodcock Jan 24, 2024
69a1a19
fix: use optional params for extra AuthUser items
spwoodcock Jan 24, 2024
c42af08
refactor: fix return type for organisation url validator
spwoodcock Jan 24, 2024
d7f2075
feat: added withcredential to include cookies on organization list api
varun2948 Jan 25, 2024
fbcbca1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 25, 2024
bb8b2ce
Merge pull request #1137 from hotosm/feat-organization-cookie
varun2948 Jan 25, 2024
ecdf41a
build: add deployment container replicas and resource constraints (#1…
spwoodcock Jan 25, 2024
c8246ce
feat: endpoint to return count of validated and mapped tasks (#1138)
Sujanadh Jan 25, 2024
b382fde
feat: add AOI editing to map during project creation (#1135)
NSUWAL123 Jan 25, 2024
4c12cc3
refactor(frontend): use absolute (aliased) imports over relative impo…
spwoodcock Jan 25, 2024
c8ed194
refactor: remove withCredentials from org endpoint (use interceptor)
spwoodcock Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"frontend":
- any: ["src/frontend/**/*", "!src/frontend/public/install-fmtm.sh"]
- "src/frontend/**/*"
"backend":
- "src/backend/**/*"
"devops":
- ".github/**/*"
- "nginx/**/*"
- "scripts/**/*"
- "src/frontend/public/install-fmtm.sh"
- "docker-*.yml"
- "**/Dockerfile"
- "**/*.dockerfile"
- "**/*entrypoint.sh"
- "Justfile"
"migration":
- "src/backend/migrations/**/*"
"documentation":
Expand Down
36 changes: 30 additions & 6 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,32 @@ on:

jobs:
pytest:
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@1.4.5
with:
image_name: ghcr.io/${{ github.repository }}/backend
build_context: src/backend
pre_command: docker compose up -d proxy && docker compose exec api /app-entrypoint.sh
compose_service: api
compose_command: pytest
tag_override: ci-${{ github.ref_name }}
coverage: true
secrets: inherit

frontend-tests:
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@1.4.5
with:
working_dir: src/frontend

backend-build:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
needs: [pytest]
with:
context: src/backend
build_target: prod
image_name: ghcr.io/${{ github.repository }}/backend

frontend-build:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
needs: [frontend-tests]
with:
context: src/frontend
Expand Down Expand Up @@ -118,14 +119,37 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create .env file
run: |
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
echo "Downloading envsubst"
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst

echo "Substituing variables from .env.example --> .env"
./envsubst < .env.example > .env

- name: Frontend smoke test
run: echo "Not implemented"
run: |
if docker compose up --detach \
--no-deps --wait --wait-timeout 30 \
ui
then
docker compose logs ui
echo "Sleeping 5 seconds to wait for dev server"
sleep 5
curl --fail http://localhost:7051 || exit 1
else
echo "Application not healthy after 30s. Exiting."
docker compose logs ui
exit 1
fi

deploy-containers:
needs:
- smoke-test-backend
- smoke-test-frontend
uses: hotosm/gh-workflows/.github/workflows/remote_deploy.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/remote_deploy.yml@1.4.5
with:
environment: ${{ github.ref_name }}
docker_compose_file: "docker-compose.${{ github.ref_name }}.yml"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_ci_img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
backend-ci-build:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
with:
context: src/backend
build_target: ci
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_odk_imgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
build-odkcentral:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
with:
context: odkcentral/api
image_tags: |
Expand All @@ -26,7 +26,7 @@ jobs:
# multi_arch: true

build-odkcentral-ui:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
with:
context: odkcentral/ui
image_tags: |
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/build_proxy_imgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build-cert-init-main:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
with:
context: nginx
build_target: certs-init-main
Expand All @@ -21,7 +21,7 @@ jobs:
multi_arch: true

build-cert-init-dev:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
with:
context: nginx
build_target: certs-init-development
Expand All @@ -33,7 +33,7 @@ jobs:
multi_arch: true

build-proxy-main:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
with:
context: nginx
build_target: main
Expand All @@ -43,19 +43,8 @@ jobs:
NGINX_TAG=${{ vars.NGINX_TAG }}
multi_arch: true

build-proxy-main-plus-script:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
with:
context: nginx
build_target: main-plus-script
image_tags: |
"ghcr.io/${{ github.repository }}/proxy:main-plus-script"
extra_build_args: |
NGINX_TAG=${{ vars.NGINX_TAG }}
multi_arch: true

build-proxy-dev:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
with:
context: nginx
build_target: development
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@ on:

jobs:
build_doxygen:
uses: hotosm/gh-workflows/.github/workflows/doxygen_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/doxygen_build.yml@1.4.5
with:
output_path: docs/apidocs

build_openapi_json:
uses: hotosm/gh-workflows/.github/workflows/openapi_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/openapi_build.yml@1.4.5
with:
image: ghcr.io/${{ github.repository }}/backend:ci-${{ github.ref_name }}
example_env_file_path: ".env.example"
output_path: docs/openapi.json

publish_docs:
uses: hotosm/gh-workflows/.github/workflows/mkdocs_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/mkdocs_build.yml@1.4.5
needs:
- build_doxygen
- build_openapi_json
with:
image: ghcr.io/${{ github.repository }}/backend:ci-${{ github.ref_name }}
doxygen: true
openapi: true
2 changes: 1 addition & 1 deletion .github/workflows/pr_test_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
pytest:
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@1.4.5
with:
image_name: ghcr.io/${{ github.repository }}/backend
build_context: src/backend
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_test_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ on:

jobs:
frontend-tests:
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@1.4.5
with:
working_dir: src/frontend
2 changes: 1 addition & 1 deletion .github/workflows/tag_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
backend-build:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.4.5
with:
context: src/backend
build_target: prod
Expand Down
47 changes: 33 additions & 14 deletions .github/workflows/tests/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- staging
- development

permissions:
contents: write

jobs:
run-tests:
runs-on: ubuntu-latest
Expand All @@ -20,6 +23,7 @@ jobs:
- name: Vars and Secrets to Env
env:
TAG_OVERRIDE: ${{ env.TAG_OVERRIDE || 'ci-development' }}
TARGET_OVERRIDE: ${{ env.TARGET_OVERRIDE || 'ci' }}
GIT_BRANCH: ${{ github.ref_name }}
VARS_CONTEXT: ${{ toJson(vars) }}
SECRETS_CONTEXT: ${{ toJson(secrets) }}
Expand All @@ -30,10 +34,6 @@ jobs:
# Parse JSON with multiline strings, using delimeter (Github specific)
to_envs() { jq -r "to_entries[] | \"\(.key)<<$delim\n\(.value)\n$delim\n\""; }

# Set all vars
echo "TAG_OVERRIDE=${TAG_OVERRIDE}" >> $GITHUB_ENV
echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_ENV

# Set VARS_CONTEXT if not null
if [ "${VARS_CONTEXT}" != "null" ]; then
echo "${VARS_CONTEXT}" | to_envs >> $GITHUB_ENV
Expand All @@ -51,18 +51,37 @@ jobs:
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst

# Check if .env.example exists
if [ -f .env.example ]; then
echo "Substituting variables from .env.example --> .env"
./envsubst < .env.example > .env
else
echo ".env.example not found, creating .env with GIT_BRANCH only"
echo "GIT_BRANCH=${GIT_BRANCH}" > .env
fi
echo "Substituting variables from .env.example --> .env"
./envsubst < .env.example > .env

# Set all vars
echo "TAG_OVERRIDE=${TAG_OVERRIDE}" >> .env
echo "TARGET_OVERRIDE=${TARGET_OVERRIDE}" >> .env
echo "GIT_BRANCH=${GIT_BRANCH}" >> .env

- name: Run Tests
- name: Run Tests With Coverage
run: |
docker compose up -d proxy
docker compose run api pytest
docker compose run --entrypoint "sh -c" \
--volume ${{ github.workspace }}/coverage:/tmp/coverage api \
"coverage run -m pytest \
&& coverage report && coverage html \
&& coverage-badge -o coverage.svg \
&& mv htmlcov/index.html /tmp/coverage/coverage.html \
&& mv coverage.svg /tmp/coverage/coverage.svg"

- name: Upload Coverage
run: |
# Checkout to gh-pages
git config user.name svchot
git config user.email sysadmin@hotosm.org
git checkout gh-pages

# Overwrite coverage index and badge
echo "Coverage dir contents:"
ls ${{ github.workspace }}/coverage
echo ""
mv ${{ github.workspace }}/coverage/* ${{ github.workspace }}

# Assess diff
git --no-pager diff
17 changes: 10 additions & 7 deletions .github/workflows/tests/test_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@ set -e
########################################

# TODO read personal access token
# read -p
# read -erp
# GITHUB_TOKEN=input
# Feed to act using -s flag: -s GITHUB_TOKEN=input_personal_access_token

# Run backend PyTest manually
docker compose build api
act pull_request -W .github/workflows/tests/pytest.yml \
-e .github/workflows/tests/pr_payload.json \
--var-file=.env --secret-file=.env
export TAG_OVERRIDE=ci
export TARGET_OVERRIDE=ci

# # PR Test Backend
# Includes image build, which fails due to registry auth
# NOTE: Includes image build, which fails due to registry auth
# act pull_request -W .github/workflows/pr_test_backend.yml \
# -e .github/workflows/tests/pr_payload.json \
# --var-file=.env --secret-file=.env

# Instead, run backend PyTest manually
TAG_OVERRIDE=ci TARGET_OVERRIDE=ci docker compose build api
act pull_request -W .github/workflows/tests/pytest.yml \
-e .github/workflows/tests/pr_payload.json \
--var-file=.env --secret-file=.env

# PR Test Frontend
act pull_request -W .github/workflows/pr_test_frontend.yml \
-e .github/workflows/tests/pr_payload.json \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ on:

jobs:
publish-docs-to-wiki:
uses: hotosm/gh-workflows/.github/workflows/wiki.yml@1.4.2
uses: hotosm/gh-workflows/.github/workflows/wiki.yml@1.4.5
with:
homepage_path: "wiki_redirect.md"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ temp_webmaps/Naivasha

# mkdocs
site
docs/apidocs
coverage
**/**/coverage*

# Bash install script
envsubst
Expand Down
Loading
Loading