These are the steps to follow when bringing this repo up to date from an updated API spec.

How this was built

Prep

Prep: the Docker command in runMe.sh will read its current directory and write the following into ./tiledbcloud-generated: DESCRIPTION, NAMESPACE, README.md, R, docs, man, tests, and git_push.sh. Unfortunately it will read the current files from the working directory as well.

In either case we need a current openapi-v1.yaml copied from https://github.com/TileDB-Inc/TileDB-Cloud-API-Spec into ..

Autogen option 1

mkdir /tmp/gen
cp openapi-v1.yaml   /tmp/gen
cp runMe.sh          /tmp/gen
cp regenerate-docs.r /tmp/gen/
cp -a .openapi-generator* /tmp/gen

cd /tmp/gen
./runMe.sh

Then remove DESCRIPTION, NAMESPACE, R, docs, man, test from this repo directory (maybe mkdir old and mv them to old) with outputs from /tmp/gen. Then move /tmp/gen/README.md to ./origREADME.md.

Autogen option 2

mkdir old
mv DESCRIPTION old
mv NAMESPACE   old
mv README.md   old
mv R           old
mv docs        old
mv man         old
mv tests       old
mv git_push.sh old

./runMe.sh

Then move ./README.md to ./origREADME.md and old/README.md to ..

Post-processing

In either case, be sure any manual-layer files (such as init.R -- listed in runMe.sh) are copied back to ./R. Then remove NAMESPACE and (in R) library(devtools) and devtools::document(). (The NAMESPACE file must be removed first since it was generated by openapi-generator so devtools will skip it.) This will ensure that exported functions in the manual-layer files are properly exported.

Important The generated API wants to also parse a field User which we apparently do not send. So the default deserializer breaks. See PR #2 and its small diff to R/api_client.R file for a fix that needs to be re-applied.

Also diff -r old/R R and see what other manual edits need to be re-applied. In particular, all manual edits needing re-application should be marked with MANUAL EDIT AFTER OPENAPI AUTOGEN.

Also manually edit DESCRIPTION, carrying over manual edits from before the autogen run.

Also:

R CMD build .
R CMD INSTALL .

See HowToRelease.md for how to update documentation pages and commit them to version control.

Testing

Just as the library has a higher line-count of code autogenerated by OpenAPI, and a lower line-count of manual-layer files, so too with testing. In tests/testthat are many autogenerated files -- with function bodies written commented out by OpenAPI. We do not focus our testing in this direction.

In inst/tinytest are manually written tests. These are opt-in: they make TileDB Cloud calls, which we don't want to push on all users who build the package locally.

To opt in:



TileDB-Inc/TileDB-Cloud-R documentation built on July 18, 2024, 3:33 p.m.