Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release implementation #109

Merged
merged 2 commits into from
Sep 3, 2024
Merged

release implementation #109

merged 2 commits into from
Sep 3, 2024

Conversation

lmd59
Copy link
Contributor

@lmd59 lmd59 commented Aug 28, 2024

Summary

Implements the $release endpoint in the server according to the CRMI IG definition.

New behavior

The user can now release a Measure or Library draft artifact and any resources it is composed of by sending a GET or POST request to Measure/$release, Measure/:id/$release, Library/$release and Library/:id/$release. This operation takes three required parameters: id, releaseVersion, and versionBehavior. It updates the artifact and children artifact date and version. For pieces of the spec that are a unclear, questions have been added to the connectathon document.

Code changes

  • service/README.md - add description of $release
  • service/scripts/dbSetup.ts - add check for publishable environment before coercing to active
  • service/src/config/capabilityStatementResources.json - add crmi-release
  • service/src/config/serverConfig.ts - add release endpoints
  • service/src/requestSchemas - add ReleaseArgs for type checking
  • service/src/services/LibraryService.ts / service/src/services/MeasureService.ts - add release function
  • service/test/services/LibraryService.test.ts / service/test/services/MeasureService.test.ts - added unit tests
  • service/test/utils.ts - add utility for removing test resources

Note: I believe all instances of catchMissingId in RequestSchemas are unnecessary because id is a strict required parameter already in zod args definition. Any problem with removing them?

Testing guidance

Ensure env has AUTHORING=true to allow for draft artifacts to exist
In service folder...

  • npm run check
  • npm run build
  • npm run db:reset
  • npm run db:loadBundle {pathToNestedChild-draft.json} (change an existing nested child bundle to make root artifact and all children status draft or ask me for a sample bundle)
  • npm run start

Run through the attached Insomnia tests (and fiddle with to test any other edge cases)
You can repeat the

  • npm run db:reset
  • npm run db:loadBundle {pathToNestedChild-draft.json}

steps between Insomnia tests to ensure the correct draft artifact exists

Insomnia requests:
release-requests.json

@elsaperelli elsaperelli self-requested a review September 3, 2024 13:16
@elsaperelli elsaperelli self-assigned this Sep 3, 2024
Copy link
Contributor

@elsaperelli elsaperelli left a comment

Choose a reason for hiding this comment

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

Functionality looks good to me! I also agree with the question you added to the connectathon question document. Just one small error handling suggestion!

service/src/requestSchemas.ts Show resolved Hide resolved
Copy link
Contributor

@elsaperelli elsaperelli left a comment

Choose a reason for hiding this comment

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

Lgtm!

@elsaperelli elsaperelli merged commit 03319f5 into main Sep 3, 2024
2 checks passed
@elsaperelli elsaperelli deleted the expose-release branch September 3, 2024 19:43
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.

3 participants