pulsar-edit / package-backend

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

Health Check Script #127

Closed confused-Techie closed 1 year ago

confused-Techie commented 1 year ago

Requirements

Description of the Change

Because of various bugs or issues during migration, it's possible that some packages saved on our database have invalid data.

This new tool implements a way we can attempt to locate invalid data. While far from finished it begins the tooling needed to let this happen.

By firstly creating the major portion of the script, and including the first health check.

Using the documentation at the start of the file, we can run npm run tool:health packageMetadata limit=10 to run the packageMetadata health check, and to set the limit of checked packages to 10 and get the following output:

> atom-backend@1.0.1 tool:health
> node ./scripts/tools/health-check.js packageMetadata limit=10

Health Check running in readonly mode.
..........

The package starrynight-helper::<packages-UUID> has invalid Package Metadata!
The package jscs-format::<packages-UUID> has invalid Package Metadata!
confused-Techie commented 1 year ago

Update I've now added versionTagExists to the health checks.

This will be able to detect if a specific package version has had it's tag deleted from GitHub. Which is the common issue we are now seeing with the latest bug, when a package author believes their tag failed to publish, then deletes the version associated.

confused-Techie commented 1 year ago

Additionally I've now added latestVersionIsAssigned to the health checks.

This will be able to detect if the latest version on the packages metadata is in fact the version marked as latest on the database.

Which is the behavior we would expect to see in #97