From e90ebd924386a1de8dbfb4da80e7a72131312ce4 Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Wed, 18 Oct 2023 14:55:58 +0100 Subject: [PATCH 01/11] Fix syntax error parsing JSON string --- backend/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/config.py b/backend/config.py index a76256e6d4..555205014f 100644 --- a/backend/config.py +++ b/backend/config.py @@ -205,7 +205,7 @@ class EnvironmentConfig: """ import json - _params = json.loads(os.getenv("OAUTH2_APP_CREDENTIALS"), None) + _params = json.loads(os.getenv("OAUTH2_APP_CREDENTIALS", None)) OAUTH_CLIENT_ID = _params.get("CLIENT_ID", None) OAUTH_CLIENT_SECRET = _params.get("CLIENT_SECRET", None) OAUTH_REDIRECT_URI = _params.get("REDIRECT_URI", None) From 2f1b2d5d74b80df827e83472b1b756f93613eb5d Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Thu, 19 Oct 2023 10:59:58 +0100 Subject: [PATCH 02/11] Update CircleCI AWS CLI Orb syntax - Update CircleCI AWS CLI Orb to the latest version v4.x - With this comes changes to the parameters supplied. Updated those. - Added AWS ECS orb to begin experiments with backend deployment to AWS ECS. --- .circleci/config.yml | 47 ++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index af1f09b8a3..c86532fe86 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,11 @@ version: 2.1 orbs: - aws-cli: circleci/aws-cli@3.1 + aws-cli: circleci/aws-cli@4.1.1 + aws-ecs: circleci/aws-ecs@4.0.0 opsgenie: opsgenie/opsgenie@1.0.8 + jobs: frontend-code-test: resource_class: large @@ -68,7 +70,7 @@ jobs: TM_ORG_CODE: "CICode" TM_ORG_NAME: "CircleCI Test Organisation" - - image: cimg/postgres:14.2-postgis + - image: cimg/postgres:14.9-postgis environment: POSTGRES_USER: taskingmanager POSTGRES_DB: test_tm @@ -113,13 +115,13 @@ jobs: description: "Cloudformation stack name" type: string docker: - - image: cimg/postgres:15.1-postgis + - image: cimg/postgres:15.4-postgis steps: - aws-cli/setup: - role-arn: "arn:aws:iam::$ORG_AWS_ACCOUNT_ID:role/CircleCI-OIDC-Connect" - profile-name: "OIDC-Profile" - role-session-name: "database-snapshot" - session-duration: "2700" + role_arn: "arn:aws:iam::$ORG_AWS_ACCOUNT_ID:role/CircleCI-OIDC-Connect" + profile_name: "OIDC-Profile" + role_session_name: "database-snapshot" + session_duration: "2700" - run: name: Find the instance ID of the database in the stack to backup command: | @@ -193,10 +195,10 @@ jobs: steps: - checkout - aws-cli/setup: - role-arn: "arn:aws:iam::$ORG_AWS_ACCOUNT_ID:role/CircleCI-OIDC-Connect" - profile-name: "OIDC-Profile" - role-session-name: "backend-deploy" - session-duration: "2700" + role_arn: "arn:aws:iam::$ORG_AWS_ACCOUNT_ID:role/CircleCI-OIDC-Connect" + profile_name: "OIDC-Profile" + role_session_name: "backend-deploy" + session_duration: "2700" - run: sudo apt-get update - run: sudo apt-get -y install libgeos-dev jq - run: sudo yarn global add @mapbox/cfn-config @mapbox/cloudfriend @@ -222,6 +224,21 @@ jobs: export JSON_CONFIG="$(< $CIRCLE_WORKING_DIRECTORY/cfn-config-<< parameters.stack_name >>.json)" cfn-config update << parameters.stack_name >> $CIRCLE_WORKING_DIRECTORY/scripts/aws/cloudformation/tasking-manager.template.js -f -c hot-cfn-config -t hot-cfn-config -r $AWS_REGION -p "$JSON_CONFIG" + backend_deploy_containers: + working_directory: /home/circleci/tasking-manager + docker: + - image: cimg/python:3.10.7 + steps: + - checkout + - aws-cli/setup: + role_arn: "arn:aws:iam::$ORG_AWS_ACCOUNT_ID:role/CircleCI-OIDC-Connect" + profile_name: "OIDC-Profile" + role_session_name: "backend-deploy-containers" + session_duration: "2700" + - run: sudo apt-get update + - run: sudo apt-get -y install curl + - run: echo "Run AWS Fargate" + frontend_deploy: working_directory: /home/circleci/tasking-manager resource_class: large @@ -234,10 +251,10 @@ jobs: steps: - checkout - aws-cli/setup: - role-arn: "arn:aws:iam::$ORG_AWS_ACCOUNT_ID:role/CircleCI-OIDC-Connect" - profile-name: "OIDC-Profile" - role-session-name: "frontend-deploy" - session-duration: "1800" + role_arn: "arn:aws:iam::$ORG_AWS_ACCOUNT_ID:role/CircleCI-OIDC-Connect" + profile_name: "OIDC-Profile" + role_session_name: "frontend-deploy" + session_duration: "1800" - run: name: Deploy Frontend to S3 command: | From c847f492986c6545db83dda10d910a96b562d4a9 Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Thu, 19 Oct 2023 14:49:50 +0100 Subject: [PATCH 03/11] Remove Postgis extension creation --- .circleci/config.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c86532fe86..a57248f6da 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,12 +81,6 @@ jobs: - run: sudo apt-get update - run: sudo apt-get -y install libgeos-dev # Required for shapely - run: sudo apt-get -y install proj-bin libproj-dev - - run: - name: Configure Postgresql Test database - command: | - psql \ - -d $SQLALCHEMY_DATABASE_URI \ - -c "CREATE EXTENSION postgis;" - run: pip install --upgrade pip pdm - run: pdm config --global python.use_venv False - run: pdm export --dev --without-hashes > requirements.txt From 59938b3c3b7d44b639cec2f9eedac4bdbcc87975 Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Tue, 24 Oct 2023 10:00:40 +0100 Subject: [PATCH 04/11] Enable IPv6 for Application Load Balancers --- scripts/aws/cloudformation/tasking-manager.template.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/aws/cloudformation/tasking-manager.template.js b/scripts/aws/cloudformation/tasking-manager.template.js index e03637dc9e..a7519646a2 100644 --- a/scripts/aws/cloudformation/tasking-manager.template.js +++ b/scripts/aws/cloudformation/tasking-manager.template.js @@ -562,7 +562,9 @@ const Resources = { Name: cf.stackName, SecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'elbs-security-group', cf.region]))], Subnets: cf.ref('ELBSubnets'), - Type: 'application' + Type: 'application', + IpAddressType: 'dualstack', + Tags: [ { "Key": "stack_name", "Value": cf.stackName } ] } }, TaskingManagerLoadBalancerRoute53: { From bd41bf659833619c30b81e2c660fb12b32bb14de Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Tue, 24 Oct 2023 10:18:41 +0100 Subject: [PATCH 05/11] Enable IPv6 for RDS databases --- scripts/aws/cloudformation/tasking-manager.template.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/aws/cloudformation/tasking-manager.template.js b/scripts/aws/cloudformation/tasking-manager.template.js index a7519646a2..351864966c 100644 --- a/scripts/aws/cloudformation/tasking-manager.template.js +++ b/scripts/aws/cloudformation/tasking-manager.template.js @@ -653,6 +653,7 @@ const Resources = { DBInstanceClass: cf.ref('DatabaseInstanceType'), DBSnapshotIdentifier: cf.if('UseASnapshot', cf.ref('DBSnapshot'), cf.noValue), VPCSecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'ec2s-security-group', cf.region]))], + NetworkType: 'DUAL' } }, TaskingManagerReactBucket: { From a08e580d7b5640f271c060e0b4372651550821f8 Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Tue, 24 Oct 2023 10:37:39 +0100 Subject: [PATCH 06/11] Make RDS databases publicly inaccessible --- scripts/aws/cloudformation/tasking-manager.template.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/aws/cloudformation/tasking-manager.template.js b/scripts/aws/cloudformation/tasking-manager.template.js index 351864966c..b171ddaf3c 100644 --- a/scripts/aws/cloudformation/tasking-manager.template.js +++ b/scripts/aws/cloudformation/tasking-manager.template.js @@ -653,7 +653,8 @@ const Resources = { DBInstanceClass: cf.ref('DatabaseInstanceType'), DBSnapshotIdentifier: cf.if('UseASnapshot', cf.ref('DBSnapshot'), cf.noValue), VPCSecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'ec2s-security-group', cf.region]))], - NetworkType: 'DUAL' + NetworkType: 'DUAL', + PubliclyAccessible: false } }, TaskingManagerReactBucket: { From cf3f38d390c1f5a78996545f65358536c34e60f7 Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Tue, 24 Oct 2023 11:00:02 +0100 Subject: [PATCH 07/11] Remove IPv6 for databases --- scripts/aws/cloudformation/tasking-manager.template.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/aws/cloudformation/tasking-manager.template.js b/scripts/aws/cloudformation/tasking-manager.template.js index b171ddaf3c..7c66644165 100644 --- a/scripts/aws/cloudformation/tasking-manager.template.js +++ b/scripts/aws/cloudformation/tasking-manager.template.js @@ -653,7 +653,6 @@ const Resources = { DBInstanceClass: cf.ref('DatabaseInstanceType'), DBSnapshotIdentifier: cf.if('UseASnapshot', cf.ref('DBSnapshot'), cf.noValue), VPCSecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'ec2s-security-group', cf.region]))], - NetworkType: 'DUAL', PubliclyAccessible: false } }, From 3dd998c1360c9a6b42970001b80e95d55085995c Mon Sep 17 00:00:00 2001 From: Ramya Date: Thu, 26 Oct 2023 05:24:32 +0000 Subject: [PATCH 08/11] Roadmap link updated --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index f5317df6ad..96a4a25ea3 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,7 @@ This is Free and Open Source Software. You are welcome to use the code and set u * Read the monthly update blogs on [OSM Discourse](https://community.openstreetmap.org/c/general/38/all). ## Product Roadmap -We have included below a high level roadmap/plan [subject to change] that can be used as an overview. -![image](https://user-images.githubusercontent.com/98902727/218763601-f08e3879-51f3-40a7-ae6e-bdf96f8a5979.png) - +We have included below a [high level roadmap/plan](https://github.com/orgs/hotosm/projects/28/ [subject to change] that can be used as an overview. ## Developers From d560a76933de8c40c1022b9f31248520a3987148 Mon Sep 17 00:00:00 2001 From: Ramya Date: Thu, 26 Oct 2023 05:25:07 +0000 Subject: [PATCH 09/11] Roadmap link update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 96a4a25ea3..90750c3c2d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This is Free and Open Source Software. You are welcome to use the code and set u * Read the monthly update blogs on [OSM Discourse](https://community.openstreetmap.org/c/general/38/all). ## Product Roadmap -We have included below a [high level roadmap/plan](https://github.com/orgs/hotosm/projects/28/ [subject to change] that can be used as an overview. +We have included below a [high level roadmap/plan](https://github.com/orgs/hotosm/projects/28/) [subject to change] that can be used as an overview. ## Developers From f27b463b99862f3799f7eb171435e1db87dfc2de Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Tue, 31 Oct 2023 09:50:29 +0545 Subject: [PATCH 10/11] Fix My Tasks list view not showing pagination issue --- frontend/src/views/contributions.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/contributions.js b/frontend/src/views/contributions.js index a6e79dda22..fd1b4eaffc 100644 --- a/frontend/src/views/contributions.js +++ b/frontend/src/views/contributions.js @@ -46,7 +46,12 @@ export const ContributionsPage = () => {
- +
); }; From 7da7a500c17a13f5acdbd608b4ff57436bb1b6bc Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Tue, 31 Oct 2023 09:51:21 +0545 Subject: [PATCH 11/11] Do not show pagination when no data present in ProjectCardPaginator --- frontend/src/components/projects/projectCardPaginator.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/projects/projectCardPaginator.js b/frontend/src/components/projects/projectCardPaginator.js index e3da5d7a0a..c5be0fd17a 100644 --- a/frontend/src/components/projects/projectCardPaginator.js +++ b/frontend/src/components/projects/projectCardPaginator.js @@ -15,7 +15,8 @@ export const ProjectCardPaginator = ({ status, pagination, fullProjectsQuery, se ); }; - if (!apiIsFetched) { + // do not show pagination when the data is being fetched or it has zero results + if (!apiIsFetched || !pagination?.total) { return null; } const activePage = (apiIsFetched && pagination?.page) || 1;