Skip to content

Commit

Permalink
Merge branch 'development' into feat-ConfigFile
Browse files Browse the repository at this point in the history
  • Loading branch information
robsavoye authored Sep 8, 2023
2 parents 12b3690 + c064166 commit 019fcfc
Show file tree
Hide file tree
Showing 109 changed files with 260,172 additions and 1,845 deletions.
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### copy to .env and set variables

### ODK Central ###
ODK_CENTRAL_VERSION=v2023.2.1
ODK_CENTRAL_URL=https://central-proxy
ODK_CENTRAL_USER=[email protected]
ODK_CENTRAL_PASSWD=fmtm
Expand All @@ -16,12 +17,12 @@ FRONTEND_MAP_URL=127.0.0.1:8081
# API_PREFIX=/api

### OSM ###
OSM_CLIENT_ID=
OSM_CLIENT_SECRET=
OSM_CLIENT_ID=xxx
OSM_CLIENT_SECRET=xxx
OSM_URL=https://www.openstreetmap.org
OSM_SCOPE=read_prefs
OSM_LOGIN_REDIRECT_URI=http://127.0.0.1:8080/osmauth/
OSM_SECRET_KEY=
OSM_SECRET_KEY=xxx

### Database (optional) ###
CENTRAL_DB_HOST=central-db
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/ci_img_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build CI Img

on:
# Push includes PR merge
push:
branches:
- main
- staging
- development
paths:
# Workflow is triggered only if deps change
- "src/backend/pyproject.toml"
- "src/backend/Dockerfile"
# Allow manual trigger
workflow_dispatch:

env:
REGISTRY: ghcr.io
GIT_BRANCH: ${{ github.ref_name }}

jobs:
build-and-push-images:
runs-on: ubuntu-latest
environment:
name: ${{ github.ref_name }}
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract api version
id: extract_api_version
run: |
cd src/backend
echo "API_VERSION=$(python -c 'from app.__version__ import __version__; print(__version__)')" >> $GITHUB_ENV
- name: Build image
uses: docker/build-push-action@v4
with:
context: src/backend
target: ci
push: true
tags: |
"ghcr.io/hotosm/fmtm/backend:${{ env.API_VERSION }}-ci-${{ github.ref_name }}"
"ghcr.io/hotosm/fmtm/backend:ci-${{ github.ref_name }}"
build-args: |
API_VERSION=${{ env.API_VERSION }}
99 changes: 99 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Publish Docs

on:
push:
paths:
- docs/**
- src/**
- mkdocs.yml
branches: [main]
# Allow manual trigger (workflow_dispatch)
workflow_dispatch:

permissions:
contents: write

jobs:
build_doxygen:
name: Build Doxygen Docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Doxygen
run: sudo apt-get update && sudo apt-get install -y doxygen

- name: Write cache
uses: actions/cache@v3
with:
path: |
.cache
docs/apidocs
docs/openapi.json
key: doc-build-${{ env.cache_id }}

- name: Build Doxygen Docs
run: |
cd docs
doxygen
build_openapi_json:
name: Build OpenAPI
runs-on: ubuntu-latest
container:
image: ghcr.io/hotosm/fmtm/backend:ci-main
options: --user root

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Read cache
uses: actions/cache@v3
with:
path: |
.cache
docs/apidocs
docs/openapi.json
key: doc-build-${{ env.cache_id }}
restore-keys: |
doc-build-
- name: Build OpenAPi JSON
run: |
chmod -R 777 .
gosu appuser python scripts/gen_openapi_json.py -o docs/openapi.json
publish_docs:
name: Publish Docs
runs-on: ubuntu-latest
container:
image: ghcr.io/hotosm/fmtm/backend:ci-main
options: --user root
needs: [build_doxygen, build_openapi_json]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Read cache
uses: actions/cache@v3
with:
path: |
.cache
docs/apidocs
docs/openapi.json
key: doc-build-${{ env.cache_id }}
restore-keys: |
doc-build-
- name: Install Git
run: |
apt-get update
apt-get install -y git --no-install-recommends
- name: Publish
run: |
chmod -R 777 .
gosu appuser mkdocs gh-deploy --force
24 changes: 10 additions & 14 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,19 @@ jobs:
test:
runs-on: ubuntu-latest
environment:
name: ${{ github.ref_name }}
name: test

container:
image: ghcr.io/hotosm/fmtm/backend:ci
image: ghcr.io/hotosm/fmtm/backend:ci-${{ github.base_ref || github.ref_name }}
env:
ODK_CENTRAL_URL: https://central-proxy
ODK_CENTRAL_USER: [email protected]
ODK_CENTRAL_PASSWD: odk
OSM_CLIENT_ID: test
OSM_CLIENT_SECRET: test
OSM_SECRET_KEY: test
# Fix why env. vars not working below
# OSM_CLIENT_ID: ${{ env.OSM_TEST_CLIENT_ID }}
# OSM_CLIENT_SECRET: ${{ env.OSM_TEST_CLIENT_SECRET }}
# OSM_SECRET_KEY: ${{ env.OSM_TEST_SECRET_KEY }}
# FRONTEND_MAIN_URL: "ui-main:8080"
# FRONTEND_MAP_URL: "ui-map:8081"
ODK_CENTRAL_URL: ${{ vars.ODK_CENTRAL_URL }}
ODK_CENTRAL_USER: ${{ vars.ODK_CENTRAL_USER }}
ODK_CENTRAL_PASSWD: ${{ vars.ODK_CENTRAL_PASSWD }}
OSM_CLIENT_ID: ${{ vars.OSM_CLIENT_ID }}
OSM_CLIENT_SECRET: ${{ vars.OSM_CLIENT_SECRET }}
OSM_SECRET_KEY: ${{ vars.OSM_SECRET_KEY }}
FRONTEND_MAIN_URL: ${{ vars.FRONTEND_MAIN_URL }}
FRONTEND_MAP_URL: ${{ vars.FRONTEND_MAP_URL }}
options: --user root

services:
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/wiki.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,6 @@ src/frontend/node_modules

# pdm
**/.pdm.toml
**/pdm.toml
**/.pdm-python
**/__pypackages__
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code of conduct
# 📜 Code of conduct

