Skip to content

Proof of concept and API for app-center-ratings#1

Open
ZoopOTheGoop wants to merge 26 commits into
mainfrom
framework
Open

Proof of concept and API for app-center-ratings#1
ZoopOTheGoop wants to merge 26 commits into
mainfrom
framework

Conversation

@ZoopOTheGoop

@ZoopOTheGoop ZoopOTheGoop commented Feb 6, 2024

Copy link
Copy Markdown
Owner

For various reasons, this does not implement the entire Snapd API, that's a project and a half. However, after bounding between this and app-center-ratings this is usable.

Current limitations:

  • Need some more error types, a lot of the unwrap/expect calls are intentional, but in a few places I needed to figure out how to handle values.
  • Running low on documentation
  • Significant portion of the API missing (as mentioned)
  • The assertion parsing is a mess, this is due to snapd returning a completely different response format for it
  • No post endpoints
  • No authorization endpoints
  • Not all fields are covered in e.g. find - this is due to how many there are
  • Does not handle snapd error-kinds, this needs more research to implement

Positives:

  • Very close to zero allocations in decoding for endpoints with Json, many of the convenience methods allocate though. The JsonDecoder itself does allocate a buffer to collect all the Response values, but everything downstream of that explicitly opts into allocations unless it decides to take ownership manually.

However, as-is this is totally usable for our current purposes. It's also relatively easy to add new API endpoints, as long as they return JSON. Even implementing post shouldn't be that hard (may require a minor refactor, but not too bad).

The current API should be considered unstable.

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.

1 participant