From 303487558a8c68a8b7f093d6c66298d73bf45666 Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Thu, 16 May 2024 13:36:07 +0530 Subject: [PATCH 1/7] Add initial auto-deploy workflow Add initial auto-deploy Github action workflow. This should automatically build the containers and push to GHCR and use the GHCR path to update task definitions and deploy to AWS ECS. Currently being tested with the fastAPI branch. --- .github/workflows/ecs-deploy.yml | 95 ++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/ecs-deploy.yml diff --git a/.github/workflows/ecs-deploy.yml b/.github/workflows/ecs-deploy.yml new file mode 100644 index 0000000000..190ccc0778 --- /dev/null +++ b/.github/workflows/ecs-deploy.yml @@ -0,0 +1,95 @@ +name: Deploy to Amazon ECS + +on: + push: + branches: + - tasking-manager-fastapi + +env: + REGISTRY: ghcr.io + AWS_REGION: us-east-1 + ECS_CLUSTER: tasking-manager + ECS_SERVICE: tasking-manager-fastAPI + CONTAINER_NAME: backend + IMAGE_NAME: hotosm/tasking-manager-backend # was ${{ github.repository }} + +jobs: + build-push-image: + name: Build Images + runs-on: ubuntu-latest + environment: production + + permissions: + contents: read + packages: write + + outputs: + imageid: steps.build-push-image.imageid + + steps: + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + + - name: Setup Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set container image metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + tags: | + type=ref,event=branch + + - name: Build and push container image + id: build-push-image + uses: docker/build-push-action@v5 + with: + context: "{{defaultContext}}" + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + + deploy: + name: Deploy + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + + + - name: Download task definition + run: | + aws ecs describe-task-definition --task-definition tasking-manager --query taskDefinition > task-definition.json + + - name: Task definition rendition + id: task-def + uses: aws-actions/amazon-ecs-render-task-definition@v1 + with: + task-definition: task-definition.json + container-name: ${{ env.CONTAINER_NAME }} + image: ${{ needs.build-push-image.outputs.imageid }} + + - name: Deploy task definition + uses: aws-actions/amazon-ecs-deploy-task-definition@v1 + with: + task-definition: ${{ steps.task-def.outputs.task-definition }} + service: ${{ env.ECS_SERVICE }} + cluster: ${{ env.ECS_CLUSTER }} + wait-for-service-stability: true + + + From 7bfb472400410a4ee26c7cc33097c3811816a7f3 Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Thu, 16 May 2024 17:34:28 +0530 Subject: [PATCH 2/7] Fix AWS OIDC Authentication from Github Signed-off-by: eternaltyro <230743+eternaltyro@users.noreply.github.com> --- .github/workflows/ecs-deploy.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ecs-deploy.yml b/.github/workflows/ecs-deploy.yml index 190ccc0778..1958b26c80 100644 --- a/.github/workflows/ecs-deploy.yml +++ b/.github/workflows/ecs-deploy.yml @@ -63,13 +63,20 @@ jobs: runs-on: ubuntu-latest environment: production + permissions: + contents: read + id-token: write + steps: - name: Checkout uses: actions/checkout@v4 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 - + with: + aws-region: us-east-1 + role-to-assume: arn:aws:iam::670261699094:role/Github-AWS-OIDC + role-session-name: gh-ci-ecs-deploy - name: Download task definition run: | From 3390790d6f301cccee182ef0a861555e4b0ea4df Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Tue, 16 Jan 2024 13:21:34 -0700 Subject: [PATCH 3/7] Update Rapid to v2.3.1 Signed-off-by: Taylor Smock --- example.env | 1 + frontend/.env.expand | 1 + frontend/package.json | 4 +- frontend/src/components/rapidEditor.js | 32 +++-- frontend/src/config/index.js | 2 + frontend/yarn.lock | 178 +++++++++++++++++-------- 6 files changed, 146 insertions(+), 72 deletions(-) diff --git a/example.env b/example.env index 91b4325e35..109c2a0d8f 100644 --- a/example.env +++ b/example.env @@ -36,6 +36,7 @@ TM_ORG_GITHUB=https://github.com/hotosm # Information about the OSM server - Customize your server here # By default, it's the public OpenStreetMap.org server OSM_SERVER_URL=https://www.openstreetmap.org +OSM_SERVER_API_URL=https://api.openstreetmap.org OSM_NOMINATIM_SERVER_URL=https://nominatim.openstreetmap.org OSM_REGISTER_URL=https://www.openstreetmap.org/user/new diff --git a/frontend/.env.expand b/frontend/.env.expand index 58cf2498ab..314dcf6193 100644 --- a/frontend/.env.expand +++ b/frontend/.env.expand @@ -35,6 +35,7 @@ REACT_APP_OSM_CLIENT_ID=$TM_CLIENT_ID REACT_APP_OSM_CLIENT_SECRET=$TM_CLIENT_SECRET REACT_APP_OSM_REDIRECT_URI=$TM_REDIRECT_URI REACT_APP_OSM_SERVER_URL=$OSM_SERVER_URL +REACT_APP_OSM_SERVER_API_URL=$OSM_SERVER_API_URL REACT_APP_TM_ORG_NAME=$TM_ORG_NAME REACT_APP_OSM_REGISTER_URL=$OSM_REGISTER_URL REACT_APP_ID_EDITOR_URL=$ID_EDITOR_URL diff --git a/frontend/package.json b/frontend/package.json index fe4a9f41af..8e3c4a49e8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,13 +5,13 @@ "private": false, "dependencies": { "@hotosm/id": "^2.21.1", - "@hotosm/underpass-ui": "^0.0.4", "@hotosm/iso-countries-languages": "^1.1.2", + "@hotosm/underpass-ui": "^0.0.4", "@mapbox/mapbox-gl-draw": "^1.4.3", "@mapbox/mapbox-gl-geocoder": "^5.0.2", "@mapbox/mapbox-gl-language": "^0.10.1", "@placemarkio/geo-viewport": "^1.0.2", - "@rapideditor/rapid": "^2.1.1", + "@rapideditor/rapid": "^2.3.1", "@sentry/react": "^7.102.0", "@tanstack/react-query": "^4.29.7", "@tanstack/react-query-devtools": "^4.29.7", diff --git a/frontend/src/components/rapidEditor.js b/frontend/src/components/rapidEditor.js index 35378c0549..198299f254 100644 --- a/frontend/src/components/rapidEditor.js +++ b/frontend/src/components/rapidEditor.js @@ -3,7 +3,13 @@ import { useDispatch, useSelector } from 'react-redux'; import PropTypes from 'prop-types'; -import { OSM_CLIENT_ID, OSM_CLIENT_SECRET, OSM_REDIRECT_URI, OSM_SERVER_URL } from '../config'; +import { + OSM_CLIENT_ID, + OSM_CLIENT_SECRET, + OSM_REDIRECT_URI, + OSM_SERVER_API_URL, + OSM_SERVER_URL, +} from '../config'; import { types } from '../store/actions/editor'; // We import from a CDN using a SEMVER minor version range @@ -190,6 +196,7 @@ function RapidEditor({ context.apiConnections = [ { url: OSM_SERVER_URL, + apiUrl: OSM_SERVER_API_URL, client_id: OSM_CLIENT_ID, client_secret: OSM_CLIENT_SECRET, redirect_uri: OSM_REDIRECT_URI, @@ -223,7 +230,7 @@ function RapidEditor({ useEffect(() => { const containerRoot = document.getElementById('rapid-container-root'); - const editListener = () => updateDisableState(setDisable, context.systems.edits); + const editListener = () => updateDisableState(setDisable, context.systems.editor); if (context && dom) { containerRoot.appendChild(dom); // init the ui or restart if it was loaded previously @@ -239,28 +246,30 @@ function RapidEditor({ /* Perform tasks after Rapid has started up */ promise.then(() => { - /* Keep track of edits */ - const editSystem = context.systems.edits; + if (context?.systems?.editor) { + /* Keep track of edits */ + const editSystem = context.systems.editor; - editSystem.on('change', editListener); - editSystem.on('reset', editListener); + editSystem.on('stablechange', editListener); + editSystem.on('reset', editListener); + } }); } return () => { if (containerRoot?.childNodes && dom in containerRoot.childNodes) { document.getElementById('rapid-container-root')?.removeChild(dom); } - if (context?.systems?.edits) { - const editSystem = context.systems.edits; - editSystem.off('change', editListener); + if (context?.systems?.editor) { + const editSystem = context.systems.editor; + editSystem.off('stablechange', editListener); editSystem.off('reset', editListener); } }; }, [dom, context, setDisable]); useEffect(() => { - if (context) { - return () => context.save(); + if (context?.systems?.editor) { + return () => context.systems.editor.saveBackup(); } }, [context]); @@ -268,6 +277,7 @@ function RapidEditor({ if (context && session) { context.preauth = { url: OSM_SERVER_URL, + apiUrl: OSM_SERVER_API_URL, client_id: OSM_CLIENT_ID, client_secret: OSM_CLIENT_SECRET, redirect_uri: OSM_REDIRECT_URI, diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index d925cae638..1beef3981f 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -51,6 +51,8 @@ export const SENTRY_FRONTEND_DSN = process.env.REACT_APP_SENTRY_FRONTEND_DSN; // OSM API and Editor URLs export const OSM_SERVER_URL = process.env.REACT_APP_OSM_SERVER_URL || 'https://www.openstreetmap.org'; +export const OSM_SERVER_API_URL = + process.env.REACT_APP_OSM_SERVER_API_URL || 'https://api.openstreetmap.org'; export const ID_EDITOR_URL = process.env.REACT_APP_ID_EDITOR_URL || 'https://www.openstreetmap.org/edit?editor=id&'; export const POTLATCH2_EDITOR_URL = diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 781ce2d631..7873727953 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -2301,10 +2301,10 @@ resolved "https://registry.yarnpkg.com/@pixi/filter-bulge-pinch/-/filter-bulge-pinch-5.1.1.tgz#b0c821b07902acf7c6ccb9046ae0dfc16c847107" integrity sha512-80I3g813td7Fnzi7IJSiR3z8gZlKblk6WN+5z6WnscQROcNEpck6lgWS/Lf/IdeHB/FtUKJCbx7RzxkUhiRTvA== -"@pixi/filter-color-gradient@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@pixi/filter-color-gradient/-/filter-color-gradient-5.2.0.tgz#4c40ad973ee93a8cbae53821a15ac63fe018839f" - integrity sha512-po3JBEKgfowqhAh2D75Ii1bhNl1gA8Agt+ESIMnSbrTVIkemno8zOVlVmP7xaf8+PKYnX7JWH5buTnnDfA7Hnw== +"@pixi/filter-color-gradient@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@pixi/filter-color-gradient/-/filter-color-gradient-5.3.0.tgz#53221190c11cfd6320855dc07f49fd7f66b5503c" + integrity sha512-dMgBVkSsHOcmTs7HCmlO2hURsk7sT5sOUfnDw46iGqzGgQ+10gCZNaa/oybrDiyEkj+ijyVQVHwapHS3KUgAUQ== "@pixi/filter-color-map@5.1.1": version "5.1.1" @@ -2388,10 +2388,10 @@ resolved "https://registry.yarnpkg.com/@pixi/filter-grayscale/-/filter-grayscale-5.1.1.tgz#5721a6878caef866fe2abab06e591207e489ede5" integrity sha512-tRyggOhTdAQlQpgH/IzjCbORICua/Gm0JkKGOcdDQOHqt4bTVvAehQ59e2+A6A1yA8pevu2L/C25qQhsPgNW9w== -"@pixi/filter-hsl-adjustment@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@pixi/filter-hsl-adjustment/-/filter-hsl-adjustment-5.2.0.tgz#e31adcda372652cf56f6262794f4b8e5dcbc1ce0" - integrity sha512-BjmiKIJQuWNqMUjVUpqkM+HaInQzl7dCvYWj8wx9lSAwjzdOCRVVLbRLdO2TwGdwGIHjR3AylMxY1HZK3P4cLA== +"@pixi/filter-hsl-adjustment@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@pixi/filter-hsl-adjustment/-/filter-hsl-adjustment-5.3.0.tgz#90165888582541ff8ab97d9781585d13455263b0" + integrity sha512-F7gNLrPADGHkToX5toAp0yYs7FenVtHvbC6oC8fydu7/cuDmH0noobI6ShqTcdWJpJbBk1i9LMS93ifiz/13Aw== "@pixi/filter-kawase-blur@5.1.1": version "5.1.1" @@ -2612,7 +2612,7 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== -"@rapid-sdk/math@~1.0.0-pre.1": +"@rapid-sdk/math@~1.0.0-pre.2": version "1.0.0-pre.2" resolved "https://registry.yarnpkg.com/@rapid-sdk/math/-/math-1.0.0-pre.2.tgz#4794c79dd73e0de931cb4076ae8ada390f682ce9" integrity sha512-7XfdfSLza8+k2Siem5CfiMHFaqlU5tlMteUqfuPvOepB2+RgPKOaclAoVoAw9VllkeCeNFVHN56algdwkN+3RA== @@ -2620,7 +2620,7 @@ "@types/d3-polygon" "^3.0.2" d3-polygon "^3.0.1" -"@rapid-sdk/util@~1.0.0-pre.1": +"@rapid-sdk/util@~1.0.0-pre.2": version "1.0.0-pre.2" resolved "https://registry.yarnpkg.com/@rapid-sdk/util/-/util-1.0.0-pre.2.tgz#e430b995d0fed4ea04b6c4881c77ed42bdac1749" integrity sha512-xjvwHoL4eKxeTDRuJRiDCRoFQphBNhQQER6Wd3yDw/y9Zbx/ESk8Kv/yRLnBUzMmQRl16FJ7WCUGRUxFf9Qwtg== @@ -2665,10 +2665,10 @@ "@pixi/core" "7.4.0" "@pixi/math" "7.4.0" -"@rapideditor/rapid@^2.1.1": - version "2.2.5" - resolved "https://registry.yarnpkg.com/@rapideditor/rapid/-/rapid-2.2.5.tgz#627e86c2ee5d4f5f9c25223403bb39715da67fc8" - integrity sha512-b5AZ4bZAAqadTc3lKQ+LgJ1lldImmoK/eDFAhxNtHqPdTO+oTTyg+GqW2Fl8mD06n2IBosBpIKh8J56beQvLkQ== +"@rapideditor/rapid@^2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@rapideditor/rapid/-/rapid-2.3.1.tgz#7e98fb86cb6a8498d1d43fa7a72ead5ab07b1e2f" + integrity sha512-oKM7ZkBxpEVUG35PPrz0HzmwJak0h/b+7+YdwVskrSIZZMsWeag7sibASQcHGzGM9Ih1IBUDZ2Dw5c9MkOGsQw== dependencies: "@mapbox/geojson-area" "^0.2.2" "@mapbox/geojson-rewind" "^0.5.2" @@ -2677,29 +2677,31 @@ "@mapbox/vector-tile" "^1.3.1" "@pixi/display" "7.4.0" "@pixi/events" "7.4.0" - "@rapid-sdk/math" "~1.0.0-pre.1" - "@rapid-sdk/util" "~1.0.0-pre.1" + "@rapid-sdk/math" "~1.0.0-pre.2" + "@rapid-sdk/util" "~1.0.0-pre.2" "@rapideditor/country-coder" "~5.2.2" "@rapideditor/location-conflation" "~1.3.0" "@rapideditor/pixi-dashed-line" "7.4.0" "@rapideditor/pixi-texture-allocator" "7.4.0" "@tmcw/togeojson" "^5.8.1" - "@types/chai" "^4.3.11" - d3 "~7.8.5" + "@types/chai" "^4.3.16" + "@vannizhang/wayback-core" "^1.0.6" + d3 "~7.9.0" fast-deep-equal "~3.1.3" fast-json-stable-stringify "2.1.0" lodash-es "~4.17.21" - marked "~11.2.0" + marked "~12.0.2" node-diff3 "~3.1.2" - osm-auth "2.4.0" + osm-auth "2.5.0" pbf "^3.2.1" - pixi-filters "5.2.1" + pixi-filters "5.3.0" pixi.js "7.4.0" - pmtiles "^2.11.0" - polyclip-ts "~0.16.3" + pmtiles "^3.0.5" + polyclip-ts "~0.16.5" prop-types "^15.8.1" rbush "3.0.1" which-polygon "2.2.1" + wkt "^0.1.1" "@reach/auto-id@^0.2.0": version "0.2.0" @@ -3383,10 +3385,10 @@ "@types/node" "*" "@types/responselike" "^1.0.0" -"@types/chai@^4.3.11": - version "4.3.14" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.14.tgz#ae3055ea2be43c91c9fd700a36d67820026d96e6" - integrity sha512-Wj71sXE4Q4AkGdG9Tvq1u/fquNz9EdG4LIJMwVVII7ashjD/8cf8fyIfJAjRr6YcsXnSE8cOGQPq1gqeR8z+3w== +"@types/chai@^4.3.16": + version "4.3.16" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.16.tgz#b1572967f0b8b60bf3f87fe1d854a5604ea70c82" + integrity sha512-PatH4iOdyh3MyWtmHVFXLWCCIhUbopaltqddG9BzB+gMIzee2MJrvd+jouii9Z3wzQJruGWAm7WOMjgfG8hQlQ== "@types/connect-history-api-fallback@^1.3.5": version "1.5.4" @@ -3476,11 +3478,16 @@ "@types/qs" "*" "@types/serve-static" "*" -"@types/geojson@*", "@types/geojson@^7946.0", "@types/geojson@^7946.0.13": +"@types/geojson@*", "@types/geojson@^7946.0.13": version "7946.0.14" resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.14.tgz#319b63ad6df705ee2a65a73ef042c8271e696613" integrity sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg== +"@types/geojson@^7946.0": + version "7946.0.10" + resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.10.tgz#6dfbf5ea17142f7f9a043809f1cd4c448cb68249" + integrity sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA== + "@types/graceful-fs@^4.1.2": version "4.1.9" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" @@ -3574,6 +3581,13 @@ dependencies: "@types/node" "*" +"@types/leaflet@^1.9.8": + version "1.9.12" + resolved "https://registry.yarnpkg.com/@types/leaflet/-/leaflet-1.9.12.tgz#a6626a0b3fba36fd34723d6e95b22e8024781ad6" + integrity sha512-BK7XS+NyRI291HIo0HCfE18Lp8oA30H1gpi1tf0mF3TgiCEzanQjOqNZ4x126SXzzi2oNSZhZ5axJp1k0iM6jg== + dependencies: + "@types/geojson" "*" + "@types/mapbox__point-geometry@*", "@types/mapbox__point-geometry@^0.1.4": version "0.1.4" resolved "https://registry.yarnpkg.com/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz#0ef017b75eedce02ff6243b4189210e2e6d5e56d" @@ -3625,9 +3639,9 @@ undici-types "~5.26.4" "@types/normalize-package-data@^2.4.0": - version "2.4.4" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" - integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== + version "2.4.1" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" + integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== "@types/parse-json@^4.0.0": version "4.0.2" @@ -3639,7 +3653,12 @@ resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== -"@types/pbf@*", "@types/pbf@^3.0.5": +"@types/pbf@*": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/pbf/-/pbf-3.0.2.tgz#8d291ad68b4b8c533e96c174a2e3e6399a59ed61" + integrity sha512-EDrLIPaPXOZqDjrkzxxbX7UlJSeQVgah3i0aA4pOSzmK9zq3BIh7/MZIQxED7slJByvKM4Gc6Hypyu2lJzh3SQ== + +"@types/pbf@^3.0.5": version "3.0.5" resolved "https://registry.yarnpkg.com/@types/pbf/-/pbf-3.0.5.tgz#a9495a58d8c75be4ffe9a0bd749a307715c07404" integrity sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA== @@ -3952,6 +3971,11 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== +"@vannizhang/wayback-core@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@vannizhang/wayback-core/-/wayback-core-1.0.6.tgz#43f6a6d3fc4a017f3483cb07c0f49498c14ef884" + integrity sha512-Ee5oaqy2vSUyxid+ZoYY0ZEUrNVWxi0wXwp8eU4jpelEneIt9HWSOOtT8Y5RVEAWgMhQQfWsqJZhh7KZxgduVg== + "@webassemblyjs/ast@1.12.1", "@webassemblyjs/ast@^1.12.1": version "1.12.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.12.1.tgz#bb16a0e8b1914f979f45864c23819cc3e3f0d4bb" @@ -4973,7 +4997,12 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001587, caniuse-lite@^1.0.30001599: +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001587: + version "1.0.30001588" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001588.tgz#07f16b65a7f95dba82377096923947fb25bce6e3" + integrity sha512-+hVY9jE44uKLkH0SrUTqxjxqNTOWHsbnQDIKjwkZ3lNTzUUVdBLBGXtj/q5Mp5u98r3droaZAewQuEDzjQdZlQ== + +caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001599: version "1.0.30001614" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001614.tgz#f894b4209376a0bf923d67d9c361d96b1dfebe39" integrity sha512-jmZQ1VpmlRwHgdP1/uiKzgiAuGOfLEJsYFP4+GBou/QQ4U6IOJCB4NP1c+1p9RGLpwObcT94jA5/uO+F1vBbog== @@ -5893,10 +5922,10 @@ d3-zoom@3: d3-selection "2 - 3" d3-transition "2 - 3" -d3@~7.8.5: - version "7.8.5" - resolved "https://registry.yarnpkg.com/d3/-/d3-7.8.5.tgz#fde4b760d4486cdb6f0cc8e2cbff318af844635c" - integrity sha512-JgoahDG51ncUfJu6wX/1vWQEqOflgXyl4MaHqlcSruTez7yhaRKR9i8VjjcQGeS2en/jnFivXuaIMnseMMt0XA== +d3@~7.9.0: + version "7.9.0" + resolved "https://registry.yarnpkg.com/d3/-/d3-7.9.0.tgz#579e7acb3d749caf8860bd1741ae8d371070cd5d" + integrity sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA== dependencies: d3-array "3" d3-axis "3" @@ -9765,10 +9794,10 @@ marked@^4.3.0: resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== -marked@~11.2.0: - version "11.2.0" - resolved "https://registry.yarnpkg.com/marked/-/marked-11.2.0.tgz#fc908aeca962b721b0392ee4205e6f90ebffb074" - integrity sha512-HR0m3bvu0jAPYiIvLUUQtdg1g6D247//lvcekpHO1WMvbwDlwSkZAX9Lw4F4YHE1T0HaaNve0tuAWuV1UJ6vtw== +marked@~12.0.2: + version "12.0.2" + resolved "https://registry.yarnpkg.com/marked/-/marked-12.0.2.tgz#b31578fe608b599944c69807b00f18edab84647e" + integrity sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q== marked@~4.0.12: version "4.0.19" @@ -10789,10 +10818,10 @@ os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -osm-auth@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/osm-auth/-/osm-auth-2.4.0.tgz#d77a0c17ce985b867902871186b71fd32a21f731" - integrity sha512-FvTyYnIl+pjLi9cKJWNM74PjrLUED1f2TnWpAexxJ2qoxr8sdndON/EzXHf0nfMLB07Pn9DPyWVEbTXZ/nID8A== +osm-auth@2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/osm-auth/-/osm-auth-2.5.0.tgz#1b439979cfe16a7002e8a06945fbe4b766f76496" + integrity sha512-w3NnYbt+0PIih2Kwr1sLfQWehdLbcA3gZNJhX4VOBfeRtvm30iZA3nURphuZDokZ8Kmdv4LWB+AiIng2b+KvIA== osm-auth@~2.0.0: version "2.0.1" @@ -11047,10 +11076,10 @@ pirates@^4.0.1, pirates@^4.0.4: resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== -pixi-filters@5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/pixi-filters/-/pixi-filters-5.2.1.tgz#c5f631bfde44684d289caa5ca62597b6f8d95580" - integrity sha512-lsRakKJfK0iH+aCCVePQcSb477hFiS20CR2p4u7xS6RO7q5qh5GhAyGqWdgYZlUT5WLSW0kxAV+FddYLs9z9Sg== +pixi-filters@5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/pixi-filters/-/pixi-filters-5.3.0.tgz#f31454ae3d010f263f28b1f1a8566fbc54f6d65a" + integrity sha512-Dyop7gqgHl5Jc/Bm0QH0CQIDogdICp3hf2CihvgI4AvQebIotPY3yX2MZ/YUcE/7b2aIQQQ2CCt/uc2bBnLRAg== dependencies: "@pixi/filter-adjustment" "5.1.1" "@pixi/filter-advanced-bloom" "5.1.1" @@ -11058,7 +11087,7 @@ pixi-filters@5.2.1: "@pixi/filter-bevel" "5.1.1" "@pixi/filter-bloom" "5.1.1" "@pixi/filter-bulge-pinch" "5.1.1" - "@pixi/filter-color-gradient" "5.2.0" + "@pixi/filter-color-gradient" "5.3.0" "@pixi/filter-color-map" "5.1.1" "@pixi/filter-color-overlay" "5.1.1" "@pixi/filter-color-replace" "5.1.1" @@ -11072,7 +11101,7 @@ pixi-filters@5.2.1: "@pixi/filter-glow" "5.2.1" "@pixi/filter-godray" "5.1.1" "@pixi/filter-grayscale" "5.1.1" - "@pixi/filter-hsl-adjustment" "5.2.0" + "@pixi/filter-hsl-adjustment" "5.3.0" "@pixi/filter-kawase-blur" "5.1.1" "@pixi/filter-motion-blur" "5.1.1" "@pixi/filter-multi-color-replace" "5.1.1" @@ -11138,14 +11167,15 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -pmtiles@^2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/pmtiles/-/pmtiles-2.11.0.tgz#53aac29408e001a73b15b1c8cad0b17c944ab7bd" - integrity sha512-dU9SzzaqmCGpdEuTnIba6bDHT6j09ZJFIXxwGpvkiEnce3ZnBB1VKt6+EOmJGueriweaZLAMTUmKVElU2CBe0g== +pmtiles@^3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/pmtiles/-/pmtiles-3.0.5.tgz#4fe0a1877c4932794d1b471b99c18f9d63c6478c" + integrity sha512-K6NxVvW/vXE3052VZKF2ppyjdyhLx41FidR5yV8L/+El+lcMJpXS0vHBSPFmjdag5zkYv2XGDdq+3VjB2K7l6w== dependencies: + "@types/leaflet" "^1.9.8" fflate "^0.8.0" -polyclip-ts@~0.16.3: +polyclip-ts@~0.16.3, polyclip-ts@~0.16.5: version "0.16.5" resolved "https://registry.yarnpkg.com/polyclip-ts/-/polyclip-ts-0.16.5.tgz#053e073e640449f1b1a1d88471f8758779d0b030" integrity sha512-ZchnG0zGZReHgEo3EYzEUi6UmfQFFzNnj6AFU+gBm+IJJ4qG9gL4CwjtCV6oi/PittUPpJLiLJxcn/AgrCBO+g== @@ -13559,7 +13589,16 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -13659,7 +13698,14 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15027,6 +15073,11 @@ wkt-parser@^1.3.3: resolved "https://registry.yarnpkg.com/wkt-parser/-/wkt-parser-1.3.3.tgz#46b4e3032dd9c86907f7e630b57e3c6ea2bb772b" integrity sha512-ZnV3yH8/k58ZPACOXeiHaMuXIiaTk1t0hSUVisbO0t4RjA5wPpUytcxeyiN2h+LZRrmuHIh/1UlrR9e7DHDvTw== +wkt@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/wkt/-/wkt-0.1.1.tgz#8d3280cb0d7664343d8987a30c85806554618bf8" + integrity sha512-2vtzYZOqN0VZdtDTMDUgbpXpE+MXRdsFTiCpS08FZ4yktT9pPylVMZaLxcIqT9pRkBp5FIAGVQyJ/kJa9b8uGg== + word-wrap@^1.2.5, word-wrap@~1.2.3: version "1.2.5" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" @@ -15261,7 +15312,7 @@ workbox-window@6.6.1: "@types/trusted-types" "^2.0.2" workbox-core "6.6.1" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -15279,6 +15330,15 @@ wrap-ansi@^6.0.1: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 25395a8f0f65808b1cb568ba4d8784c82cd4e7f2 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Mon, 13 May 2024 07:50:46 -0600 Subject: [PATCH 4/7] Prettier Signed-off-by: Taylor Smock --- frontend/src/network/genericJSONRequest.js | 3 +- frontend/src/views/projectLiveMonitoring.js | 60 ++++++++++++--------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/frontend/src/network/genericJSONRequest.js b/frontend/src/network/genericJSONRequest.js index 5f1f5a9a8a..6bb9af7b08 100644 --- a/frontend/src/network/genericJSONRequest.js +++ b/frontend/src/network/genericJSONRequest.js @@ -1,7 +1,6 @@ import { handleErrors } from '../utils/promise'; import { API_URL } from '../config'; - /** * Fetch data from an external JSON API * @param {string} url The url to fetch from @@ -10,7 +9,7 @@ import { API_URL } from '../config'; */ export function fetchExternalJSONAPI(url, init = {}): Promise<*> { if (!init.headers) { - init.headers = {'Content-Type': 'application/json'}; + init.headers = { 'Content-Type': 'application/json' }; } init.headers['Content-Type'] = 'application/json'; diff --git a/frontend/src/views/projectLiveMonitoring.js b/frontend/src/views/projectLiveMonitoring.js index 0e593d8e9e..c6989d8dcc 100644 --- a/frontend/src/views/projectLiveMonitoring.js +++ b/frontend/src/views/projectLiveMonitoring.js @@ -54,7 +54,7 @@ export function ProjectLiveMonitoring() { const [areaOfInterest, setAreaOfInterest] = useState(null); const [project, setProject] = useState(null); - const defaultComment = `${TM_DEFAULT_CHANGESET_COMMENT}-${id}`.replace("#",""); + const defaultComment = `${TM_DEFAULT_CHANGESET_COMMENT}-${id}`.replace('#', ''); const hasLiveMonitoringFeature = useHasLiveMonitoringFeature(); @@ -270,45 +270,53 @@ export function ProjectLiveMonitoring() { )} {project && areaOfInterest && ( - <>
- - -
+ <> +
+ + +
+
{ setRealtimeList(!realtimeList); - } } + }} name="liveListCheckbox" - type="checkbox" /> + type="checkbox" + /> { setRealtimeMap(!realtimeMap); - } } + }} name="liveMapCheckbox" - type="checkbox" /> + type="checkbox" + /> { setListAll(!listAll); - } } + }} name="listAllCheckbox" - type="checkbox" /> + type="checkbox" + />
-
+ + }} + /> + )}
From b9f4f1f6496154ba34ddc8140df69bc421d07b91 Mon Sep 17 00:00:00 2001 From: prabinoid Date: Mon, 27 May 2024 11:10:28 +0545 Subject: [PATCH 5/7] fix: Exception handled for multiple entries found for task invalidation history while validating a task --- backend/models/postgis/task.py | 77 +++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 5 deletions(-) diff --git a/backend/models/postgis/task.py b/backend/models/postgis/task.py index ba0656e3d5..6708dde2ee 100644 --- a/backend/models/postgis/task.py +++ b/backend/models/postgis/task.py @@ -98,15 +98,82 @@ def delete(self): @staticmethod def get_open_for_task(project_id, task_id, local_session=None): + """ + Retrieve the open TaskInvalidationHistory entry for the given project and task. + + This method also handles a suspected concurrency issue by managing cases where multiple entries + are created when only one should exist. If multiple entries are found, it + recursively handles and closes duplicate entries to ensure only a single entry + remains open. + + Args: + project_id (int): The ID of the project. + task_id (int): The ID of the task. + local_session (Session, optional): The SQLAlchemy session to use for the query. + If not provided, a default session is used. + + Returns: + TaskInvalidationHistory or None: The open TaskInvalidationHistory entry, or + None if no open entry is found. + + Raises: + None: This method handles the MultipleResultsFound exception internally. + """ + try: + if local_session: + return ( + local_session.query(TaskInvalidationHistory) + .filter_by(task_id=task_id, project_id=project_id, is_closed=False) + .one_or_none() + ) + return TaskInvalidationHistory.query.filter_by( + task_id=task_id, project_id=project_id, is_closed=False + ).one_or_none() + + except MultipleResultsFound: + TaskInvalidationHistory.close_duplicate_invalidation_history_rows( + project_id, task_id, local_session + ) + + return TaskInvalidationHistory.get_open_for_task( + project_id, task_id, local_session + ) + + @staticmethod + def close_duplicate_invalidation_history_rows( + project_id: int, task_id: int, local_session=None + ): + """ + Closes duplicate TaskInvalidationHistory entries except for the latest one for the given project and task. + + Args: + project_id (int): The ID of the project. + task_id (int): The ID of the task. + local_session (Session, optional): The SQLAlchemy session to use for the query. + If not provided, a default session is used. + """ if local_session: - return ( + oldest_dupe = ( local_session.query(TaskInvalidationHistory) .filter_by(task_id=task_id, project_id=project_id, is_closed=False) - .one_or_none() + .order_by(TaskInvalidationHistory.id.asc()) + .first() ) - return TaskInvalidationHistory.query.filter_by( - task_id=task_id, project_id=project_id, is_closed=False - ).one_or_none() + else: + oldest_dupe = ( + TaskInvalidationHistory.query.filter_by( + task_id=task_id, project_id=project_id, is_closed=False + ) + .order_by(TaskInvalidationHistory.id.asc()) + .first() + ) + + if oldest_dupe: + oldest_dupe.is_closed = True + if local_session: + local_session.commit() + else: + db.session.commit() @staticmethod def close_all_for_task(project_id, task_id, local_session=None): From cf1112db46388f55ed352378d70e3358c938e885 Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Mon, 27 May 2024 18:52:35 +0545 Subject: [PATCH 6/7] Fix project name validation error on cloning project -Related to #6442 --- frontend/src/components/projectCreate/index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/projectCreate/index.js b/frontend/src/components/projectCreate/index.js index 066c66b914..1056ca3e47 100644 --- a/frontend/src/components/projectCreate/index.js +++ b/frontend/src/components/projectCreate/index.js @@ -191,13 +191,15 @@ const ProjectCreate = () => { const handleCreate = useCallback( (cloneProjectData) => { - if (!metadata.projectName.trim()) { - setErr({ error: true, message: intl.formatMessage(messages.noProjectName) }); - throw new Error('Missing project name.'); - } - if (!/^[a-zA-Z]/.test(metadata.projectName)) { - setErr({ error: true, message: intl.formatMessage(messages.projectNameValidationError) }); - throw new Error('Project name validation error.'); + if (!cloneProjectData.name) { + if (!metadata.projectName.trim()) { + setErr({ error: true, message: intl.formatMessage(messages.noProjectName) }); + throw new Error('Missing project name.'); + } + if (!/^[a-zA-Z]/.test(metadata.projectName)) { + setErr({ error: true, message: intl.formatMessage(messages.projectNameValidationError) }); + throw new Error('Project name validation error.'); + } } if (!metadata.geom) { setErr({ error: true, message: intl.formatMessage(messages.noGeometry) }); From df35b0666c47257f3db92c25cd13dab7708e7b73 Mon Sep 17 00:00:00 2001 From: DK Benjamin Date: Tue, 28 May 2024 15:44:57 -0400 Subject: [PATCH 7/7] Update AWS resource tags for cost tracking --- .../tasking-manager.template.js | 126 +++++++++++++++--- 1 file changed, 110 insertions(+), 16 deletions(-) diff --git a/scripts/aws/cloudformation/tasking-manager.template.js b/scripts/aws/cloudformation/tasking-manager.template.js index 697eed07c4..7a3899dcab 100644 --- a/scripts/aws/cloudformation/tasking-manager.template.js +++ b/scripts/aws/cloudformation/tasking-manager.template.js @@ -399,15 +399,15 @@ const Resources = { Value: cf.stackName }, { - Key: 'Project', - Value: 'Tasking Manager' + Key: 'project', + Value: 'tasking-manager' }, { - Key: 'Tool', - Value: 'Tasking Manager' + Key: 'tool', + Value: 'tasking-manager' }, { - Key: 'Maintainers', + Key: 'maintainers', Value: 'dakota.benjamin and yogeshgirikumar' }, { @@ -495,15 +495,15 @@ const Resources = { Value: cf.stackName }, { - Key: 'Project', - Value: 'Tasking Manager' + Key: 'project', + Value: 'tasking-manager' }, { - Key: 'Tool', - Value: 'Tasking Manager' + Key: 'tool', + Value: 'tasking-manager' }, { - Key: 'Maintainers', + Key: 'maintainers', Value: 'dakota.benjamin and yogeshgirikumar' }, { @@ -654,7 +654,26 @@ const Resources = { SecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'elbs-security-group', cf.region]))], Subnets: cf.ref('ELBSubnets'), Type: 'application', - Tags: [ { "Key": "stack_name", "Value": cf.stackName } ] + Tags: [ { + "Key": "stack_name", + "Value": cf.stackName + }, + { + Key: 'project', + Value: 'tasking-manager' + }, + { + Key: 'tool', + Value: 'tasking-manager' + }, + { + Key: 'maintainers', + Value: 'dakota.benjamin and yogeshgirikumar' + }, + { + Key: 'environment', + Value: cf.ref('NetworkEnvironment') + } ] } }, BackendAPIDNSEntries: { @@ -707,7 +726,28 @@ const Resources = { Port: 8000, Protocol: 'HTTP', VpcId: cf.importValue(cf.join('-', ['hotosm-network-production', 'default-vpc', cf.region])), - Tags: [ { "Key": "stack_name", "Value": cf.stackName } ], + Tags: [ + { + "Key": "stack_name", + "Value": cf.stackName + }, + { + Key: 'project', + Value: 'tasking-manager' + }, + { + Key: 'tool', + Value: 'tasking-manager' + }, + { + Key: 'maintainers', + Value: 'dakota.benjamin and yogeshgirikumar' + }, + { + Key: 'environment', + Value: cf.ref('NetworkEnvironment') + } + ], Matcher: { HttpCode: '200,202,302,304' } @@ -755,7 +795,7 @@ const Resources = { }, Properties: { Engine: 'postgres', - AllowMajorVersionUpgrade: true, + AllowMajorVersionUpgrade: true, DBName: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresDB')), EngineVersion: cf.ref('DatabaseEngineVersion'), MasterUsername: cf.if('UseASnapshot', cf.noValue, cf.ref('PostgresUser')), @@ -768,7 +808,25 @@ 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]))], - PubliclyAccessible: false + PubliclyAccessible: false, + Tags: [ + { + Key: 'project', + Value: 'tasking-manager' + }, + { + Key: 'tool', + Value: 'tasking-manager' + }, + { + Key: 'maintainers', + Value: 'dakota.benjamin and yogeshgirikumar' + }, + { + Key: 'environment', + Value: cf.ref('NetworkEnvironment') + } + ] } }, TaskingManagerReactBucket: { @@ -779,7 +837,25 @@ const Resources = { ErrorDocument: 'index.html', IndexDocument: 'index.html' }, - AccessControl: "Private" + AccessControl: "Private", + Tags: [ + { + Key: 'project', + Value: 'tasking-manager' + }, + { + Key: 'tool', + Value: 'tasking-manager' + }, + { + Key: 'maintainers', + Value: 'dakota.benjamin and yogeshgirikumar' + }, + { + Key: 'environment', + Value: cf.ref('NetworkEnvironment') + } + ] } }, TaskingManagerReactBucketPolicy: { @@ -908,7 +984,25 @@ const Resources = { MinimumProtocolVersion: 'TLSv1.2_2021', SslSupportMethod: 'sni-only' } - } + }, + Tags: [ + { + Key: 'project', + Value: 'tasking-manager' + }, + { + Key: 'tool', + Value: 'tasking-manager' + }, + { + Key: 'maintainers', + Value: 'dakota.benjamin and yogeshgirikumar' + }, + { + Key: 'environment', + Value: cf.ref('NetworkEnvironment') + } + ] } },