eXist-db / xst

Command line tool to interact with exist-db instances
https://npmjs.com/@existdb/xst
MIT License
17 stars 4 forks source link

fix(package): installation falls back to XMLRPC #171

Closed line-o closed 9 months ago

line-o commented 9 months ago

fixes #170

Try REST connection, fall back to XMLRPC and inform user that this happened.

; xst package install spec/fixtures/test-lib.xar
Falling back to XMLRPC API
Install test-lib.xar on https://localhost:8443
✔︎ uploaded
✔︎ installed
line-o commented 9 months ago

I tested this fix locally by setting up an instance that has REST disabled. There is no automated test for this at the moment because do not know how to do this in docker yet. @duncdrum help would be appreciated as there will be more REST API used in the future. @luckydem This is the fix for the issue you reported.

duncdrum commented 9 months ago

@line-o I would create another workflow file, not use services but modify and assemble the image on the ci server like we do for most stock apps. Basically:

  1. pull image
  2. copy modified conf.xml into image
  3. start container (based on modified image)
  4. run xst tests
line-o commented 9 months ago

@duncdrum Would you be able to share a link to an example?

duncdrum commented 9 months ago

https://github.com/eXist-db/eXide/blob/2442c0bf6ebd42782e74a5db945f5c2345428513/.github/workflows/ci.yml#L43-L47

and

https://github.com/duncdrum/distroless-exist/blob/01881d6afcedc175e347ee890ecb29372ee4d456/test/bats/02-config-spec.bats#L20-L24

the run keyword in the bats test need to be run: in gha yml. docker … is just the docker command you want to execute

line-o commented 9 months ago

How do we maintain modified configurations for each version of exist that is currently in the testmatrix?

duncdrum commented 9 months ago

matrix expansion in the yaml file, something like

docker pull duncdrum/existdb:${{ exist.version }}-j8

line-o commented 9 months ago

@duncdrum shouldn't it be more like

  1. pull image
  2. start container
  3. copy web.xml from container to filesystem
  4. modify web.xml (with sed for example)
  5. copy modified web.xml back into container
  6. restart container for modifications to take effect
  7. test
duncdrum commented 9 months ago

You can do that, it ll take long to run though. As you need a running container for the copy (I think that’s still the case) If you want to do this I would download them from the containers in the unit test phase, and share as artefact or even commit to repo.

Once you commit to repo, you might as well store the changes files and maintain these by hand. Either way works.

github-actions[bot] commented 9 months ago

:tada: This PR is included in version 1.9.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: