diff --git a/.all-contributorsrc b/.all-contributorsrc index 5fc041cb79..52d341b13f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -23,6 +23,27 @@ "profile": "https://www.hotosm.org", "contributions": ["maintenance", "mentoring", "code", "review", "ideas"] }, + { + "login": "spwoodcock", + "name": "Sam", + "avatar_url": "https://avatars.githubusercontent.com/u/78538841?v=4", + "profile": "https://github.com/spwoodcock", + "contributions": ["code", "review", "infra", "ideas", "maintenance"] + }, + { + "login": "varun2948", + "name": "Deepak Pradhan (Varun)", + "avatar_url": "https://avatars.githubusercontent.com/u/37866666?v=4", + "profile": "https://github.com/varun2948", + "contributions": ["code", "ideas", "maintenance"] + }, + { + "login": "nrjadkry", + "name": "Niraj Adhikari", + "avatar_url": "https://avatars.githubusercontent.com/u/41701707?v=4", + "profile": "https://github.com/nrjadkry", + "contributions": ["code", "ideas", "maintenance"] + }, { "login": "krtonga", "name": "krtonga", @@ -30,13 +51,6 @@ "profile": "https://github.com/krtonga", "contributions": ["code", "doc", "tool", "ideas"] }, - { - "login": "spwoodcock", - "name": "Sam", - "avatar_url": "https://avatars.githubusercontent.com/u/78538841?v=4", - "profile": "https://github.com/spwoodcock", - "contributions": ["code", "review", "infra", "ideas"] - }, { "login": "petya-kangalova", "name": "Petya ", @@ -44,6 +58,13 @@ "profile": "https://www.hotosm.org/people/petya-kangalova/", "contributions": ["doc", "eventOrganizing", "ideas"] }, + { + "login": "Sujanadh", + "name": "Sujan Adhikari", + "avatar_url": "https://avatars.githubusercontent.com/u/109404840?v=4", + "profile": "https://github.com/Sujanadh", + "contributions": ["code"] + }, { "login": "Mudi-business", "name": "Mohamed Bakari Mohamed", @@ -51,6 +72,13 @@ "profile": "http://zanrevenue.org", "contributions": ["code"] }, + { + "login": "NSUWAL123", + "name": "Nishit Suwal", + "avatar_url": "https://avatars.githubusercontent.com/u/81785002?v=4", + "profile": "https://github.com/NSUWAL123", + "contributions": ["code"] + }, { "login": "biomassives", "name": "G. Willson", @@ -58,6 +86,20 @@ "profile": "https://www.scdhub.org", "contributions": ["code"] }, + { + "login": "JoltCode", + "name": "JoltCode", + "avatar_url": "https://avatars.githubusercontent.com/u/46378904?v=4", + "profile": "https://github.com/JoltCode", + "contributions": ["code"] + }, + { + "login": "neelimagoogly", + "name": "Neelima Mohanty", + "avatar_url": "https://avatars.githubusercontent.com/u/97789856?v=4", + "profile": "https://github.com/neelimagoogly", + "contributions": ["doc"] + }, { "login": "Ndacyayisenga-droid", "name": "Tayebwa Noah", @@ -92,15 +134,9 @@ "avatar_url": "https://avatars.githubusercontent.com/u/75838716?v=4", "profile": "https://github.com/Roseford", "contributions": ["doc"] - }, - { - "login": "neelimagoogly", - "name": "Neelima Mohanty", - "avatar_url": "https://avatars.githubusercontent.com/u/97789856?v=4", - "profile": "https://github.com/neelimagoogly", - "contributions": ["doc"] } ], "contributorsPerLine": 7, - "linkToUsage": true + "linkToUsage": true, + "commitType": "docs" } diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..90d3afaeeb --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,22 @@ +"frontend": + - "src/frontend/**/*" +"backend": + - "src/backend/**/*" +"devops": + - ".github/**/*" + - "scripts/**/*" + - "docker-*.yml" + - "**/Dockerfile" + - "**/*.dockerfile" + - "**/*entrypoint.sh" + - "josm/**/*" +"migration": + - "src/backend/migrations/**/*" +"documentation": + - "docs/**/*" + - "images/**/*" + - "mkdocs.yml" + - "README.md" + - "INSTALL.md" +"ODK": + - "odkcentral/**/*" diff --git a/.github/workflows/pr_label.yml b/.github/workflows/pr_label.yml new file mode 100644 index 0000000000..61f1a571e1 --- /dev/null +++ b/.github/workflows/pr_label.yml @@ -0,0 +1,14 @@ +name: PR Label + +on: + pull_request: + +jobs: + pr-label: + runs-on: ubuntu-latest + + steps: + - uses: actions/labeler@v3 + # Uses .github/labeler.yml definitions + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr_test.yml similarity index 96% rename from .github/workflows/pr.yml rename to .github/workflows/pr_test.yml index 2423749925..a35ba134c7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr_test.yml @@ -1,4 +1,4 @@ -name: PR +name: PR Tests on: pull_request: diff --git a/Makefile b/Makefile index 625a0df156..77aa982a3d 100644 --- a/Makefile +++ b/Makefile @@ -19,13 +19,14 @@ # All python source files # MDS := $(wildcard ./docs/*.md) MDS := \ - docs/DEV-1.-Getting-Started.md \ - docs/DEV-2.-Backend.md \ - docs/DEV-3.-Frontend.md \ - docs/DEV-4.-Database-Tips.md \ - docs/DEV-5.-Docker-Tips.md \ - docs/DEV-6.-Production-Deployment.md \ - docs/User-Manual-For-Project-Managers.md + docs/dev/Backend.md \ + docs/dev/Database-Tips.md \ + docs/dev/Deployment-Flow.md \ + docs/dev/Docker-Tips.md \ + docs/dev/Frontend.md \ + docs/dev/Production.md \ + docs/dev/Setup.md \ + docs/dev/Troubleshooting.md \ PDFS := $(MDS:.md=.pdf) diff --git a/README.md b/README.md index 25d38711f6..f447628161 100644 --- a/README.md +++ b/README.md @@ -261,24 +261,26 @@ Thanks goes to these wonderful people: Ivan Gayton
Ivan Gayton

