Skip to content

Add publish endpoint and webapp UI for marking models as published#1651

Open
jcschaff wants to merge 15 commits intomasterfrom
mark-published-models
Open

Add publish endpoint and webapp UI for marking models as published#1651
jcschaff wants to merge 15 commits intomasterfrom
mark-published-models

Conversation

@jcschaff
Copy link
Member

Summary

  • Add PUT /api/v1/publications/{id}/publish REST endpoint that marks BioModels and MathModels linked to a publication as published (GroupAccessAll + VersionFlag.Published), with optional selective publishing via request body
  • Add webapp UI in publication editor: version flag status badges (Published/Archived/Current), checkboxes for selective model publishing, and a "Publish Selected Models" button visible to curators
  • Refactor test BiomodelRef construction to use a shared helper that queries the database instead of manually building fields
  • Increase Keycloak devservices timeouts for test reliability on ARM64 Macs

Test plan

  • Verify mvn clean install -DskipTests builds successfully
  • Run cd vcell-rest && mvn test (requires working Keycloak testcontainer) to validate new testPublishBioModels and testPublishBioModelsUnauthorized tests
  • Manual: open webapp publication edit page as curator, verify status badges appear on model refs
  • Manual: select models and click "Publish Selected Models", confirm versionFlag updates to Published after re-fetch

🤖 Generated with Claude Code

jcschaff and others added 6 commits March 11, 2026 00:59
Expose PublicationService.publishDirectly() via a new Quarkus REST
endpoint that marks BioModels and MathModels linked to a publication
as published (GroupAccessAll + VersionFlag.Published). The endpoint
accepts an optional PublishModelsRequest body to selectively publish
specific model keys; defaults to all linked models when omitted.

- Add PublishModelsRequest record and publish endpoint in PublicationResource
- Update OpenAPI spec and regenerate Java, Python, and TypeScript clients
- Add PublicationApiTest cases for publish and unauthorized access
- Increase Keycloak devservices timeouts for test reliability on ARM64

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add version flag status badges (Published/Archived/Current) on each
BioModel and MathModel ref in the publication edit form. Curators see
checkboxes for selective model publishing and a "Publish Selected
Models" button that calls the new publishBioModels API endpoint.
After publishing, the publication is re-fetched to update badges.

- Add status badges, checkboxes, and publish button to publication-edit
- Add publishModels() with confirmation dialog, curator-only visibility
- Add refreshPublication() to publication-detail on published event
- Add publishModels wrapper to publication.service.ts
- Include generated TypeScript-Angular client for publishBioModels

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract biomodelRefFromBioModel() helper in TestEndpointUtils that
builds a BiomodelRef from the REST API BioModel response, using the
actual database values instead of manually constructing fields. Apply
to both testAddListRemove and testPublishBioModels tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
generate.sh called ./python-fix.sh which only works when CWD is tools/.
Changed to use ${scriptDir}/python-fix.sh for reliable execution from
any working directory. Also includes the manual __init__.py fix for
circular imports (curve classes moved to end of file).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The manually-added PublishModelsRequest schema was placed in a different
alphabetical position than Quarkus generates. Copied the Quarkus-generated
spec and regenerated all clients.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…M options

The -XX:UseSVE=0 flag is only valid on ARM64 JVMs and causes Keycloak's
JVM to exit with code 1 on x86_64 GitHub Actions runners. Adding
-XX:+IgnoreUnrecognizedVMOptions makes it non-fatal on unsupported platforms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jcschaff jcschaff force-pushed the mark-published-models branch from da4a38d to 9f30752 Compare March 11, 2026 18:20
jcschaff and others added 8 commits March 11, 2026 15:37
…ndency

Replace osgeo Maven repo with a project-local lib/maven-repo containing:
- javax.media:jai_core:1.1.3 (jar + pom)
- com.sun.media:jai-codec:1.1.3 (jar + pom)
- edu.ucar:netcdf:4.3.22 (jar + pom, HTTP repos removed from pom)
- edu.ucar:udunits:4.3.22 (jar + pom)
- edu.ucar:thredds-parent:4.3.22 (pom, HTTP repos removed)

These artifacts are not on Maven Central and were previously fetched
from repo.osgeo.org which has intermittent outages causing CI failures.
HTTP repository references in netcdf and thredds-parent POMs were
removed to avoid Maven 3.8+ HTTP blocking errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Expose the version lifecycle state (CURRENT=0, ARCHIVED=1, PUBLISHED=3)
through the BioModel REST endpoint, from DB query through OpenAPI spec
and all generated client libraries (Java, Python, TypeScript).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use biomodel.getVersionFlag() from REST response instead of hard-coded
VersionFlag.Current, and give testPublishBioModels a unique biomodel name
to avoid conflicts with other tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests that setting versionFlag to ARCHIVED or PUBLISHED prevents deletion
via the REST API, and that the versionFlag is correctly returned in the
BioModel response.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add privacy (public/private/shared) to BiomodelRef through the full
stack: DB query, domain model, REST DTO, OpenAPI spec, and all generated
clients. Show privacy badge alongside version badge in the publication
editor. Fix webapp to use biomodel.versionFlag instead of misusing
biomodel.privacy for the version badge.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jcschaff jcschaff force-pushed the mark-published-models branch from b931e77 to c78b8b0 Compare March 13, 2026 14:08
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.

1 participant