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

Reverse Dependencies indexed on PackageName #1082

Merged
merged 7 commits into from
Jan 1, 2023
Merged

Reverse Dependencies indexed on PackageName #1082

merged 7 commits into from
Jan 1, 2023

Conversation

ysangkok
Copy link
Member

@ysangkok ysangkok commented May 30, 2022

This is #723, but rebased and rewritten to use PackageNames in its Graph instead of PackageIdentifiers.

It also includes tests and a benchmark. I have changed various page names to have more consistent naming, but the core UI is the same. These are the new paths, they all serve HTML. Note that I don't have the full Hackage package set mirrored, so the screenshots do not reflect exactly how it would look like if deployed.

/package/:package/reverse

image

/package/:package/reverse/old

image

/package/:package/reverse/flat

image

/package/:package/reverse/verbose

image

This page can be really expensive to generate (like tens of seconds for a popular package like containers). That's why I limited it to only show the oldest 10 versions, and I was thinking that if the CDN is configured to aggressively cache this for like a week, this could still be useful.

/packages/reverse

screenshot

(screenshot doesn't show it, but there is a version number in the vertical middle of the left table field in the lower table)

Given that this runs on all packages, it is also expensive to generate for the full package set of 16k packages. But since it only deals with counts, and doesn't actually look up the packages, it is way faster than the /verbose endpoint. This could also be aggressively cached.

There is also a graph page which I haven't included here since it is identical to the previous PR (implemented by revJSON).

Looking forward to any kind of feedback, since I am not really sure where to prioritize at this point.

EDIT: Added strike-through on sections referring to the slow /verbose endpoint as the code is now much faster.

@andreasabel
Copy link
Member

Thanks for making a move on this @ysangkok !

Looking at the screenshots, I would like that all quantitative information is communicated via tables, rather than its loud-reading, simply because one can then get the information at one glance. E.g.

Packages depending on containers

total on latest version on older versions
42 38 4

A legend could be given as a tool-tip (hovering) if the table isn't self-explanatory.

@ysangkok
Copy link
Member Author

ysangkok commented Jun 1, 2022

Good suggestion, @andreasabel , thank you. I have implemented your suggestions in commit b168fb6.

If anyone would like new screenshots, please let me know.

@andreasabel
Copy link
Member

If anyone would like new screenshots, please let me know.

If it is not too much work, it would make sense to update the screenshots in the OP.

@ysangkok
Copy link
Member Author

@andreasabel The screenshots have been updated as requested.

I pushed a commit that massively speeds up the code. Now the /verbose list of reverse dependencies performs acceptably:

$ time curl -s "http://localhost:8080/package/containers/reverse/verbose" -o /dev/null
0.03s user 0.01s system 28% cpu 0.119 total

@gbaz
Copy link
Contributor

gbaz commented Jul 20, 2022

I pushed a commit that massively speeds up the code

The diff is pretty large (perhaps because of the rebase?) -- can you explain what the speed up comes from?

@ysangkok
Copy link
Member Author

@gbaz Yes, it just comes from storing the list of dependencies for each package id in memory. That way, each cabal file is parsed only once. Here is the line that adds that map: 7f41c8b#diff-f1e6c87a39d7bc21d74de6224c837864dc413584c9fc37e6a2f6daa25db82834R70

@gbaz
Copy link
Contributor

gbaz commented Dec 31, 2022

Happy new year @ysangkok ! Do you feel this is ready for merge, or is there anything you meant to get to but didn't?

@gbaz gbaz merged commit 4d0bd17 into haskell:master Jan 1, 2023
gbaz added a commit that referenced this pull request Jan 5, 2023
* delete unused GitHub Action; fix CI badge

* Fix #1076: separate validators from UI and doctest them (#1077)

* Cachix caching for nix-shell GitHub Action (#1081)

* Add uploaded_at field in package api (#1080)

* package page: Include virtual-modules in module tree (#1085)

* Allow hashable-1.4 and text-2.0 (#1089)

* Divide sitemap into parts

* Add sitemap link for subdirectories

* Fix `non-canonical-return` warnings

* Bump CI to GHC 9.2.3 and restrict to master branch

* Check authorisation (#1111)

* Dynamically add css piece

* Fix #1105: change order of markdown parsers to allow pipes in lists

* Fix #1128, fix #1130 by adding bounds to Cabal-syntax and haddock-library

* Bump CI to 9.2.4 and some deps

* Force .txt and .text to have UTF-8 MIME charset (#1133)

* Upgrade to haddock-library-1.11.0 (#1126)

* attempt to speed up GitHub Action for Nix Shell

* work with cabal 3.8

* Updated accepted licenses (#1092)

* Add dependabot for github workflows

* Bump cachix/cachix-action from 10 to 12

* Bump actions/checkout from 2.4.0 to 3.1.0
* Bump cachix/install-nix-action from 17 to 18

* Build with Cabal-3.8 and GHC 9.4 (#1141)

* Haskell CI: bump to Ubuntu-22.04, GHC 9.2.5 and 9.4.4

* Allow mtl-2.3 and transformers-0.6 (#1150)

* Disable test (#1124)

* allow disable tests on client side

* add deprecated version warning (#1123)

* List maintainers on package page (#1098)

* List maintainers on package page

* Vendor snowball package (#1116)

* Add searchbox metadata (#1115)

* Add captcha for user registration (#1099)

* remove filtering 00-index for cabal version < 2.0 hack (#1152)

* Add lastVersion in listings (#749) (#1140)

* rm icu dep instructions, add libgd

* Add test log display (#1100)

* Add test log

* Reverse Dependencies indexed on PackageName (#1082)

* Rebased Reverse Dependencies

* Add "Quick Jump" to candidate package page (#1122)

* Solves #1029 - Adds paging to recent packages and recent revisions (#1055)

* support for `prefers-color-scheme` (#1008)

* 2x brightness for captions and links in dark color scheme

* table dark color scheme

* prefers-color-scheme for links, footer, and table-of-contents

* paginator css for `prefers-color-scheme`

* Maintainer notifications

* cleanup partial functions for revdeps, elim use of MonadThrow, MonadCatch

* fix tests enablement link

Co-authored-by: Peter Becich <peterbecich@gmail.com>
Co-authored-by: Andreas Abel <andreas.abel@ifi.lmu.de>
Co-authored-by: Hécate Moonlight <Kleidukos@users.noreply.github.com>
Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
Co-authored-by: ˌbodʲɪˈɡrʲim <andrew.lelechenko@gmail.com>
Co-authored-by: Alias Qli <2576814881@qq.com>
Co-authored-by: Ondřej Kubánek <71923533+kubaneko@users.noreply.github.com>
Co-authored-by: Gautier DI FOLCO <gautier.difolco@gmail.com>
Co-authored-by: Janus Troelsen <ysangkok@gmail.com>
Co-authored-by: Levi Butcher <31522433+LeviButcher@users.noreply.github.com>
@ysangkok ysangkok deleted the janus/rebased-revdeps branch May 1, 2023 03:58
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