📆 💻 👀 🤔 Rob Savoye
Rob Savoye

🚧 🧑‍🏫 💻 👀 🤔 - krtonga
krtonga

💻 📖 🔧 🤔 Sam
Sam

💻 👀 🚇 🤔 🚧 - Petya
Petya

📖 📋 🤔 - Niraj Adhikari
Niraj Adhikari

💻 🤔 🚧 Deepak Pradhan (Varun)
Deepak Pradhan (Varun)

💻 🤔 🚧 + Niraj Adhikari
Niraj Adhikari

💻 🤔 🚧 + krtonga
krtonga

💻 📖 🔧 🤔 + Petya
Petya

📖 📋 🤔 - Mohamed Bakari Mohamed
Mohamed Bakari Mohamed

💻 Sujan Adhikari
Sujan Adhikari

💻 - AugustHottie
AugustHottie

📖 - Ahmeed Etti-Balogun
Ahmeed Etti-Balogun

📖 - Uju
Uju

📖 - Neelima Mohanty
Neelima Mohanty

📖 + Mohamed Bakari Mohamed
Mohamed Bakari Mohamed

💻 + Nishit Suwal
Nishit Suwal

💻 G. Willson
G. Willson

💻 + JoltCode
JoltCode

💻 + Neelima Mohanty
Neelima Mohanty

📖 + Tayebwa Noah
Tayebwa Noah

📖 - Tayebwa Noah
Tayebwa Noah

📖 Mohammad Areeb
Mohammad Areeb

📖 + AugustHottie
AugustHottie

📖 + Ahmeed Etti-Balogun
Ahmeed Etti-Balogun

