Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WF2 to use Collections for referencing mapping logic instead of embedded mapping JSON in job code #87

Open
AishaHassen opened this issue Feb 5, 2025 · 0 comments
Assignees
Labels
Medium Complexity Level P2 Priority Level

Comments

@AishaHassen
Copy link
Collaborator

AishaHassen commented Feb 5, 2025

Background, context, and business value

The current implementation of WF2 is using the mappings.json that is manually inserted and hardcoded in the job code. To make the updating of the metadata mapping more dynamic and remove the manual copying and pasting of the mapping logic into the job code, we want to use the "mappings" object in the collections named metadata-mappings in the project to reference metadata mappings.

The specific request, in as few words as possible

Request Type: Change Request on WF2

  1. Update Mappings step:
  • Change the Adaptor for this job to Common since we are no longer fetching anything using an API
  • Add code to fetch metadata from collections named metadata-mappings
collections.get('metadata-mappings', "mappings")

  • Remove the lines that are hardcoding the data(line: 28)) and replace them with what we get from metadata-mappings collection
  • Ensure that the data object is being saved in state and being referenced in the following steps.
  • **Error Handling: ** If the mappings object does not exist in collections, ensure that the error is handled properly. The workflow should't crash but it should fail and subsequent steps should not execute.

Collections

  • The collection that we are consuming in this step has already been created and populated on this issue in msf-lime-mosul-staging project
  • Collection name: metadata-mappings
  • Object of interest in the collection: mappings

Project and Branch

Project: msf-lime-mosul-staging
Branch: staging

Testing Guidance

  • Run WF2 with mappings populated and ensure that the mappings that are saved in Collections are being used.
  • Run WF2 with mappings set to empty and ensure that the error is handled properly.

Toggl

MSF 2024

@AishaHassen AishaHassen added the P2 Priority Level label Feb 5, 2025
@AishaHassen AishaHassen changed the title Update WF2 to use Collections for referencing mapping logic instead of embedded mapping JSON in job code #86 Update WF2 to use Collections for referencing mapping logic instead of embedded mapping JSON in job code Feb 5, 2025
@mtuchi mtuchi added the Medium Complexity Level label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Complexity Level P2 Priority Level
Projects
None yet
Development

No branches or pull requests

2 participants