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

Update goal in segment #5027

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Update goal in segment #5027

wants to merge 10 commits into from

Conversation

ukutaht
Copy link
Contributor

@ukutaht ukutaht commented Jan 29, 2025

When a goal's display name is updated, this PR makes it so the segments containing that goal are also updated accordingly

@ukutaht ukutaht requested review from apata and aerosol January 29, 2025 10:08
Copy link
Member

@aerosol aerosol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments inline

lib/plausible/segments/segments.ex Outdated Show resolved Hide resolved
lib/plausible/goals/goals.ex Show resolved Hide resolved
%Plausible.Goal{} = stale_goal,
%Plausible.Goal{} = updated_goal
) do
goal_filter_regex =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires inline commentary so the reader won't have to wonder what are we trying to achieve here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, I spent quite a bit of time trying to replace the regex with a jsonpath query in postgres. It works great from the console but Postrex.DefaultTypes doesn't support it and would require a custom Ecto type to work. So I opted for leaving the regex and commenting it here: b80aa2d

@ukutaht ukutaht requested a review from aerosol February 4, 2025 10:37
Copy link
Member

@aerosol aerosol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go! 🚀

PS: @ukutaht If you have any notes/snippets from your jsonpath attempts, please share so maybe I could have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants