flora-pm / flora-server

A package index for the Haskell ecosystem
https://flora.pm/about
Other
126 stars 40 forks source link

[FLORA-219] Implement namespace browsing #375

Closed kenranunderscore closed 1 year ago

kenranunderscore commented 1 year ago

Proposed changes

As described in #219. I also added a link to the namespace in the package title; don't know if you want/like that, but I didn't know about Servant.Links before and wanted to try it out.

I have some remaining questions though:

  1. Some count* functions in Query.hs filter for the fully-imported status, some don't. I wasn't sure which to pick, so left it out for now.
  2. The new showNamespaceHandler is very similar to the indexHandler above, but I felt like "repeating" some easy steps or function is a deliberate choice when looking at some other code. Plus, extracting a function here would most likely mean having an Eff action as argument, which would require importing lots of stuff and IME not really make anything more flexible. How do you think about this?
  3. listAllPackagesInNamespaces does not log, like listAllPackages. But maybe both should?
  4. I'm not sure if I used Flora.Search.SearchAction the right way.

Contributor checklist

tchoutri commented 1 year ago
  1. The fully-imported status is pre-filtered by the latest_versions materialized view, sometimes you just don't need to re-do it. :)

  2. Let's leave it like that for now.

  3. Yes listAllPackagesInNamespaces should log.

  4. From a cursory glance it looks good. Have you tested the UI locally?

kenranunderscore commented 1 year ago

Ok, then I'll add some logging later on or tomorrow when I'm back at the computer. Constructing an object on the fly like in the same file above (with slightly different content) is alright?

Yeah, I've tested the UI locally. I quite liked the tmux setup. I just can't put my finger on what I don't get about the SearchAction. Maybe I have an idea what it might be, let me see if I can find it.

tchoutri commented 1 year ago

Ok, then I'll add some logging later on or tomorrow when I'm back at the computer. Constructing an object on the fly like in the same file above (with slightly different content) is alright?

Yes it's absolutely fine.

Yeah, I've tested the UI locally. I quite liked the tmux setup. I just can't put my finger on what I don't get about the SearchAction. Maybe I have an idea what it might be, let me see if I can find it.

Sure :)

kenranunderscore commented 1 year ago

I pushed the logging bit. Still not sure about showAllPackages(InNamespace) as in the review above, so I didn't change anything there.

tchoutri commented 1 year ago

@kenranunderscore yes, let's leave it as is. Perhaps the future will give us other avenues for refactoring. :)

kenranunderscore commented 1 year ago

Sure, I closed the review :)

tchoutri commented 1 year ago

@mergifyIO rebase

mergify[bot] commented 1 year ago

rebase

✅ Branch has been successfully rebased