Reynir Björnsson reynir · he/him/his
  • Joined on 2024-08-21
reynir deleted branch json_responses from robur/builder-web 2024-12-20 11:46:48 +00:00
reynir merged pull request robur/builder-web#5 2024-12-20 11:46:47 +00:00
Add Json API to some endpoints
reynir approved robur/builder-web#5 2024-12-20 10:15:07 +00:00
Add Json API to some endpoints
reynir commented on pull request robur/builder-web#5 2024-12-20 09:54:31 +00:00
Add Json API to some endpoints

There are "standards" out there suggesting you use an "errors" field with an array of error objects: https://jsonapi.org/format/#error-objects

reynir commented on pull request robur/builder-web#5 2024-12-20 09:52:06 +00:00
Add Json API to some endpoints

This could certainly be made into a much more complicated object. I don't have strong opinions on that.

reynir pushed to json_responses at robur/builder-web 2024-12-20 09:47:17 +00:00
44e7cd566f Refactor accept: json logic, return json errors
reynir commented on pull request robur/builder-web#5 2024-12-20 09:32:14 +00:00
Add Json API to some endpoints

I pushed a few commits that address my own comments.

I also tweaked a bit the json fields. In particular, I dropped the build_ prefix of the fields and tried to make the field names and…

reynir pushed to json_responses at robur/builder-web 2024-12-20 09:30:02 +00:00
c670df643e Tweak json field names
2c44f88460 compare_builds json: return null if no main binary
23db42fed3 Rely on redirect also for Accept: json
92ee6b9aaf Yojson is now a non-test dependency
Compare 4 commits »
reynir commented on pull request robur/builder-web#5 2024-12-20 08:35:54 +00:00
Add Json API to some endpoints

Also, I think this function is only used in order to get the binary size? If so, then we can return that directly (as an option)

reynir commented on pull request robur/builder-web#5 2024-12-20 08:32:48 +00:00
Add Json API to some endpoints

Tbh here I think I would just keep the redirect and rely on job_build returning a json object that includes the uuid.

reynir commented on pull request robur/builder-web#5 2024-12-20 08:32:48 +00:00
Add Json API to some endpoints

The client would then need to follow redirects, of course.

reynir commented on pull request robur/builder-web#5 2024-12-20 08:32:48 +00:00
Add Json API to some endpoints

For consistency maybe drop the build_ prefix? Else I guess we should write build_uuid as well? :-)

reynir commented on pull request robur/builder-web#5 2024-12-20 08:32:48 +00:00
Add Json API to some endpoints

I don't like that we make up a main binary if it doesn't exist. Can we use an option? For example, "0" is not a valid sha256 checksum, -1 is not a valid size...

reynir commented on pull request robur/builder-web#5 2024-12-20 08:32:48 +00:00
Add Json API to some endpoints

Then here we could make build_size optional or have it be `Null if the file is None.

reynir commented on pull request robur/builder-web#5 2024-12-20 08:24:03 +00:00
Add Json API to some endpoints

The client would then need to follow redirects, of course.

reynir commented on pull request robur/git-kv#10 2024-12-19 14:13:35 +00:00
last_modified: don't find_blob; find the commit!

This is done in d2a0e526dad259f71fc7f741129aba8e476c8f7a. I found that there's no support for infix attributes on binding operators (.e.g let+) so I went with an intermediate binding.

https://…

reynir pushed to fix-last_modified at robur/git-kv 2024-12-19 14:06:31 +00:00
d2a0e526da Remove an assert false, and silence warning 8
reynir commented on pull request robur/git-kv#10 2024-12-19 13:36:46 +00:00
last_modified: don't find_blob; find the commit!

What do you suggest instead? Mute partial match warnings?

let [@@warning "-8"] (`Commit c) = Store.read_exn .. in
..
reynir commented on pull request robur/git-kv#10 2024-12-19 13:33:13 +00:00
last_modified: don't find_blob; find the commit!

Hm. To me it seems fine that digest returns the blob. As I understand it it's a digest that represents the file data. Maybe @dinosaure, who has a much better understanding of both git and…

reynir deleted branch mgit-mtime from robur/git-kv 2024-12-19 13:30:04 +00:00