fix: preserve filters on breakdown limit change
[!IMPORTANT] 👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Problem
Closes #32654
Changes
- When changing the breakdown limit, preserve existing breakdown information.
Did you write or update any docs for this change?
- [ ] I've added or updated the docs
- [ ] I've reached out for help from the docs team
- [x] No docs needed for this change
How did you test this code?
I have tested the fix manually:
- Opened a Dashboard with configured breakdown
- Changed the Breakdown limit
- Before the fix it was clearing out the filter, after the fix - it's preserved
Also, I adjusted the unit tests of the filter logic, to include the case of preserving breakdown.
Hi @anirudhpillai! Thank you for the approval. Locally everything seems fine, looks like some jobs are failing though:
- Build the Docker image with Depot - segmentation fault on NPM packages installation
- Build and cache Docker image in Depot - "Error: Username and password required"
- Capture running time to PostHog - "You must pass your PostHog project's api key."
The 1st one seems unclear (could be anything, including a flaky Depot worker), while the rest of them could be because I'm an external contributor, so the GH credentials may be inaccessible for the PR from the fork.
Could you please help me progress with that? I'm completely fine even with someone from the PostHog team recreating the commit on their own with proper permissions, if that would be the fastest and preferred way. 🙂
so sorry about this @rangoo94 , if you reraise this PR from a new branch of the PostHog repo and not from a fork, then the CI should run successfully!
https://github.com/PostHog/posthog/pull/29073/files/7890c520184280bb45aaa1f8da29cf5ce99e376e..cb59a9d833f0020361f0b9b001de85cd829d8f93
Thank you @anirudhpillai for checking, as I suspected 🙁 Sorry for the unnecessary problem, I thought that the external contributions were working fine.
if you reraise this PR from a new branch of the PostHog repo and not from a fork, then the CI should run successfully!
Unfortunately, as an external person, I don't have write access to the repository, so I cannot create the branch here. Please feel free to open the branch on your own even just copying my changes 🙂
Probably something like that could help:
# Fetch from fork to the local repository
git fetch "https://github.com/rangoo94/posthog.git" "fix/32654-breakdown-limits-removes-filters"
# Checkout local branch in there
git checkout -b "fix/32654-breakdown-limits-removes-filters" FETCH_HEAD
# Push to original repository
git push origin "fix/32654-breakdown-limits-removes-filters"
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.