Commit graph

126 commits

Author SHA1 Message Date
78a66dc089 Add migration script for content-addressed artifacts 2024-01-09 13:32:13 +00:00
bfa06c95f8 whitespace-cleanup 2023-09-19 15:07:47 +02:00
848186bd1a make the expiry of jobs configurable via cli (default 30) 2023-09-19 15:07:47 +02:00
fde834ad02 Initialize rng 2023-09-19 15:07:12 +02:00
89f2c54973 Fix migrate-2023-09-11 by dropping hte index first 2023-09-18 14:09:54 +02:00
207252401f auto-format 2023-09-12 13:10:10 +02:00
3fe8bcb997 Add migration for modified index 2023-09-11 12:31:11 +02:00
a333d4eb9d verify_cache_dir: only consider where main_binary is present 2023-09-11 11:10:03 +02:00
c2cf97436d whitespace cleanup in builder_db_app 2023-09-11 11:10:03 +02:00
6f30d5d144 Fix build of builder-web with more recent packages:
Cstruct.copy is deprecated
Mirage_crypto_rng_unix.initialize requires the RNG module as paramater (since mirage-crypto-rng 0.11.0)
Lwt_result.catch takes a function (unit -> 'a Lwt.t) since lwt 5.7.0
2023-08-25 10:09:21 +02:00
f666c9d0d1 Improve builder-web setup error messages
Give hints what to do in case the database file does not exist, or when
the database is not of the expected version.

Addresses #82
2022-07-15 12:52:21 +02:00
rand00
3e23b4a5bf Implemented general error-handler + Added special error-page for iframes/vizs 2022-07-15 10:51:57 +02:00
rand00
c533ea7c07 Made Builder_web.routes be a list of methods, routes and handlers - to become testable without depending on DB 2022-07-12 13:14:52 +02:00
rand
5307a7b91a add builder-db verify-cache-dir command (#113)
Co-authored-by: rand00 <oth.rand@gmail.com>
Co-authored-by: Reynir Björnsson <reynir@reynir.dk>
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/113
Co-authored-by: rand <rand@r7p5.earth>
Co-committed-by: rand <rand@r7p5.earth>
2022-06-16 09:03:05 +00:00
09a180c3cd Automatic viz migration on builder-web startup (#111)
Co-authored-by: rand00 <oth.rand@gmail.com>
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/111
Co-authored-by: Reynir Björnsson <reynir@reynir.dk>
Co-committed-by: Reynir Björnsson <reynir@reynir.dk>
2022-06-08 10:18:46 +00:00
da2aa77b53 M20220509 changes
* Do not depend on the uuid representation in Builder_db.Rep; instead
  copy the custom caqti type so the migration doesn't break if
  Builder_db.Rep changes
* We don't need to recreate any indices since we don't change the
  schema: The uuid column was erroneously VARCHAR(36) before as well(!)
2022-05-17 12:14:39 +02:00
bfc4e5e64f Update m20220509 to new caqti syntax 2022-05-16 15:57:58 +02:00
rand00
bca4c80127 Creating index for uuid after migration, and dropping on rollback 2022-05-16 15:43:58 +02:00
rand00
a45b373019 Migration changing uuids from byte to hex format in db 2022-05-16 15:43:58 +02:00
3de78b1113 Update to dream.1.0.0~alpha4
- Dream.path is deprecated. For now the deprecation is suppressed.

- Remove unused dream_svg.

- Remove datadir global. The datadir variable is in scope already, and
  global variables were removed in alpha3.

- Dream_tar.tar_response: flush before closing. It's unclear if this is
  necessary.

- Change Builder_web.add_routes to Builder_web.routes returning a list
  of routes, and in Builder_web_app construct the router.

- Builder_web.not_found is removed due to changes in Dream.router. It
  seems an error handler might be the way forward.
2022-04-22 12:37:01 +01:00
6e75a653bc Update to caqti 1.8.0 2022-04-22 12:20:43 +01:00
rand
0f493e9b47 Removing trailing slashes (#80)
This PR solves the issue of there being both "<url>/" and "<url>" paths, that in the builder-web context shouldn't mean different things.

The slashes are now removed using a `Dream` middleware, and the request is redirected using a permanent redirect (that doesn't change the method used): https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location

Notable changes:
* Trailing slashes from the hardcoded link urls were removed, as unneccesary redirects are then avoided.
* All links in `Views` were rewritten to be absolute instead of relative.
* As `Dream` deprecated `path` - `Utils.Path` was created containing some helpers for manipulating paths. *Note that `String.split_on_char` has a different semantics.*
* A blacklist `routeprefix_blacklist_when_removing_trailing_slash` was added, containing `Dream` route-prefixes to ignore.
* Only `GET` and `HEAD` requests are redirected.
* `redirect_parent` helper was rewritten using new `Utils.Path` functions to avoid brittle string manipulation + fixed the edgecase of redirecting to `/`.
* Added `Uri` dependency to make URL manipulation safer.

Co-authored-by: rand00 <oth.rand@gmail.com>
Co-authored-by: Reynir Björnsson <reynir@reynir.dk>
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/80
Co-authored-by: rand <rand@r7p5.earth>
Co-committed-by: rand <rand@r7p5.earth>
2022-04-21 10:40:21 +00:00
rand00
6a1c8b0ecd Builder_web_app: Fixed type-error + some 80-column fixes 2022-04-11 18:12:23 +02:00
1adc67c297 minor nits 2022-04-11 16:26:58 +02:00
rand00
68849fecf3 Fixed that cachedir should default to being relative to given datadir 2022-04-06 13:47:07 +02:00
rand00
1207ddbf70 Merge branch 'main' into 20220329_passing_separate_cache-dir 2022-04-06 13:31:42 +02:00
rand00
ab3be6ec8e builder-web: Added --cachedir CLI arg for staging new vizs 2022-03-29 22:27:24 +02:00
rand00
462859f4fb Builder-viz: Changed sharing-stats to be based on direct deps instead of transitive 2022-03-18 13:16:26 +01:00
rand00
34a8bf9160 Builder-viz: Passing transitive deps stats for coloring of nodes in opam-graph 2022-03-17 16:31:07 +01:00
rand00
60ee718160 Merged with main/master 2022-03-16 12:10:25 +01:00
rand
b2b593796a Merge pull request 'Supporting new modulectomy scoping of CSS' (#98) from 20220315_supporting_new_modulectomy_scoping_of_CSS into main
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/98
2022-03-16 11:03:06 +00:00
b6f6090ce5 Merge branch '20220221_fix_cmdliner_deprecations'
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/87
2022-03-16 10:42:35 +00:00
rand00
f68f383ba6 Fixed all binaries using cmdliner to avoid newly deprecated functions 2022-03-16 10:40:35 +00:00
rand00
1bcb6d0cef Merged with stash 2022-03-15 18:41:57 +01:00
rand00
bfd0299844 Builder-viz: Supporting new modulectomy scoping of CSS 2022-03-15 13:15:25 +01:00
rand00
5897484cb2 Fixed that Builder_db_app.job_remove didn't take all related tables into account
+ Added a function for making a db-id into an int64 for printing
2022-02-22 13:16:42 +01:00
Robur
7bb9e2d8fe Allow -d as well as --datadir in commands
Fixes #86
2022-02-21 13:08:58 +00:00
f7bc55f2e3 execute all executables in <conigdir>/upload-hooks when an upload succeeded
Only uploads with a single main binary invoke the hooks (since they use the
main_binary)
2022-02-21 13:05:16 +00:00
rand00
550dd59a19 Builder-web: Implemented better page-not-found 2022-02-21 12:13:51 +00:00
3fe07c7b34 Clean up trailing spaces 2022-02-01 11:43:07 +00:00
rand00
2a1b75ba2b Removals of uncommented code and unneccesary parens 2022-02-01 11:30:44 +00:00
rand00
302d53835a bin/Builder-viz: Added override_css params to viz's + used them to define a common theme 2022-02-01 11:30:44 +00:00
rand00
95ef54fc82 bin/Builder-viz: Added dependencies visualization 2022-02-01 11:30:44 +00:00
rand00
f3178cace0 bin/Builder-viz: Printing html + Syntax 2022-02-01 11:30:44 +00:00
rand00
289a58d9dc Refactored treemap visualization into separate binary + Cmdliner CLI interface 2022-02-01 11:30:44 +00:00
5d33d4cfaf builder-db: add extract-build command
This command synthesizes a file containing the ASN.1 representation of a
Builder build.
2021-12-07 17:13:21 +01:00
e57d880c44 sql: use $N instead of ?N as numbered placeholder 2021-11-18 11:40:15 +01:00
675b57a579 Rename Builder_db modules in bin/ and test/
They both depend on the Builder_db module in db/, and using the same
name confuses Merlin (as well as myself sometimes).
2021-11-15 15:12:16 +01:00
Robur
b43c6f4d79 Refactor default_datadir into library builder_system 2021-11-12 13:22:43 +00:00
977678b325 Detect datadir by platform 2021-11-12 13:04:51 +00:00