posthog icon indicating copy to clipboard operation
posthog copied to clipboard

fix: preserve filters on breakdown limit change

Open rangoo94 opened this issue 7 months ago • 5 comments

[!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.

rangoo94 avatar May 26 '25 15:05 rangoo94

Hi @anirudhpillai! Thank you for the approval. Locally everything seems fine, looks like some jobs are failing though:

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. 🙂

rangoo94 avatar May 28 '25 21:05 rangoo94

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

anirudhpillai avatar May 29 '25 16:05 anirudhpillai

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"

rangoo94 avatar May 29 '25 17:05 rangoo94

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.

posthog-bot avatar Jun 06 '25 07:06 posthog-bot

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.

posthog-bot avatar Jun 16 '25 07:06 posthog-bot

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.

posthog-bot avatar Jun 26 '25 07:06 posthog-bot