pulsar-edit / package-backend

Pulsar Server Backend for Packages
https://api.pulsar-edit.dev
MIT License
11 stars 11 forks source link

Add `owner` field to `packages` table… #215

Closed savetheclocktower closed 6 months ago

savetheclocktower commented 6 months ago

…along with a script for extracting the owner from the repo URL.

Description of the Change

Add an owner field to the packages table. The goal here is eventually to allow the frontend to query all packages that are owned by a specific GitHub organization.

This is a distinct concept from the backend's (or frontend's) idea of a “user,” since a user can publish a package to an organization they don't own. For example, the linter-eslint-node package was owned by the AtomLinter organization, and a user would expect to see as much when looking at the package card on the frontend. If they clicked on AtomLinter, they'd want to see other packages owned by AtomLinter. The fact that I, user savetheclocktower, was usually the one publishing those packages is irrelevant.

confused-Techie commented 6 months ago

Taking a quick look here, overall these changes look fantastic!

Love especially that you took the chance to fix some minor errors in docs, as well as renaming the variables for pagination like you mentioned in #213.

The only thing I'd be super concerned about besides testing which we are discussing on Discord, is to ensure that all other pagination returns match the new names used here. Since if memory serves theres a couple more endpoints that utilize this.

savetheclocktower commented 6 months ago

OK, the tests are passing, so I'm going to take this out of draft.

@confused-Techie, let me know what you think of the add-owner-field.js script and whether it should behave any differently. I don't have a great way of testing it, but it was working in the contrived scenario I set up.

savetheclocktower commented 6 months ago

No problem! Don't have write access to this repo, so this one is on you to merge.