(The latest version can be found at <https://www.hotosm.org/code-of-conduct>)

Expand Down Expand Up @@ -80,4 +80,4 @@ As a first measure, it is preferable to work out issues directly with the people

- Contact the HOT Community Partnerships Manager.

When these informal processes fail, or when a situation warrants an immediate response by HOT, you can evoke the **HOT Policy and Code of Conduct Complaint Handling Process**. This process was adopted by HOT Voting Members in 2016 to provide a more formal means of enforcement for our community standards. You start it by emailing [[email protected]](mailto:[email protected]) with a description of your complaint, your name, and the name of the offending party. All complaints will be considered confidential. The full process is described [here](https://docs.google.com/document/d/1xb-SPADtSbgwl6mAgglHMPHpknt-E7lKRoIcSbW431A/edit)
When these informal processes fail, or when a situation warrants an immediate response by HOT, you can evoke the **HOT Policy and Code of Conduct Complaint Handling Process**. This process was adopted by HOT Voting Members in 2016 to provide a more formal means of enforcement for our community standards. You start it by emailing [[email protected]](mailto:[email protected]) with a description of your complaint, your name, and the name of the offending party. All complaints will be considered confidential. The full process is described [here](https://docs.google.com/document/d/1xb-SPADtSbgwl6mAgglHMPHpknt-E7lKRoIcSbW431A/edit) .
31 changes: 30 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
# Contribution guidelines
## 🤗 Welcome

:+1::tada: First off, We are really glad you're reading this, because we need volunteer developers to help improve the Field Mapping Tasking Manager (FMTM)! :tada::+1:

We welcome and encourage contributors of all skill levels, and we are committed to making sure your participation is inclusive, enjoyable, and rewarding. If you have never contributed to an open source project before, we are a good place to start, and we will make sure you are supported every step of the way. If you have **any** questions, please ask!

You can see an overview of the project and the process we have gone through in developing FMTM so far in these [slides](https://docs.google.com/presentation/d/1UrBG1X4MXwVd8Ps498FDlAYvesIailjjPPJfR_B4SUs/edit#slide=id.g15c1f409958_0_0) .

Furthermore, there are many ways to contribute to the **Field Mapping Tasking Manager (FMTM)**, which includes:

## Testing

Right now, we are in the process of building the prototype. We warmly welcome your input in testing and sharing your feedback. If you are also interested in coordinating a field testing session, please reach out!

## Code contributions

Create pull requests (PRs) for changes that you think are needed. We would really appreciate your help!

In fact, we are specifically looking for input from developers with **Python skills** and **familiarity with Fast API**.

## Report bugs and suggest improvements

The [issue queue](https://github.com/hotosm/fmtm/issues) is the best way to get started. There are issue templates for BUGs and FEATURES that you can use, you could also create your own. Once you have submitted an issue, it will be assigned one label from the following [label categories](https://github.com/hotosm/fmtm/labels). If you are wondering where to start, you can filter by the **good first issue label**.

## :handshake: Thank you

Thank you very much in advance for your contributions!! Please ensure you refer to our **Code of Conduct**.
If you've read the guidelines, but are still not sure how to contribute on Github, please reach out to us via our Slack **#geospatial-tech-and-innovation**.

# Code Contribution guidelines

## Workflow

Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> NOTE: This is an installation guide to quickly get the fmtm app up and running. For a detailed guide on how to install the fmtm app using different methods and contributing, checkout the [docs](./docs)
> NOTE: This is an installation guide to quickly get the fmtm app up and running. For a detailed guide on how to install the fmtm app using different methods and contributing, checkout the [dev docs](https://hotosm.github.io/fmtm/dev/Setup/)
# Table of Contents

Expand Down
60 changes: 60 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright (c) 2020, 2021 Humanitarian OpenStreetMap Team
#
# This file is part of FMTM.
#
# FMTM is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# FMTM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FMTM. If not, see <https:#www.gnu.org/licenses/>.
#

# 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

PDFS := $(MDS:.md=.pdf)

all:
@echo "Targets are:"
@echo " clean - remove generated files"
@echo " apidoc - generate Doxygen API docs"
@echo " check - run the tests"
@echo " uml - generate UML diagrams"

clean:
@rm -fr docs/{apidocs,html,docbook,man} docs/packages.png docs/classes.png

uml:
cd docs && pyreverse -o png ../src/backend/app

apidoc: force
cd docs && doxygen

# Strip any unicode out of the markdown file before converting to PDF
pdf: $(PDFS)
%.pdf: %.md
@echo "Converting $< to a PDF"
@new=$(notdir $(basename $<)); \
iconv -f utf-8 -t US $< -c | \
pandoc $< -f markdown -t pdf -s -o /tmp/$$new.pdf

.SUFFIXES: .md .pdf

.PHONY: apidoc

force:
Loading

0 comments on commit 019fcfc

Please sign in to comment.