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

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 this issue Sep 13, 2024 · 2 comments · May be fixed by #787

Comments

@ombhardwajj
Copy link
Contributor

ombhardwajj commented Sep 13, 2024

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:

  • Make sure that database , collection and permissionsgroup are created if and only if they dont exist

Related Issue : avniproject/avni-product#1562

@ombhardwajj ombhardwajj changed the title Add a check to avoid duplicate database creation when API to setup Metabase is hit [DMP 2024] Add a check to avoid duplicate database and collection creation when API to setup Metabase is hit [DMP 2024] Sep 13, 2024
ombhardwajj added a commit to ombhardwajj/avni-server that referenced this issue Sep 13, 2024
@ombhardwajj ombhardwajj changed the title Add a check to avoid duplicate database and collection creation when API to setup Metabase is hit [DMP 2024] Add a check to avoid duplicate database , collection and Permissionsgroup creation when API to setup Metabase is hit [DMP 2024] Sep 13, 2024
ombhardwajj added a commit to ombhardwajj/avni-server that referenced this issue Sep 14, 2024
ombhardwajj added a commit to ombhardwajj/avni-server that referenced this issue Sep 14, 2024
@ombhardwajj ombhardwajj changed the title Add a check to avoid duplicate database , collection and Permissionsgroup creation when API to setup Metabase is hit [DMP 2024] Add a check to see if database , collection and Permissionsgroup already exist when API to setup Metabase is hit [DMP 2024] Sep 15, 2024
@ombhardwajj ombhardwajj linked a pull request Sep 15, 2024 that will close this issue
@petmongrels
Copy link
Contributor

petmongrels commented Oct 9, 2024

  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 added a commit to ombhardwajj/avni-server that referenced this issue Oct 17, 2024
ombhardwajj added a commit to ombhardwajj/avni-server that referenced this issue Oct 17, 2024
@ombhardwajj
Copy link
Contributor Author

ombhardwajj commented Oct 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code Review with Comments
Development

Successfully merging a pull request may close this issue.

2 participants