[xwiki-contrib/application-releasenotes] 33207e: RN-115: Add REST endpoints to create and list rele...
Branch: refs/heads/RN-115 Home: https://github.com/xwiki-contrib/application-releasenotes Commit: 33207e8d43ebf8b7002655c9144cbc724d280dc5 https://github.com/xwiki-contrib/application-releasenotes/commit/33207e8d43e... Author: Vincent Massol <[email protected]> Date: 2026-09-09 (Wed, 09 Sep 2026) Changed paths: M application-releasenotes-api/src/main/java/org/xwiki/contrib/releasenotes/ChangeManager.java M application-releasenotes-api/src/main/java/org/xwiki/contrib/releasenotes/ReleaseNoteManager.java A application-releasenotes-api/src/main/java/org/xwiki/contrib/releasenotes/ReleaseNotesAccessDeniedException.java M application-releasenotes-api/src/main/java/org/xwiki/contrib/releasenotes/internal/ReleaseNotesDocumentWriter.java M application-releasenotes-api/src/test/java/org/xwiki/contrib/releasenotes/internal/ReleaseNotesDocumentWriterTest.java A application-releasenotes-rest/pom.xml A application-releasenotes-rest/src/checkstyle/checkstyle-suppressions.xml A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/ChangesResource.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/ReleaseNotesResource.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/internal/AbstractReleaseNotesResource.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/internal/DefaultChangesResource.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/internal/DefaultReleaseNotesResource.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/internal/ReleaseNotesExceptionMapper.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/internal/RepresentationFactory.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/model/ChangeRepresentation.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/model/ChangesRepresentation.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/model/ErrorRepresentation.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/model/ReleaseNoteRepresentation.java A application-releasenotes-rest/src/main/java/org/xwiki/contrib/releasenotes/rest/model/ReleaseNotesRepresentation.java A application-releasenotes-rest/src/main/resources/META-INF/components.txt A application-releasenotes-rest/src/test/java/org/xwiki/contrib/releasenotes/rest/internal/DefaultChangesResourceTest.java A application-releasenotes-rest/src/test/java/org/xwiki/contrib/releasenotes/rest/internal/DefaultReleaseNotesResourceTest.java A application-releasenotes-rest/src/test/java/org/xwiki/contrib/releasenotes/rest/internal/ReleaseNotesExceptionMapperTest.java A application-releasenotes-rest/src/test/java/org/xwiki/contrib/releasenotes/rest/internal/RepresentationFactoryTest.java M application-releasenotes-test/application-releasenotes-test-docker/pom.xml A application-releasenotes-test/application-releasenotes-test-docker/src/test/it/org/xwiki/contrib/releasenotes/test/ui/JsonResponse.java A application-releasenotes-test/application-releasenotes-test-docker/src/test/it/org/xwiki/contrib/releasenotes/test/ui/ReleaseNotesRestClient.java A application-releasenotes-test/application-releasenotes-test-docker/src/test/it/org/xwiki/contrib/releasenotes/test/ui/ReleaseNotesRestIT.java M application-releasenotes-ui/pom.xml M pom.xml Log Message: ----------- RN-115: Add REST endpoints to create and list release notes and changes * Add the application-releasenotes-rest module, a jar holding four endpoints over the Java API: GET and POST /wikis/{wikiName}/releasenotes, and GET and POST /wikis/{wikiName}/releasenotes/{product}/{version}/changes. One call creates a correct release note or change, so a script, a CI job or an agent does not have to reproduce the short version page name, the Entry### numbering and the pair of objects an entry needs. The version in a URL is the version itself, never the page name. * Answer a release note that already exists with a 409 carrying the page it lives in, rather than with the release note itself: it may be about another product, and a client that took it for its own would add its changes to somebody else's release note. That answer is also what tells a client that is re-running that it has run before, at its first call rather than at its two hundredth change. * Return only the changes stored against the version in the URL, and fold in the ones of its milestones and of its release candidates only when aggregated=true: "what have I already added to 8.3" and "what does the 8.3 release note show" are different questions. * Parse the filters of the change listing with ChangeQueryParser, the same lenient syntax as the getChanges macro, so the two filter languages cannot diverge. * Answer every failure in one place, ReleaseNotesExceptionMapper: 409 for a release note that exists, 401 or 403 for a page that may not be written, 500 for a failure of the wiki. The endpoints check no right of their own, since the components check them for every caller. * Raise ReleaseNotesAccessDeniedException from ReleaseNotesDocumentWriter, so that a refusal can be told apart from a failure. Without it every caller, including this one, sees the same exception for "you may not" and "it broke". * Make the UI module depend on the REST module, which brings the API module with it: installing the Release Notes Application installs the endpoints. * Add ReleaseNotesRestIT, which creates a release note and two changes over HTTP and asserts the page tree and both objects of each entry, and unit tests for the status codes, the representations and the query the change listing builds. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki-contrib/application-releasenotes/settings/notificat...
participants (1)
-
XWiki Notifications