📖 + Uju
Uju

📖 diff --git a/docs/_Sidebar.md b/docs/_Sidebar.md index da5dce382a..ab57cfe195 100644 --- a/docs/_Sidebar.md +++ b/docs/_Sidebar.md @@ -24,4 +24,6 @@ [6. Production Deployment](https://github.com/hotosm/fmtm/wiki/dev/Production) -[7. Troubleshooting](https://github.com/hotosm/fmtm/wiki/dev/Troubleshooting) +[7. Deployment Flow](https://github.com/hotosm/fmtm/wiki/dev/Deployment-Flow) + +[8. Troubleshooting](https://github.com/hotosm/fmtm/wiki/dev/Troubleshooting) diff --git a/docs/dev/Deployment-Flow.md b/docs/dev/Deployment-Flow.md new file mode 100644 index 0000000000..6f6576a32f --- /dev/null +++ b/docs/dev/Deployment-Flow.md @@ -0,0 +1,60 @@ +# Deployment Flow + +These stages go in order, from local development, through to production deployment. + +## Local Development + +- Devs develop features on their local instance. +- Use `docker-compose.yml` setup for testing. +- Once feature and testing complete, make a PR to the `development` branch. + +## Development Deployment + +- Once a PR is approved, it is merged to `development`. +- This triggers a workflow to automatically deploy the code changes on the dev server. +- The purpose of this stage is for fast CI, + i.e. the developer sees their code in action quickly. + +## Staging Deployment + +- At a set interval (approx bi-weekly), + the updates made on `development` and frozen, tested, + patched (if required), and merged into the `staging` branch via PR. +- Once approved, the `staging` branch auto-deploys to the staging server. +- The purpose of this stage is to reguarly release versions of FMTM that + power users (and the project owner) can test. +- Anyone who doesn't mind occasional breakage is welcome to use this server publically. +- Hot fixes are also possible, if fixing some + functionality is critical for FMTM to function. + +## Production Deployment + +- The staging server instance is thoroughly tested + by the product owner, and bug reports filed. +- The release is hardened into longer interval (approx bi-monthly) production releases. +- A PR is made from `staging` to `main` branch. +- Once approved and the code merged, a Github **release** is made. +- A release is available on Github, + including all relevant release notes for what has been updated. +- The **release** will trigger the workflow to deploy to the production server. + +## Other: Feature Demo Releases + +- A feature demo release is a throwaway instance of FMTM with a particular purpose. +- Functionality is developed here for various reasons: + - Specific updates for a single project that won't be used elsewhere. + - Very fast updating of the server, + without interfering with the typical release flow. +- The key point is that these branch instances are **single use** + and will be **shut down** once the project has ended. +- The easiest approach is probably to: + - Create and login to a server. + - Run the bundled `feature-demo.sh` install script. +- Alternatively, a workflow can be made to auto-deploy: + - Triggering on a branch naming convention: `feature-demo/some-feature`. + - The user will have to enter an SSH key into the Gitlab secrets. + - The workflow will deploy to the server remotely + when the branch is pushed to. + - This approach is less preferred, as the user + requires write access to the Github repo, + but is under consideration. diff --git a/mkdocs.yml b/mkdocs.yml index 581bc51f6f..56a5b8ba38 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -72,6 +72,7 @@ nav: - Backend: dev/Backend.md - Frontend: dev/Frontend.md - Production Deployment: dev/Production.md + - Deployment Flow: dev/Deployment-Flow.md - Docker Tips: dev/Docker-Tips.md - Database Tips: dev/Database-Tips.md - Troubleshooting: dev/Troubleshooting.md diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index 751e61e0d4..693eadea73 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -2119,7 +2119,7 @@ async def update_project_form( db.commit() # OSM Extracts for whole project - pg = PostgresClient(settings.UNDERPASS_API_URL, "underpass") + pg = PostgresClient("underpass") outfile = ( f"/tmp/{project_title}_{category}.geojson" # This file will store osm extracts ) diff --git a/src/backend/app/tasks/tasks_crud.py b/src/backend/app/tasks/tasks_crud.py index 3bd1db2d36..467e73c86a 100644 --- a/src/backend/app/tasks/tasks_crud.py +++ b/src/backend/app/tasks/tasks_crud.py @@ -22,14 +22,12 @@ from geoalchemy2.shape import from_shape from geojson import dump from loguru import logger as log -from osm_fieldwork.make_data_extract import PostgresClient +from osm_rawdata.postgres import PostgresClient from shapely.geometry import shape from sqlalchemy import column, select, table from sqlalchemy.orm import Session from sqlalchemy.sql import text -from app.config import settings - from ..central import central_crud from ..db import db_models from ..db.postgis_utils import geometry_to_geojson @@ -332,7 +330,7 @@ async def update_task_files( task_polygons = f"/tmp/{project_name}_{category}_{task_id}.geojson" # Update data extracts in the odk central - pg = PostgresClient(settings.UNDERPASS_API_URL, "underpass") + pg = PostgresClient("underpass") category = "buildings" diff --git a/src/frontend/.babelrc b/src/frontend/.babelrc deleted file mode 100755 index 934c0ae8e9..0000000000 --- a/src/frontend/.babelrc +++ /dev/null @@ -1,41 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "useBuiltIns": "entry", - "corejs": "3.22" - } - ], - "@babel/preset-typescript", - "@babel/preset-react" - ], - "plugins": [ - ["@babel/transform-runtime"], - [ - "import", - { "libraryName": "@mui/material", "libraryDirectory": "", "camel2DashComponentName": false }, - "@mui/material" - ], - [ - "import", - { "libraryName": "@mui/icons-material", "libraryDirectory": "", "camel2DashComponentName": false }, - "@mui/icons-material" - ], - [ - "import", - { "libraryName": "@mui/material/colors", "libraryDirectory": "", "camel2DashComponentName": false }, - "@mui/material/colors" - ] - // [ - // "import", - // { "libraryName": "react-redux", "libraryDirectory": "", "camel2DashComponentName": false }, - // "react-redux" - // ], - // [ - // "import", - // { "libraryName": "swiper", "libraryDirectory": "", "camel2DashComponentName": false }, - // "swiper" - // ] - ] -} diff --git a/src/frontend/package.json b/src/frontend/package.json index c1167231ee..81ce5f8291 100755 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -21,7 +21,6 @@ "@types/react-dom": "^17.0.2", "@vitejs/plugin-react": "^4.1.0", "autoprefixer": "^10.4.15", - "babel-plugin-import": "^1.13.6", "css-loader": "^6.3.0", "eslint-config-airbnb": "^19.0.4", "eslint-plugin-react": "^7.33.0", diff --git a/src/frontend/pnpm-lock.yaml b/src/frontend/pnpm-lock.yaml index 1aa04ab26c..f23697512c 100644 --- a/src/frontend/pnpm-lock.yaml +++ b/src/frontend/pnpm-lock.yaml @@ -133,9 +133,6 @@ devDependencies: autoprefixer: specifier: ^10.4.15 version: 10.4.16(postcss@8.4.31) - babel-plugin-import: - specifier: ^1.13.6 - version: 1.13.8 css-loader: specifier: ^6.3.0 version: 6.8.1(webpack@5.88.2) @@ -4033,13 +4030,6 @@ packages: dequal: 2.0.3 dev: true - /babel-plugin-import@1.13.8: - resolution: - { integrity: sha512-36babpjra5m3gca44V6tSTomeBlPA7cHUynrE2WiQIm3rEGD9xy28MKsx5IdO45EbnpJY7Jrgd00C6Dwt/l/2Q== } - dependencies: - '@babel/helper-module-imports': 7.22.15 - dev: true - /babel-plugin-macros@3.1.0: resolution: { integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== }