Skip to content

compute top page origins for each collection #2483

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ikreymer
Copy link
Member

@ikreymer ikreymer commented Mar 14, 2025

A quick PR to fix #2482:

Screenshot:

Screenshot 2025-03-13 at 7 14 51 PM

Notes:

  • Could probably use some styling tweaks on the table.
  • Should we call them 'domains' or 'origins' or 'hosts'?

@ikreymer ikreymer requested review from SuaYoo and tw4l March 14, 2025 02:11
Copy link
Member

@tw4l tw4l left a comment

Choose a reason for hiding this comment

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

Looks good!

A few thoughts:

  • I think "Domains" makes sense here as more lay-friendly language than "Origins"
  • Will leave table styling comments to Sua, but tab-separated does seem to visually fit in with the kind of minimalist sidebar we have going
  • We seem to need a way to populate this. In the past we've had migrations (e.g. 0037) recalculate these stats across all orgs after modifying collections in some way, we could do that again or add an API endpoint to recalculate all of the collection stats in a background job?

origin: str
count: int


# ============================================================================
class Collection(BaseMongoModel):
Copy link
Member

Choose a reason for hiding this comment

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

Should we include topPageOrigins in the base Collection model too, since we're storing it there? Might be useful for e.g. org import/export to have it on the base model.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, perhaps can rename this to domains internally too? We can strip out the https:// with the regex too, but maybe useful to keep since RWP does treat them separately..

Copy link
Member

Choose a reason for hiding this comment

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

Yeah not a bad idea to rename internally, and I would keep the prefix I think

ikreymer added 2 commits April 8, 2025 16:22
- compute as part of existing collection stats compute
- store top 10 results in collection
- display in collection About sidebar
@SuaYoo SuaYoo force-pushed the add-top-page-origins branch from dc26da4 to 25cfe61 Compare April 8, 2025 23:23
@SuaYoo
Copy link
Member

SuaYoo commented Apr 8, 2025

Should this be available in public collections as well? Looks like topPageOrigins isn't returned at all, so it breaks the public collection view.

If it's only meant to be internal for now, seems like it could live in a "Stats" tab?

@tw4l
Copy link
Member

tw4l commented Apr 9, 2025

Should this be available in public collections as well? Looks like topPageOrigins isn't returned at all, so it breaks the public collection view.

Yes, I think it should be available in public collections as well. We could also use some tests to ensure this data is computed and returned as expected.

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.

[Feature]: Display top page domains/origins for each collection.
3 participants