-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Hotfix/eb 4517 base uri #4957
Draft
alanpaxton
wants to merge
13
commits into
eXist-db:develop
Choose a base branch
from
evolvedbinary:hotfix/eb-4517-base-uri
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Hotfix/eb 4517 base uri #4957
alanpaxton
wants to merge
13
commits into
eXist-db:develop
from
evolvedbinary:hotfix/eb-4517-base-uri
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eXist-db#4517 static-base-uri is wrong or non-existent in several cases. We need to set it in the global context. First failing unit tests for “execute script” via RESTServer, and for ?_query parameter via RESTServer
Needed for running jetty in the extensions project, in order to test RESTXQ. [test] webapp config
The RESTXQ integration test now _runs_ correctly against ExistWebserver and invokes RESTXQ functions when the appropriate http endpoints are invoked. The tests _fail_, but this is expected. It remains to make the tests _pass_ by repairing the `static-base-uri()` function to properly take account of the query context.
We had added this test at the start, but RESTXQ-based unit testing ncan only work in the exist-restxq module, and we have a UT for static-base-uri() there now which does what was intended by this test.
Construct a base URI for the RESTXQ function which prefixes the location of the xquery with the xmldb:exist:// “scheme”
Share mechanism to calculate static base URI from the above change for RESTXQ. Pull it out into a little library class. Move all the base URI testing into single place in extension unit tests, RESTXQ parts will only run there. Rename to BaseURITest as that is really all there is in it now.
All the base-uri tests get run in the exist-restxq extensions tests, so no point in the initial refactor of the core RESTServiceTest
Remove a do-nothing test. Current (not yet complete) set of tests now passing, pending further discussion of the correct base-uri “scheme” to return. Works for the following cases: Implemented: 1. GET _query parameter 2. PUT a script and execute with RESTServer 3. POST an extended query 4. RESTXQ resource invoked Pending: 5. An XQuery is executed from the filesystem directly via the XQueryServlet
Make base URI work/consistent over multiple eXist database APIs - Base URI is defined in XQueryServlet - Uses the `file:` URI of the XQuery file executed by the servlet - previous checkins defined base URI for RESTXQ and RESTServer as the URI of the "resource" in the database - URI resolution in the presence of the xmldb:exist: pseudo-URI (for database resources) is implemented/improved - `AnyURI.resolveURI()` is defined/implemented to support this - FunResolveURI (implementation of XQuery fn:resolve-uri()) makes use of `AnyURI.resolveURI()` - With `xmldb:exist:` appearing as a base URI, URI resolution needs to deal with `xmldb:exist:` - This previously "resolved" to the relative URI, i.e. resolution was effectively a no-op Tests ----- fnResolveURI.xqm tests `fn:resolve-uri()` as a set of XQuery unit tests RESTXQ extensions `BaseURITest.java` tests API requests to `fn:base-uri()` and `fn:resolve-uri()` - It centralises all the possible API-level call methods to eXist, testing these methods using each API - It covers RESTXQ, RESTServer and XQueryServlet - It configures the internal `ExistWebServer` to run all the servlets, using `controller-config.xml` and `web.xml` - It has to be placed in the extension module because it uses RESTXQ, which is not part of the eXist core
Need to squash into this change when base-uri is implemented appropriately for XML-RPC. There may be 2 cases again here; the usual (1) executing some code directly (2) running a file through this mechanism
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for your contribution to eXist-db!
To help the community judge your pull request (PR), please include the following:
Your PR will be tested using GitHub Actions against a number of operating systems and environments. The build status is visible in the PR.
To detect errors in your PR before submitting it, please run eXist's full test suite on your own system via
mvn -V clean verify
.Description:
Reference:
Type of tests: