pulsar-edit / package-backend

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

Bundled Packages #240

Closed confused-Techie closed 4 months ago

confused-Techie commented 5 months ago

Requirements

Description of the Change

WIP: This PR aims to allow better handling of Bundled Packages at the backend level. With the following goals:

Daeraxa commented 5 months ago
  • Each file must have a top level property readme that contains the README.md of the package.
  • Each file must have a top level property metadata that contains the important bits of the package.json.

Is there any way we can handle this more programatically? Honestly I'm not sure what this could look like at a logical level but I'm all for reducing data duplication where at all possible - this could easily get out of sync as and when PRs are made to our package readmes etc.

confused-Techie commented 5 months ago

@Daeraxa Thanks for the review!

But that's a fantastic question.

At the simplistic level, I'd like to create an action that clones the pulsar repo locally, and scans through the packages directory to grab the majority of this information. But there's three big concerns that I don't know how to handle.

Feel free to expand on this or provide ideas, and I'll check in tomorrow

Daeraxa commented 5 months ago
  • What to do about core non-bundled packages? Those that don't exist in Pulsar yet. We could rely on the repository key being set, but does feel clunky, and would mean the file has to already exist.

I'm tempted to say that in this hypothetical programmatic approach, for simplicity, these would remain manual - then when they do become bundled the data can overwrite. Alternatively could they be pulled in as submodules or something and do some other kind of magic?

When do we do this update? Could we detect changes to those repos in CI over there and trigger an action here? Do we just set it to happen on the 16th of every month and assume the 15th will stay as release day?

Can we use actions to just check for commits being made to those packages? Specifically to the files we are interested in (readme, package.json)?

Do we care if incorrect data is returned to those using an older version of Pulsar? I know they can get the right data still in settings-view but I wonder if that's a concern? Likely not a big one, since already this data is the most up to date, even if not compatible with a specific users install of Pulsar for community packages

As we don't maintain an LTS type release or support older versions I don't think this is an issue. At most there could be a disparity between rolling and regular but I don't think this should be an issue, the PPR should purely reflect the actual state of itself regardless of what might be in a release.

confused-Techie commented 5 months ago

@Daeraxa You make good points. The only real thing of substance I have to add currently is that I know for a fact that we can optionally trigger CI Actions on the Pulsar repo depending on the path of where changes have occurred. But I do not know if it's possible for us to do that here.

But glad we seem to be on the same page about a solution to versioning, that is there is none. Which seems perfectly fine to me.


I'll keep playing with this, since of course this PR needs to actually be utilized elsewhere in the code. But then of course seeing as to how we can keep it up to date with as minimal effort as possible. For a first pass we may even want to wait on that detail to simply have it functional

confused-Techie commented 5 months ago

Well @Daeraxa I've found a way to auto update the Bundled package information, which is present on my last commit. With the only unresolved question of being how we trigger this, but glad to see we have something that seems to be working