Skip to content

Commit

Permalink
fix: solve conceptual issues
Browse files Browse the repository at this point in the history
- aggregate file changes to avoid firing triggers too often (fixes #14)
- overhaul remote service requests (fixes #18)
- remove code redundancies in api module
- add unique functions for some endpoints (`api:*-default`)
- refactor to allow to extend git services (see vcs.xqm)
- improve, extend and adapt tests
  • Loading branch information
line-o committed Sep 30, 2023
1 parent cd6f509 commit b395e14
Show file tree
Hide file tree
Showing 14 changed files with 1,123 additions and 1,039 deletions.
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ const replacements = [existJSON.package, { version, license }]
const packageUri = existJSON.package.namespace
const serverInfo = existJSON.servers.localhost
const target = serverInfo.root

const url = new URL(existJSON.servers.localhost.server)
console.log(url)
// console.log(url)

// FIXME read from .existdb.json
const connectionOptions = {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.2.0",
"description": "tuttle - a Git-integration for eXist-db",
"scripts": {
"start": "gulp",
"test": "gulp install && mocha --exit",
"test:watch": "mocha --watch",
"test:build": "gulp test:install",
Expand All @@ -17,8 +18,8 @@
},
"license": "GPL-3.0",
"devDependencies": {
"@existdb/gulp-exist": "^4.0.0",
"@existdb/gulp-replace-tmpl": "^1.0.0",
"@existdb/gulp-exist": "^4.4.0",
"@existdb/gulp-replace-tmpl": "^1.0.4",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.2.0",
Expand Down
18 changes: 10 additions & 8 deletions src/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"x-constraints": {
"user": "admin"
},
"operationId": "api:git-pull",
"operationId": "api:git-pull-default",
"parameters": [
{
"name": "hash",
Expand Down Expand Up @@ -143,7 +143,7 @@
"x-constraints": {
"user": "admin"
},
"operationId": "api:git-deploy",
"operationId": "api:git-deploy",
"responses": {
"200":{
"description": "JSON dump of request",
Expand Down Expand Up @@ -184,7 +184,8 @@
"in": "query",
"required": false,
"schema":{
"type": "boolean"
"type": "boolean",
"default": false
}
}
],
Expand Down Expand Up @@ -223,13 +224,14 @@
"in": "query",
"required": false,
"schema":{
"type": "boolean"
"type": "boolean",
"default": false
}
}
],
"responses": {
"200":{
"description": "JSON dump of request",
"description": "result of the update",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -268,7 +270,7 @@
],
"responses": {
"200": {
"description": "GIT Hash",
"description": "git hashes",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -333,7 +335,7 @@
"x-constraints": {
"user": "admin"
},
"operationId": "api:get-commit",
"operationId": "api:get-commits",
"parameters": [
{
"name": "count",
Expand Down Expand Up @@ -372,7 +374,7 @@
"x-constraints": {
"user": "admin"
},
"operationId": "api:get-commit",
"operationId": "api:get-commits-default",
"parameters": [
{
"name": "count",
Expand Down
6 changes: 2 additions & 4 deletions src/data/tuttle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<repo>tuttle-sample-data</repo>
<owner>eeditiones</owner>
<token>XXX</token>
<ref>main</ref>
<ref>next</ref>
<hookuser>admin</hookuser>
<hookpasswd></hookpasswd>
</collection>
Expand All @@ -34,9 +34,7 @@
</blacklist>


<config prefix="/db/apps" suffix="-stage" lock="git-lock.xml" apikeys="/db/system/auth/tuttle-token.xml">
<config prefix="/db/apps/" suffix="-stage" lock="git-lock.xml" apikeys="/db/system/auth/tuttle-token.xml">
<sm user="nobody" group="nogroup" mode="rw-r--r--"/>
</config>


</tuttle>
Loading

0 comments on commit b395e14

Please sign in to comment.