Skip to content

Develop - #235

Merged
sedv8808 merged 7 commits into
productionfrom
develop
Aug 6, 2026
Merged

Develop#235
sedv8808 merged 7 commits into
productionfrom
develop

Conversation

@sedv8808

@sedv8808 sedv8808 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces new endpoints to the Neotoma API for retrieving project and aeDNA assay metadata linked to datasets, improves test automation, and enhances the site and sequence data models with additional fields. It also includes various fixes and improvements to the test scripts and SQL queries.

New API Endpoints and Handlers:

  • Added /v2.0/data/datasets/{datasetid}/assays endpoint and supporting handler to return aeDNA assay and library metadata for a dataset. [1] [2] [3] [4] [5]
  • Added /v2.0/data/datasets/{datasetid}/projects endpoint and supporting handler to return project and participant metadata for a dataset. [1] [2] [3] [4] [5]

Test Automation Improvements:

  • Introduced a new GitHub Actions workflow .github/workflows/test.yml to automatically test the API after deployments to the develop branch and on manual dispatch.
  • Improved test scripts (genoatt.sh, runmochabatch.sh, package.json) to support multiple environments, correct protocol usage, and more flexible test running. [1] [2] [3] [4] [5] [6]

Data Model and Query Enhancements:

  • Added recdatecreated field to site-related schemas and queries, making creation dates available in API responses. [1] [2] [3] [4] [5] [6] [7]
  • Included asv (amplicon sequence variant) field in aeDNA sequence queries and responses. [1] [2] [3]

Other Fixes and Improvements:

  • Extended session expiration and improved return values for new ORCID login sessions.

These changes add important new dataset metadata endpoints, improve test coverage and reliability, and enhance the richness of site and sequence data returned by the API.

Copilot AI lite review requested due to automatic review settings August 6, 2026 23:38
@sedv8808
sedv8808 merged commit c57b83f into production Aug 6, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request expands the Neotoma API with dataset-linked aeDNA assay/library metadata and project/participant metadata endpoints, while also enriching existing site/sequence payloads and strengthening automated post-deploy test execution.

Changes:

  • Added new dataset endpoints for aeDNA assays (/v2.0/data/datasets/{datasetid}/assays) and projects (/v2.0/data/datasets/{datasetid}/projects) with new SQL + helper handlers.
  • Enhanced existing outputs by adding recdatecreated to site queries/schemas and adding asv to aeDNA sequence queries.
  • Improved CI/test automation via a new GitHub Actions workflow plus updates to test-generation/execution scripts and environment targeting.

Reviewed changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
v2.0/routes/data.js Wires new dataset routes for assays/projects into the v2.0 router.
v2.0/handlers/data_handlers.js Adds handler entry points delegating to new helpers.
v2.0/helpers/assays/assays.js Implements dataset assays handler with fallback for missing aeDNA tables.
v2.0/helpers/assays/assaysbydataset.sql Adds SQL to return assay + library metadata for a dataset.
v2.0/helpers/projects/projects.js Implements dataset projects handler returning projects + participants.
v2.0/helpers/projects/projectsbydataset.sql Adds SQL to return project + participant metadata for a dataset.
v2.0/helpers/aedna/sequences.sql Adds asv field to dataset-grouped aeDNA sequences output.
v2.0/helpers/aedna/sequencesbytaxon.sql Adds asv field to sequences-by-taxon output.
v2.0/helpers/sites/sitequeryfaster.sql Adds recdatecreated to site query output.
v2.0/helpers/sites/sitebyid.sql Adds recdatecreated to site-by-id output.
v2.0/helpers/sites/sitebygpid.sql Adds recdatecreated into JSON site payload.
v2.0/helpers/sites/sitebydsid.sql Adds recdatecreated to site-by-dataset output and normalizes whitespace.
v2.0/helpers/sites/sitebyctid.sql Adds recdatecreated into JSON site payload.
openapi/paths/v20/data.yml Documents new assays/projects endpoints in the v2.0 OpenAPI source paths.
openapi/components/schemas/schemas.yml Adds recdatecreated to the sitesv2 schema.
openapi.yaml Updates the consolidated OpenAPI spec with the new paths and recdatecreated.
v2.0/helpers/validation/newlogin.sql Extends session lifetime and returns expiresat alongside sessionuuid.
v2.0/helpers/validation/validateuser.js Updates module header documentation describing ORCID token → session flow.
.github/workflows/test.yml Adds a post-deploy (and manual) workflow to generate tests and run them against dev/prod.
package.json Makes yarn test honor APIPATH (with a default) for environment targeting.
runmochabatch.sh Adds -l for localhost dev targeting and updates test execution commentary.
genoatt.sh Adds scheme selection for generated tests to handle http→https redirects on remote hosts.
Suppressed comments (2)

openapi/paths/v20/data.yml:362

  • The OpenAPI response schema for this endpoint is currently just type: object, but the handler returns a {status, data, message} wrapper with data.datasetid and data.projects. Please describe the response shape so clients and generated tests can validate it.
            schema:
              type: object

openapi.yaml:3376

  • Like openapi/paths/v20/data.yml, this generated OpenAPI spec defines the response schema as just type: object. The endpoint returns {status, data, message} with data.datasetid and data.projects, so the schema should reflect that contract.
              schema:
                type: object

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +345 to +346
schema:
type: object
Comment on lines 66 to 72
json_build_object(
'sequenceid', sd.sequenceid,
'sequence', sd.sequence,
'asv', sd.asv,
'model', sd.model,
'primername', sd.primername,
'publicationdoi', sd.publicationdoi
Comment on lines 1 to 7
SELECT
sq.sequenceid,
sq.sequence,
sq.asv,
am.model,
sq.primername,
pb.doi AS publicationdoi
Comment on lines +5 to +10
// If ORCID recognises it, we record a login in ap.orcidlogins, which mints an
// opaque session UUID (see newlogin.sql), and send that UUID back to the caller.
// The session UUID is the credential for every authenticated request afterwards,
// passed as `Authorization: Bearer <sessionuuid>` and checked by sessionauth.js.
// Session lifetime is set in newlogin.sql — currently 1 week — and its expiry is
// returned alongside the UUID so clients don't have to guess.
Comment thread runmochabatch.sh
Comment on lines +13 to 15
-l run the tests against the LOCAL DEV server at localhost:3005 (NODE_ENV=development)
-d run the tests against the remove development server at api-dev.neotomadb.org
-p run the tests against the remove production server at api.neotomadb.org
Comment thread openapi.yaml
Comment on lines +3359 to +3360
schema:
type: object
Comment thread genoatt.sh
Comment on lines 24 to +28

run_oatt() {

rm ./test/v*.js
oatts generate --host $remote -s ./openapi.yaml -w test
oatts generate --host $remote -m $scheme -s ./openapi.yaml -w test
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.

2 participants