avniproject / avni-server

Backend APIs for Avni
https://avniproject.org
GNU Affero General Public License v3.0
7 stars 25 forks source link

Add a check to see if database , collection and Permissionsgroup already exist when API to setup Metabase is hit [DMP 2024] #786

Open ombhardwajj opened 2 months ago

ombhardwajj commented 2 months ago

What

Currently when the API is hit more than once , the code stops executing when it reaches metabase Group creation Group metabaseGroup = groupPermissionsRepository.save(new Group(name)); but duplicate database and collection will be created. We need to stop this duplication.

Acceptance Criteria:

Related Issue : avniproject/avni-product#1562

petmongrels commented 1 month ago

1) minor comment - an error log file has been commited. other than removing it, you may also put a .gitignore for it. 2) new ObjectMapper() - I cannot tell from this commit alone, but in the codebase there should be only one place where ObjectMapper should be instantiated. We have a singleton in avni-server for this already - please use that. The reason for this is that new ObjectMapper() internally generates classes which would be private to that ObjectMapper.

ombhardwajj commented 4 weeks ago

I've replaced initialization of a new ObjectMapper with the ObjectMapperSingleton already present in avni-server 👍

mahalakshme commented 3 weeks ago

@himeshr QA can be done for this right? why it is moved to Done without QA?

himeshr commented 3 weeks ago

PR Merge auto-closed the Card.

@himeshr QA can be done for this right? why it is moved to Done without QA?