diff --git a/.github/workflows/release-on-tag-push.yaml b/.github/workflows/release-on-tag-push.yaml index 9638084..3905ecb 100644 --- a/.github/workflows/release-on-tag-push.yaml +++ b/.github/workflows/release-on-tag-push.yaml @@ -1,44 +1,11 @@ name: "Publish release on tag push" on: - workflow_call: - inputs: - enableOpenApiToPostman: - description: "Flag to enable OpenAPI to Postman collection conversion" - type: boolean - required: false - default: true + push: + tags: + - "v*" jobs: - publish_release: - runs-on: ubuntu-latest - steps: - - name: Checkout code for CHANGELOG.md - uses: actions/checkout@v4 - - - name: Get package info - id: package - uses: codex-team/action-nodejs-package-info@v1 - - - name: Generate postman collection for service - uses: actions/setup-node@v2 - with: - node-version: "20" - - - name: Set File name - uses: myci-actions/export-env-var@1 - with: - name: P_COLLECTION_FILE_NAME - value: ${{ steps.package.outputs.name }}-v${{ steps.package.outputs.version }}-postman-collection.json - - - name: Generate Postman Collection - if: ${{ inputs.enableOpenApiToPostman == true }} - run: "npx openapi-to-postmanv2 -s openapi3.yaml -o ${{ env.P_COLLECTION_FILE_NAME }}" - - - name: Publish Release to Github - uses: softprops/action-gh-release@v1 - with: - body_path: CHANGELOG.md - files: ${{ env.P_COLLECTION_FILE_NAME }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + release_on_tag_push: + uses: MapColonies/shared-workflows/.github/workflows/release-on-tag-push.yaml@v3.1.0 + secrets: inherit diff --git a/README.md b/README.md index b2d92b9..805cd8c 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,20 @@ -# Map Colonies typescript service template - ----------------------------------- - -This is a basic repo template for building new MapColonies web services in Typescript. - -### Template Features: - -- eslint configuration by [@map-colonies/eslint-config](https://github.com/MapColonies/eslint-config) - -- prettier configuration by [@map-colonies/prettier-config](https://github.com/MapColonies/prettier-config) - -- jest - -- .nvmrc - -- Multi stage production-ready Dockerfile - -- commitlint - -- git hooks - -- logging by [@map-colonies/js-logger](https://github.com/MapColonies/js-logger) - -- OpenAPI request validation - -- config load with [node-config](https://www.npmjs.com/package/node-config) - -- Tracing and metrics by [@map-colonies/telemetry](https://github.com/MapColonies/telemetry) - -- github templates - -- bug report - -- feature request - -- pull request - -- github actions - -- on pull_request - -- LGTM - -- test - -- lint - -- snyk +# Geocoding-Enrichment +This service provides enrichment of the data that comes from MapColonie's [geocoding service](https://github.com/MapColonies/Geocoding), and saves the enriched data to elastic for BI purposes. ## API Checkout the OpenAPI spec [here](/openapi3.yaml) -userData Service:
-We use 3rd party software in order to extract user details from the userId. Here is a mock service that will preduce the somewhat expected response from the userData Service. +## Workflow +![Workflow Image](https://github.com/user-attachments/assets/0152dcb5-ece7-42a2-b630-116eaec6181d) + +## How does it work? +Once the requesting system sends the `request_id`, the `chosen_response_id`, and the `user_id` of the user who used [Geocoding](https://github.com/MapColonies/Geocoding) back to us using [Feedback api](https://github.com/MapColonies/feedback-api), that response is then combined with Geocoding's response and sent to Kafka, which then is consumed by Geocoding-enrichment.
+When the response reaches geocoding-enrichment, the service then attaches the `chosen_response_id` to the geocoding response to see what response the user selected.
+In addition to adding some data to the response, The service also uses the userData service in order to fetch the user's data and see who uses Geocoding.
+Once the data is enriched, it is stored in Elasticsearch which is connected to a Grafana Dashboard in order to be analyzed. + +## UserData Service: +We use an external ADFS in order to extract user details from the userId. Here is a mock service that will preduce the somewhat expected response from the userData Service. ``` const express = require('express'); @@ -62,7 +24,7 @@ app.set('port', 5000); app.use(express.json({ limit: '50mb' })); app.use(express.urlencoded({ limit: '50mb', extended: true })); -app.get("/mirage/:userid", (req, res) => { +app.get("/user_data/:userid", (req, res) => { console.log("new request", req.params, req.query); const { userid } = req.params; const users = { @@ -101,15 +63,14 @@ Clone the project ```bash -git clone https://link-to-project - +git clone https://github.com/MapColonies/Geocoding-Enrichment.git ``` Go to the project directory ```bash -cd my-project +cd geocoding-enrichment ```