Skip to content

Commit

Permalink
Prevent project generation if api failure pt2 (#1635)
Browse files Browse the repository at this point in the history
* fix(hotfix): download of basemaps in ui, max zoom level 22 used for tms

* ci: update all gh-workflows to latest v1.6.0

* build: upgrade rclone --> v1 pin to avoid CVE-2024-24790

* build: remove unnecessary tables and field from db schema (#1623)

* build: remove unnecessary tables via migration & simplify schema

* refactor: remove references to removed tables in sqlalchemy models

* build: add IF EXISTS to DROP COLUMN in migration

* build: remove default columns from previous migration

* fix(backend): minor fixes to HTTPException on endpoints

* fix(backend): addded created date on the project response, set expiry of access token to 1 hour (#1633)

* docs: add placeholder for axiom repo activity

* fix(createProjectSlice): set generateProject & drawToggle status to default

* feat(commonUtils): isStatusSuccess function add

* test: get the detailed task history for a project (#1626)

* build(backend): add async-lru dep, remove cpuinfo dep

* fix: replace lru_cache with async for getting odk creds

* fix(splitTasks): dependency add to useEffect

* fix(createProjectService): halt project creation if api failure

---------

Co-authored-by: spwoodcock <sam.woodcock@protonmail.com>
Co-authored-by: Sam <78538841+spwoodcock@users.noreply.github.com>
Co-authored-by: Sujan Adhikari <109404840+Sujanadh@users.noreply.github.com>
Co-authored-by: Azhar Ismagulova <31756707+azharcodeit@users.noreply.github.com>
  • Loading branch information
5 people authored Jul 8, 2024
1 parent 11a6e97 commit 21ae3f3
Show file tree
Hide file tree
Showing 33 changed files with 286 additions and 619 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
pytest:
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@1.5.2
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@1.6.0
with:
image_name: ghcr.io/${{ github.repository }}/backend
build_context: src/backend
Expand All @@ -29,20 +29,20 @@ jobs:
secrets: inherit

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

backend-build:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
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.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
needs: [frontend-tests]
with:
context: src/frontend
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
needs:
- smoke-test-backend
- smoke-test-frontend
uses: hotosm/gh-workflows/.github/workflows/remote_deploy.yml@1.5.2
uses: hotosm/gh-workflows/.github/workflows/remote_deploy.yml@1.6.0
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.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
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.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
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.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
with:
context: odkcentral/ui
image_tags: |
Expand Down
8 changes: 4 additions & 4 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.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
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.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
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.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
with:
context: nginx
build_target: main
Expand All @@ -44,7 +44,7 @@ jobs:
multi_arch: true

build-proxy-dev:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
with:
context: nginx
build_target: development
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ on:

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

build_openapi_json:
uses: hotosm/gh-workflows/.github/workflows/openapi_build.yml@1.5.2
uses: hotosm/gh-workflows/.github/workflows/openapi_build.yml@1.6.0
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.5.2
uses: hotosm/gh-workflows/.github/workflows/mkdocs_build.yml@1.6.0
needs:
- build_doxygen
- build_openapi_json
Expand Down
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.5.2
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@1.6.0
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,7 +14,7 @@ on:

jobs:
unit-tests:
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@1.5.2
uses: hotosm/gh-workflows/.github/workflows/test_pnpm.yml@1.6.0
with:
working_dir: src/frontend

Expand Down
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.5.2
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@1.6.0
with:
context: src/backend
build_target: prod
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.5.2
uses: hotosm/gh-workflows/.github/workflows/wiki.yml@1.6.0
with:
homepage_path: "wiki_redirect.md"
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ Alternatively see the [docs](https://docs.fmtm.dev) for various deployment guide

## Contributors ✨

Here's how you can contribute:

- [Open an issue](https://github.com/hotosm/fmtm/issues) if you believe you've
encountered a bug.
- Make a [pull request](https://github.com/hotosm/fmtm/pull) to add new features
or fix bugs.

Thanks goes to these wonderful people:

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
Expand Down Expand Up @@ -145,3 +152,7 @@ Thanks goes to these wonderful people:
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

## Repo Activity

![FMTM repo activity – generated by Axiom](https://repobeats.axiom.co/api/embed/xxx.svg)
2 changes: 1 addition & 1 deletion odkcentral/ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN VUE_APP_OIDC_ENABLED="false" npm run build



FROM docker.io/rclone/rclone:1.64 as prod
FROM docker.io/rclone/rclone:1 as prod
VOLUME /frontend
COPY container-entrypoint.sh /
RUN chmod +x /container-entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/auth/auth_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ async def refresh_token(
except Exception as e:
raise HTTPException(
status_code=HTTPStatus.BAD_REQUEST,
detail=f"fail to refresh the access token: {e}",
detail=f"Failed to refresh the access token: {e}",
) from e


Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/auth/osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def create_tokens(jwt_data: dict) -> tuple[str, str]:

def refresh_access_token(payload: dict) -> str:
"""Generate a new access token."""
payload["exp"] = int(time.time()) + 60 # Access token valid for 15 minutes
payload["exp"] = int(time.time()) + 3600 # Access token valid for 1 hour

return jwt.encode(
payload,
Expand Down
Loading

0 comments on commit 21ae3f3

Please sign in to comment.