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
Switch resource handling from name to key #489
Switch resource handling from name to key #489
Conversation
@marmoure I confirmed that creating, deleting, copying/pasting, and cutting/pasting collections works, but I encountered errors with accessing created collections; renaming collections; and renaming, copying/pasting, and cutting/pasting resources. I found some solutions but others will need your help. To reproduce the error accessing created collections:
A fix for this is to add To reproduce the error I observed renaming collections:
To reproduce the same issue with renaming resources, save the above query as To reproduce the same issue with copying/pasting and cutting/pasting, use "File > Manage" to copy the Furthermore, when opening As a result, when clicking on the "arrow" icon to open the query in a new browser tab, the request returns a 404: I think the code that sets the |
a3578ba
to
b1ebdf2
Compare
b1ebdf2
to
b883ae4
Compare
hi @joewiz i fixed the breadcrumbs part but the issue with the page not found is an exist issue |
@joewiz there seems to be some failures which came as surprise to me, i ll try to replicate the build process and see if I can reproduce them |
@joewiz yes i confirm |
daab26c
to
b10db18
Compare
c4d452a
to
7ea6a85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is mixing concerns, and WIP. I see no reason for the changes to the ci config or for removing existing tests. Please make a separate PR for these so we can discuss them separately.
c280485
to
b10db18
Compare
I bet the stock version of eXide is being installed first before the version from this PR. We need a way either to prevent the stock version from being installed first or to install our version over the stock one. Packages are present in eXist's autodeploy are installed during eXist's startup; they are installed in alphanumeric order, but before installing a package eXist first checks if a package of the same package URI is already installed, and if one has already installed, the package being checked is skipped. So if the stock version of eXide included in the eXist Docker image's autodeploy folder is eXide-2.0.0.xar, and the version that CI copies into the autodeploy folder is eXide-3.0.0.xar, then v2.0.0 will be installed and v3.0.0 will be skipped. I think this is the problem preventing our CI tests from testing the PR's version of eXide. |
i ran a clean instance of the docker image and i checked the eXide version seems like it's "3.4.0" |
i tried deploying exist using a different method which was recommended by @adamretter but unfortunately it didn't work #!/bin/bash
EXIST_REST_URI="http://localhost:8080/exist/rest"
EXIST_REST_USERNAME="admin"
EXIST_REST_PASSWORD=""
function upload_pkg_files() {
local pkg_file_name="eXide-$1.xar"
local pkg_file="./build/eXide-$1.xar"
local curl_cmd=(curl --fail --user "${EXIST_REST_USERNAME}:${EXIST_REST_PASSWORD}" -X PUT -H "Content-Type: application/octet-stream" --data-binary "@${pkg_file}" "${EXIST_REST_URI}/db/${pkg_file_name}")
echo "Uploading ${pkg_file_name} to eXist-db..."
"${curl_cmd[@]}"
echo "Uploaded OK."
}
function deploy_pkg_files() {
local deploy_xq="<query xmlns=\"http://exist.sourceforge.net/NS/exist\">
<text>
let \$pkg-name := \"http://exist-db.org/apps/eXide\"
let \$pkg-final-name := \"eXide-$1\"
return
(
repo:undeploy(\$pkg-name),
repo:install-and-deploy-from-db(\"/db/\" || \$pkg-final-name || \".xar\")
)
</text>
</query>"
local curl_cmd=(curl --fail --user "${EXIST_REST_USERNAME}:${EXIST_REST_PASSWORD}" -X POST -H "Content-Type: application/xml" -d "${deploy_xq}" "${EXIST_REST_URI}/db/")
echo "Deploying ${pkg_file_name} to eXist-db..."
"${curl_cmd[@]}"
echo ""
echo "Deployed OK."
}
upload_pkg_files $1
deploy_pkg_files $1 this script was invoked in the CI with the current version number as arg |
4e3c7aa
to
9fcd975
Compare
613530d
to
306e867
Compare
306e867
to
e761d0e
Compare
@duncdrum Above you said:
The CI changes were moved into a separate PR: #500. I merged that PR provisionally, as it enables work on this PR to proceed. Your comments are certainly still welcome. Are there test scenarios you believe should be retained? Perhaps we can look into restoring them. The CI changes in #500 were needed at the very least as a sanity check, since eXist wasn't installing the eXide packages built from PRs, and this would affect any new PRs with tests. So once the automated testing works again, if anything needs to be put back we can take a look into it. |
@joewiz the deployment issue is no longer present but seems like we have some issues with the test runs it's flaky |
7ed74e5
to
28e1e8e
Compare
@joewiz after adding multiple wait statements to the tests to slow down the runs it seems to be working as expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests pass locally and in CI.
@marmoure Thank you very much for this thorough and well-tested PR! This clears up an entire class of bugs that affected users of eXide who used special characters in resource names (including users of TEI Publisher - see eeditiones/tei-publisher-app#48). We're on much more solid ground now, and the tests you added will flag any issues as we continue to investigate the related issues in the eXist core - eXist-db/exist#1824 and eXist-db/exist#3795. |
p.s. A complementary CI fix was added to #503. |
Fixes #185
this PR switches to using key for resources in the DB manager for copying,renaming,navigation,creation
now creating a collection named
AéB
or with spaces in the name will work fineThis open source contribution to the eXide project was commissioned by the Office of the Historian, U.S. Department of State, https://history.state.gov/.