- This Repository is a fork of metabase/metabase
Because we have introduced a few changes to the code, updating it should cause a lot of conflicts with the upstream.
To avoid unnecessary time consuming conflicts resolution, we can use the following strategy:
- Add metabase remote to the repository
git remote add metabase git@github.com:metabase/metabase.git
- Fetch the metabase remote
git fetch metabase
- Checkout to the tag we want to update to (ex: v0.48.5)
git checkout v0.48.5
- Create a new branch based on that tag
git checkout -b update/v0.48.5_dadosfera
- Cherry-pick the commit [Dadosfera] FEAT: Dadosfera changes
git cherry-pick e7b55ccd0d707aa8943d0b15d7852f13d3939eb2
This commit contains all changes we need to apply to metabase. It's important to keep it updated with every change we make to the code.
- Resolve the conflicts, paying close attention to the changes we have made to the code.
Sometimes the file we altered has been deleted in the upstream, but that doesn't mean the changes we made should be discarded. Check for new files that may have been added and that we may need to alter.
ex.:
Header.jsx
was deleted in the upstream, but we have made changes to it. Search for files namedHeader.tsx
or similars to see if the changes we made to should be applied to a new file.
- After resolving the conflicts, run the application to make sure everything is working as expected.
docker build --no-cache --build-arg="VERSION=latest" -t metabase_local:latest .
docker run -p 3000:3000 --name metabase_local metabase_local:latest
- If everything is working fine, commit the resolved conflicts using the same name as the previous
git commit -m "[Dadosfera] FEAT: Dadosfera changes"
Remember to commit all the necessary changes into a single commit, to help other updates in the future.
-
Copy the commit hash and description/title and save it to step 5 on this README, so it's always updated.
-
Push the changes and publish your branch on remote
git push origin update/v0.48.5_dadosfera
After updating the fork, we need to launch the changes to the staging and production branches. The pull request is the best way to do so, but it shold rise a lot of conflicts, since our new branch is based on metabase/metabase not dadosfera/metabase. To avoid that, we can use the following strategy:
- Reset stg branch to the new branch and force push
git checkout stg
git reset --hard update/v0.48.5_dadosfera
git push origin stg --force
This is a dangerous command, and is intended to be used by advanced git users. It will overwrite the remote branch with your local changes. If you are not sure about what you are doing, please ask for help.
-
Run the deploy to stg using metabase-deploy github action
-
Repeat steps for the production branch when all is validated on the staging environment