Skip to content

Conversation

@katydidnot
Copy link
Contributor

Bug: T404381
Change-Id: Ia8b81b55ac65d93e217abb5c2d6e9cd6437f56ec

Add the collection to URLPattern model object collection array.

Description

Describe your changes in detail following the [commit message guidelines]
This is needed to create the join table relationship in links_urlpattern_collections table.

Rationale

This is needed to create the join table relationship in links_urlpattern_collections table.

Phabricator Ticket

https://phabricator.wikimedia.org/T404381

How Has This Been Tested?

Added to existing unit tests and smoke tested locally.

Screenshots of your changes (if appropriate):

Types of changes

What types of changes does your code introduce? Add an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Bug: T404381
Change-Id: Ia8b81b55ac65d93e217abb5c2d6e9cd6437f56ec
@katydidnot katydidnot marked this pull request as draft September 11, 2025 19:11
@katydidnot katydidnot marked this pull request as ready for review September 11, 2025 19:54
@katydidnot
Copy link
Contributor Author

katydidnot commented Sep 11, 2025

@suecarmol
I was going to add the migration script, but when I ran:

LinkEvent.objects.filter(content_type__isnull=True).order_by("id")

in production, I'm getting 0 records back, which means the object relation is there, but the join table lookup is not there.
What this means is that the first time we collect a link from the event stream for

  • Barron's
  • Investor's Business Daily
  • MarketWatch
  • The Wall Street Journal

then it should add the join table entry and we should be good without needing to migrate any relationships.

@suecarmol
Copy link
Contributor

@suecarmol I was going to add the migration script, but when I ran:

LinkEvent.objects.filter(content_type__isnull=True).order_by("id")

in production, I'm getting 0 records back, which means the object relation is there, but the join table lookup is not there. What this means is that the first time we collect a link from the event stream for

* Barron's

* Investor's Business Daily

* MarketWatch

* The Wall Street Journal

then it should add the join table entry and we should be good without needing to migrate any relationships.

Remember that LinkEvents are being deleted daily. What I would do is perform a search in the aggregates to see where those link events were aggregated. Once we figure that out, we link those aggregates to the collections.

Copy link
Contributor

@suecarmol suecarmol 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 get this merged and see if the relationship appears.

@suecarmol suecarmol merged commit f7c2364 into master Sep 11, 2025
3 checks passed
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