v0.10.0 - Hand-written API clients and bucket file transfer
This release replaces the OpenAPI-generated API clients with hand-written ones on a shared HTTP base, adds file upload, download, and delete for Data Proxy buckets, and makes the Knowledge Graph stage argument consistent with the API. It also repairs a series of bugs in the bucket and KG functions, most of which were found by the new unit and live-integration test suites, and brings every public function and class up to the MathWorks help conventions.
Breaking changes
- The generated namespaces
ebrains.kgcore,ebrains.dataproxy, andebrains.collaboratoryno longer exist (#12). Useebrains.kg.api.InstancesClient,ebrains.kg.api.QueriesClient,ebrains.bucket.api.BucketsClient, andebrains.collab.api.CollabsClientinstead. KGStageno longer has anANYmember (#6).getInstanceandgetInstancesBulktake the stage as an ordered vector instead: pass["RELEASED", "IN_PROGRESS"]where"ANY"was used before.getInstance,getInstancesBulk,listTypes, andrunDynamicQuerynow default to theRELEASEDstage (#6). Callers that omitted the stage and relied on drafts now get released data, or a 404 for an unreleased instance. Pass"IN_PROGRESS"or the two-stage vector explicitly.EBRAINS_TOKENis read from the environment only (#24). A token kept in the MATLAB secret store is no longer picked up and must be exported as an environment variable.
Added
ebrains.bucket.uploadFile,ebrains.bucket.downloadFile, andebrains.bucket.getFileSizefor transferring files to and from Data Proxy buckets, with progress display andClient=injection (#10). Downloads arrive in a.partfile and are moved into place on completion, so a failed transfer leaves the target untouched.ebrains.bucket.deleteObjectfor single objects and, with a trailing slash, whole folders (#16).resetAllon the base IAM token client, which clears every OIDC token client singleton at once (723dd5d).getInstancesBulkgains an optionalmissingIdsoutput; a caller that asks for it gets no warning and handles the misses itself (d07a56e).ebrains.bucket.createVirtualBucketgains theClient=name-value argument the rest of the namespace already had (#18).codemeta.jsondescribing the toolbox, kept current by the release workflow from this release onwards (#15).- The filedownload library is vendored as
ebrains.external.filedownload, sogetBucketObjectno longer depends on an unrelated checkout being on the path (#13). - A scheduled live-integration workflow runs the tests tagged
LiveIntegrationweekly against the real Data Proxy, Knowledge Graph, and Collaboratory APIs, and the release workflow runs them again before packaging (#17). - Unit tests for the pure helpers, the mocked API clients, the three IAM token clients, and the transfer step of
uploadFileanddownloadFile. Statement coverage rises from about 45% to about 89% (#18, #19, #21).
Changed
- The KG, Data Proxy, and Collaboratory clients are hand-written on a shared
ebrains.common.internal.HttpClient, replacing the generated packages whose JSON mapper was slow on large responses and could not carry free-form JSON-LD bodies. The IAM classes move into theebrains.iamnamespace folder (#11). getBucketSizereads the total from the bucket stat endpoint instead of listing and summing every object, which is about 15 times faster on large buckets and works on an empty one (#7).getInstancewith a stage vector retries the next stage only on 404; authorization and server errors are thrown immediately (#5).- The help text of
InstancesClient,QueriesClient,authenticate,getTokenManager, theebrains.iampackage, the KG enums,ReturnOptions,BaseClient, and theebrains.common.constantfunctions follows the MathWorks help conventions, with syntax paragraphs derived from each arguments block (#22, #23, #25, #26, #27, #28, #29). - The README documents the current API: the instances client, the bucket transfer functions, collab search, the client credentials flow, R2022b as the minimum release, and installation from the toolbox file (85f75e7).
Removed
- The generated
ebrains.kgcore,ebrains.dataproxy, andebrains.collaboratorypackages, their build scripts, build logs, and the committed Data Proxy spec (#12). KGStage.ANY(#6).- The MATLAB secret-store lookup for
EBRAINS_TOKEN, which cost a five-second probe per token client on headless runners and tied the constructor to functions that only exist from R2024a (#24).
Fixed
listBucketObjectsreturned only the first page. The Data Proxy caps a page at about 1000 objects regardless of the requested limit, so any larger bucket came back truncated (a0e4af8).renameObjectraised on every call, including successful ones, because the status check compared a number against"OK"(#7).getBucketObjectfailed for every object since the vendored downloader started treating URLs as already encoded, and for any object inside a folder because/was sent percent-encoded as one path segment (#10).- Temporary URLs from the Data Proxy contain raw spaces, which the URI parser rejected;
getDownloadUrlandgetUploadUrlnow percent-encode them (#10). getBucketObjectcreates the folder that will hold the file, so object names with/download instead of failing at file open (#7).createVirtualBucketproduced file names with a literal\for every object name containing a space, because of shell quoting in thetouchcall. Files are created withfopeninstead, which also works on Windows (fd12bc3).getInstancesBulkwith a stage fallback reported misses against the wrong stage, advised retrying a stage already tried, and errored when exactly one id was missing. Misses are now reported once, after every stage was searched (d07a56e).- Server error text never reached the user from the KG clients, because the response body was read with
isfieldon an object (#5). - The bulk instances endpoint received a JSON string instead of an array when exactly one identifier was requested (#5).
updateInstance,replaceInstance,moveInstance, anddeleteInstancedid not strip the KG IRI prefix, so an@idtaken fromlistInstancesproduced a URL nested inside a URL (#5).QueriesClient.getQuerycalled a normalisation function that did not exist (#5).- Passing
"ANY"tolistInstances,listTypes, orrunDynamicQuerywas forwarded to the server and failed there; it now fails at argument validation (#6). - Three bugs in the vendored filedownload release: double percent-encoding of already encoded URLs, an invalid default for the upload request message that failed every call at validation, and a progress-monitor crash on the second update in command-window mode (#13).
- The vendored
downloadFilenow raises on a non-2xx status instead of writing the error body to the target file as if it were the content (#10). getDataSizeLabel(0)raised an index error, and so did any size at or above 1e18 bytes (#18).namespacedirraised a generic output-count error for a namespace not on the path; it now names the namespace and the folder to add (#18).- Tests tagged
Graphicalno longer run in CI on R2022b, where a headlessmsgboxreturns a placeholder figure (9a56a79).
Full Changelog: v0.9.2...v0.10.0