data-dot-all / dataall

A modern data marketplace that makes collaboration among diverse users (like business, analysts and engineers) easier, increasing efficiency and agility in data projects on AWS.
https://data-dot-all.github.io/dataall/
Apache License 2.0
228 stars 82 forks source link

Title parametrization on Frontend #820

Open InasK6 opened 11 months ago

InasK6 commented 11 months ago

Is your feature request related to a problem? Please describe. Per request from multiple customers to have the ability to change and customize the name displayed on the data.all portal

Describe the solution you'd like Parametrizing using an environment variable with one single entry point for the name being a parameter in the cdk.json file. The steps would be:

We could as next steps, add this parametrization to documentation and backend logs as well :)

Additional context Expected result: data.all has been replaced by Agora in the Portal title and the chrome window title

Capture d’écran 2023-10-19 à 10 10 08 Capture d’écran 2023-10-19 à 10 13 10 Capture d’écran 2023-10-19 à 10 13 22

The previous screenshot shows the same parametrization conducted as well for Environment and Dataset. In our case, we replaced them by Data Domain and Data Product to keep the Data Mesh vocabulary

dlpzx commented 10 months ago

Nice! This is a feature that I think every customer has implemented, so the impact is great! Are you going to contribute it @InasK6?

InasK6 commented 10 months ago

hello @dlpzx yes I can contribute with a PR, I already have the code implementation on a fork with v1.6. I need to bring the code to my fork with v2. Should I wait for this week's release before creating the PR in order to rebase on top of the main latest version ? I saw in the release guidelines "We have modified the configuration of the data.all deployment to allow configuration to be stored in SSM and make it independent of the source code which might overwrite your configuration in the cdk.json and cdk.context.json files." Does the environment variable I want to add to cdk.json be stored in a parameter store instead ? I am not sure where the entry point would be in that case

dlpzx commented 10 months ago

Hi @InasK6, thank you for the quick response! We can create the PR in Draft state to see your code and then make decisions based on that. We can always point the PR to a different branch or close the Draft PR in favor of another PR, but it will help us on understanding your design and propose changes if needed.

Regarding the cdk.json in SSM, that feature has been there for a while, I am pretty sure your version has it already. What it does is that

  1. first checks if there is a particular SSM parameter created
  2. if no, use the values of cdk.json and cdk.context.json for deployment - As explained in the guide
  3. if yes, use the values of that SSM parameter for the cdk context (cdk.json + cdk.context.json) - Needed for customers and for ourselves when we do not want to expose AWS accounts and data in the repo but still want to deploy from GitHub

So the conclusion is that in general cdk.json in repo = SSM cdk json parameter. However, I am guessing that you pass the parameter to the .env file of the frontend and then it might be handled a little differently. Luckily, this is an issue that is solved in V2. The configuration parameters are split between cdk.json (deployment parameters) and config.json (application parameters). The config.json file is accessible from both frontend and backend code at anytime, you do not need to worry about writing the value in the .env file, you could access the config values directly. In this PR there are some additional utilities and examples of their usage for the frontend.

Let me know if everything is unclear and thank you for the work :)

InasK6 commented 10 months ago

thank you for the clarification @dlpzx , very clear. Indeed I was passing the parameter from cdk.json to the .env file through the pipeline definition. I will check the details of how to use config.json file from the frontend code then and create the PR in the following weeks :)