author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
426,496
17.08.2022 16:30:14
-7,200
4076c95822a0194fc7e0c1ff91d1c61992629dd0
Updated links on the index page (2)
[ { "change_type": "MODIFY", "old_path": "proxy/index.html", "new_path": "proxy/index.html", "diff": "<h1>Modelix</h1>\n<ul>\n- <a href=\"workspace-manager/\">Workspaces</a>\n- <a href=\"instances-manager/\">Manage running workspaces instances</a>\n- <a href=\"model/\">Model Server</a>\n- <a href=\"admin/\">Users and Permissions</a>\n+ <li><a href=\"workspace-manager/\">Workspaces</a></li>\n+ <li><a href=\"instances-manager/\">Manage running workspaces instances</a></li>\n+ <li><a href=\"model/\">Model Server</a></li>\n+ <li><a href=\"admin/\">Users and Permissions</a></li>\n</ul>\n</body>\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Updated links on the index page (2)
426,496
18.08.2022 18:53:47
-7,200
cbfe2111324801b0fbd31b621d8ecac1dad43f55
Keycloak version updated to 19.0.1
[ { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/keycloak-deployment.yaml", "new_path": "helm/modelix/templates/common/keycloak-deployment.yaml", "diff": "@@ -19,7 +19,7 @@ spec:\nspec:\ncontainers:\n- name: keycloak\n- image: \"{{ default .Values.dockerProxy.prefix \"quay.io/\" }}keycloak/keycloak:18.0.1\"\n+ image: \"{{ default .Values.dockerProxy.prefix \"quay.io/\" }}keycloak/keycloak:19.0.1\"\nargs: [\"start-dev\", \"--import-realm\"]\nenv:\n- name: KC_LOG_LEVEL\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Keycloak version updated to 19.0.1
426,496
18.08.2022 18:55:46
-7,200
49ccf2377086f92367b63eee3407bdd39ea757a2
Dependency versions in the helm chart were accidentally replaced with the Modelix version
[ { "change_type": "MODIFY", "old_path": "helm/publish.sh", "new_path": "helm/publish.sh", "diff": "@@ -8,8 +8,8 @@ cd \"$(dirname \"$0\")\"\nTAG=$( ../modelix-version.sh )\n-sed -i.bak -E \"s/appVersion:.*/appVersion: \\\"${TAG}\\\"/\" modelix/Chart.yaml\n-sed -i.bak -E \"s/version:.*/version: \\\"${TAG}\\\"/\" modelix/Chart.yaml\n+sed -i.bak -E \"s/^appVersion:.*/appVersion: \\\"${TAG}\\\"/\" modelix/Chart.yaml\n+sed -i.bak -E \"s/^version:.*/version: \\\"${TAG}\\\"/\" modelix/Chart.yaml\nrm modelix/Chart.yaml.bak\nmkdir -p repo\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Dependency versions in the helm chart were accidentally replaced with the Modelix version
426,496
19.08.2022 12:03:58
-7,200
a543e924b60491b867da7ab7fa9dc62c043643b3
Always use https If no certificate is provided, a self-signed one is generated.
[ { "change_type": "MODIFY", "old_path": "helm/modelix/templates/_helpers.tpl", "new_path": "helm/modelix/templates/_helpers.tpl", "diff": "@@ -71,7 +71,7 @@ imagePullSecrets:\n{{- end -}}\n{{- define \"modelix.externalUrl\" -}}\n-{{ .Values.ingress.proto }}://{{ .Values.ingress.hostname }}{{ if .Values.ingress.port }}:{{ .Values.ingress.port }}{{ end }}/\n+https://{{ .Values.ingress.hostname }}{{ if .Values.ingress.port }}:{{ .Values.ingress.port }}{{ end }}/\n{{- end }}\n{{- define \"modelix.externalKeycloakUrl\" -}}\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/ingress.yaml", "new_path": "helm/modelix/templates/common/ingress.yaml", "diff": "@@ -7,16 +7,14 @@ metadata:\nnginx.ingress.kubernetes.io/proxy-body-size: 200m\nspec:\ningressClassName: nginx\n- {{ if or .Values.ingress.certSecret .Values.ingress.tls.crt }}\ntls:\n- hosts:\n- \"{{ .Values.ingress.hostname }}\"\n- {{ if .Values.ingress.tls.crt }}\n+ {{ if not .Values.ingress.certSecret }}\nsecretName: \"{{ include \"modelix.fullname\" . }}-tls-secret\"\n{{ else }}\nsecretName: \"{{ .Values.ingress.certSecret }}\"\n{{ end }}\n- {{ end }}\nrules:\n- host: \"{{ .Values.ingress.hostname }}\"\nhttp:\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/keycloak-deployment.yaml", "new_path": "helm/modelix/templates/common/keycloak-deployment.yaml", "diff": "@@ -28,8 +28,8 @@ spec:\nvalue: \"admin\"\n- name: KEYCLOAK_ADMIN_PASSWORD\nvalue: \"{{ .Values.keycloak.adminPassword }}\"\n- #- name: KC_PROXY\n- # value: \"edge\"\n+ - name: KC_PROXY\n+ value: \"edge\"\n- name: PROXY_ADDRESS_FORWARDING\nvalue: \"true\"\n- name: KC_DB\n@@ -50,6 +50,8 @@ spec:\n# value: \"/\"\n#- name: KC_HOSTNAME_PORT\n# value: \"{{ .Values.ingress.port }}\"\n+ - name: KC_HOSTNAME_STRICT_HTTPS\n+ value: \"true\"\n- name: KEYCLOAK_FRONTEND_URL\nvalue: \"{{ include \"modelix.externalKeycloakUrl\" . }}auth\"\n- name: REALM_FRONTEND_URL\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/tls-secret.yaml", "new_path": "helm/modelix/templates/common/tls-secret.yaml", "diff": "-{{ if .Values.ingress.tls.crt }}\n+{{- if not .Values.ingress.certSecret }}\napiVersion: v1\nkind: Secret\nmetadata:\nname: \"{{ include \"modelix.fullname\" . }}-tls-secret\"\ntype: kubernetes.io/tls\ndata:\n+ {{ if .Values.ingress.tls.crt }}\ntls.crt: {{ .Values.ingress.tls.crt }}\ntls.key: {{ .Values.ingress.tls.key }}\n+ {{ else }}\n+ {{- $altNames := list .Values.ingress.hostname -}}\n+ {{- $ca := genCA \"modelix-ca\" 365 -}}\n+ {{- $cert := genSignedCert ( include \"modelix.fullname\" . ) nil $altNames 365 $ca -}}\n+ tls.crt: {{ $cert.Cert | b64enc }}\n+ tls.key: {{ $cert.Key | b64enc }}\n+ {{- end }}\n{{ end }}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/values.yaml", "new_path": "helm/modelix/values.yaml", "diff": "@@ -28,7 +28,6 @@ workspaces:\nuploadsStorageSize: 5000Mi\ningress:\n- proto: \"http\"\nhostname: \"localhost\"\nport: \"\"\ncertSecret: \"\"\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Always use https If no certificate is provided, a self-signed one is generated.
426,496
19.08.2022 12:24:40
-7,200
3f7221d561cf0fbf1765699207705c0eefddcd05
Renamed ingress-nginx.enabled to ingress.installController
[ { "change_type": "MODIFY", "old_path": "helm/modelix/Chart.yaml", "new_path": "helm/modelix/Chart.yaml", "diff": "@@ -27,4 +27,4 @@ dependencies:\n- name: ingress-nginx\nversion: ~4.2.1\nrepository: https://kubernetes.github.io/ingress-nginx\n- condition: ingress-nginx.enabled\n\\ No newline at end of file\n+ condition: ingress.installController\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/values.yaml", "new_path": "helm/modelix/values.yaml", "diff": "@@ -28,6 +28,7 @@ workspaces:\nuploadsStorageSize: 5000Mi\ningress:\n+ installController: true\nhostname: \"localhost\"\nport: \"\"\ncertSecret: \"\"\n@@ -35,9 +36,6 @@ ingress:\ncrt: \"\"\nkey: \"\"\n-ingress-nginx:\n- enabled: true\n-\ndb:\nuseGCloud: false\nuser: \"modelix\"\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Renamed ingress-nginx.enabled to ingress.installController
426,496
21.08.2022 19:47:44
-7,200
9a5f66a33564dcf94730ad2caf15c84d336a5cb8
Proposal for a Modelix logo
[ { "change_type": "ADD", "old_path": null, "new_path": "logo.svg", "diff": "+<svg width=\"500\" height=\"500\" xmlns=\"http://www.w3.org/2000/svg\">\n+ <g>\n+ <title>Layer 1</title>\n+ <rect fill=\"#e5e5e5\" stroke-width=\"4\" x=\"2\" y=\"2\" width=\"496\" height=\"496\" id=\"svg_42\" stroke=\"#000000\"/>\n+ <line fill=\"none\" stroke=\"#cccccc\" x1=\"425\" y1=\"250\" x2=\"275\" y2=\"50\" id=\"svg_41\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#cccccc\" x1=\"275\" y1=\"50\" x2=\"325\" y2=\"250\" id=\"svg_40\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#cccccc\" x1=\"275\" y1=\"50\" x2=\"225\" y2=\"150\" id=\"svg_38\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#cccccc\" x1=\"125\" y1=\"150\" x2=\"275\" y2=\"50\" id=\"svg_35\" stroke-width=\"10\"/>\n+ <ellipse fill=\"#cccccc\" stroke=\"#cccccc\" stroke-width=\"0\" cx=\"275\" cy=\"50\" id=\"svg_33\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#194273\" stroke=\"#194273\" stroke-width=\"0\" cx=\"75\" cy=\"350\" id=\"svg_12\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#194273\" stroke=\"#194273\" stroke-width=\"0\" cx=\"175\" cy=\"350\" id=\"svg_13\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#194273\" stroke=\"#194273\" stroke-width=\"0\" cx=\"275\" cy=\"350\" id=\"svg_14\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#194273\" stroke=\"#194273\" stroke-width=\"0\" cx=\"125\" cy=\"150\" id=\"svg_15\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#194273\" stroke=\"#194273\" stroke-width=\"0\" cx=\"225\" cy=\"150\" id=\"svg_16\" rx=\"20\" ry=\"20\"/>\n+ <line fill=\"none\" stroke=\"#194273\" x1=\"75\" y1=\"350\" x2=\"125\" y2=\"150\" id=\"svg_17\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#194273\" stroke-width=\"10\" x1=\"125\" y1=\"150\" x2=\"175\" y2=\"350\" id=\"svg_18\"/>\n+ <line fill=\"none\" stroke=\"#194273\" stroke-width=\"10\" x1=\"225\" y1=\"150\" x2=\"175\" y2=\"350\" id=\"svg_19\"/>\n+ <line fill=\"none\" stroke=\"#194273\" stroke-width=\"10\" x1=\"275\" y1=\"350\" x2=\"225\" y2=\"150\" id=\"svg_20\"/>\n+ <ellipse fill=\"#000000\" stroke=\"#000\" stroke-width=\"0\" cx=\"375\" cy=\"350\" id=\"svg_23\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#000000\" stroke=\"#000\" stroke-width=\"0\" cx=\"325\" cy=\"250\" id=\"svg_24\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#000000\" stroke=\"#000\" stroke-width=\"0\" cx=\"425\" cy=\"250\" id=\"svg_25\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#000000\" stroke=\"#000\" stroke-width=\"0\" cx=\"325\" cy=\"450\" id=\"svg_26\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#000000\" stroke=\"#000\" stroke-width=\"0\" cx=\"425\" cy=\"450\" id=\"svg_27\" rx=\"20\" ry=\"20\"/>\n+ <line fill=\"none\" stroke=\"#000\" x1=\"325\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_28\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#000\" x1=\"425\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_29\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#000\" x1=\"325\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_30\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#000\" x1=\"425\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_31\" stroke-width=\"10\"/>\n+ </g>\n+</svg>\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Proposal for a Modelix logo https://github.com/modelix/modelix/issues/63
426,496
21.08.2022 20:15:36
-7,200
ecf59b704355097752f85b9dcd799b19a06ba30d
Deleted unused CachingStoreClient fixes
[ { "change_type": "DELETE", "old_path": "model-server/src/main/kotlin/org/modelix/model/server/CachingStoreClient.kt", "new_path": null, "diff": "-/*\n- * Licensed under the Apache License, Version 2.0 (the \"License\");\n- * you may not use this file except in compliance with the License.\n- * You may obtain a copy of the License at\n- *\n- * http://www.apache.org/licenses/LICENSE-2.0\n- *\n- * Unless required by applicable law or agreed to in writing,\n- * software distributed under the License is distributed on an\n- * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n- * KIND, either express or implied. See the License for the\n- * specific language governing permissions and limitations\n- * under the License.\n- */\n-package org.modelix.model.server\n-\n-import org.apache.commons.collections4.map.LRUMap\n-import org.modelix.model.IKeyListener\n-import java.util.*\n-import java.util.function.Function\n-import java.util.stream.Collectors\n-\n-class CachingStoreClient(private val store: IStoreClient) : IStoreClient {\n- private val cache: MutableMap<String, String?> = LRUMap(1000)\n- override fun get(key: String): String? {\n- return if (allowCaching(key)) {\n- var value = cache[key]\n- if (value == null) {\n- value = store[key]\n- cache[key] = value\n- }\n- if (value === NULL_STRING) null else value\n- } else {\n- store[key]\n- }\n- }\n-\n- override fun getAll(keys: List<String>): List<String?> {\n- return keys.stream().map { key: String -> this[key] }.collect(Collectors.toList())\n- }\n-\n- override fun getAll(keys: Set<String>): Map<String, String?> {\n- return keys.stream().collect(Collectors.toMap(Function.identity(), Function { key: String -> this[key] }))\n- }\n-\n- override fun put(key: String, value: String?) {\n- if (allowCaching(key)) {\n- val existingValue = cache[key]\n- if (existingValue == value) {\n- return\n- }\n- cache[key] = value\n- }\n- store.put(key, value)\n- }\n-\n- override fun putAll(entries: Map<String, String?>) {\n- for ((key, value) in entries) {\n- put(key, value)\n- }\n- }\n-\n- override fun listen(key: String, listener: IKeyListener) {\n- store.listen(key, listener)\n- }\n-\n- override fun removeListener(key: String, listener: IKeyListener) {\n- store.removeListener(key, listener)\n- }\n-\n- protected fun allowCaching(key: String?): Boolean {\n- return true\n- }\n-\n- override fun generateId(key: String): Long {\n- return store.generateId(key)\n- }\n-\n- companion object {\n- private val NULL_STRING = UUID.randomUUID().toString()\n- }\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "model-server/src/test/java/org/modelix/model/server/CachingStoreClientTest.java", "new_path": null, "diff": "-/*\n- * Licensed under the Apache License, Version 2.0 (the \"License\");\n- * you may not use this file except in compliance with the License.\n- * You may obtain a copy of the License at\n- *\n- * http://www.apache.org/licenses/LICENSE-2.0\n- *\n- * Unless required by applicable law or agreed to in writing,\n- * software distributed under the License is distributed on an\n- * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n- * KIND, either express or implied. See the License for the\n- * specific language governing permissions and limitations\n- * under the License.\n- */\n-\n-package org.modelix.model.server;\n-\n-import java.util.Arrays;\n-import java.util.LinkedList;\n-import java.util.List;\n-import java.util.Map;\n-import java.util.Set;\n-import org.jetbrains.annotations.NotNull;\n-import org.junit.Assert;\n-import org.junit.Test;\n-import org.modelix.model.IKeyListener;\n-\n-public class CachingStoreClientTest {\n-\n- class DummyStore implements IStoreClient {\n-\n- private List<String> requests = new LinkedList<>();\n-\n- public List<String> getRequests() {\n- return requests;\n- }\n-\n- @Override\n- public String get(String key) {\n- requests.add(key);\n- return key + \"_value\";\n- }\n-\n- @Override\n- public List<String> getAll(List<String> keys) {\n- throw new UnsupportedOperationException();\n- }\n-\n- @Override\n- public Map<String, String> getAll(Set<String> keys) {\n- throw new UnsupportedOperationException(\"Not implemented\");\n- }\n-\n- @Override\n- public void put(String key, String value) {\n- throw new UnsupportedOperationException();\n- }\n-\n- @Override\n- public void putAll(Map<String, String> entries) {\n- throw new UnsupportedOperationException();\n- }\n-\n- @Override\n- public void listen(@NotNull String key, @NotNull IKeyListener listener) {\n- throw new UnsupportedOperationException();\n- }\n-\n- @Override\n- public void removeListener(@NotNull String key, @NotNull IKeyListener listener) {\n- throw new UnsupportedOperationException();\n- }\n-\n- @Override\n- public long generateId(String key) {\n- throw new UnsupportedOperationException();\n- }\n- }\n-\n- @Test\n- public void getCacheMiss() {\n- DummyStore dummyStore = new DummyStore();\n- CachingStoreClient csc = new CachingStoreClient(dummyStore);\n- Assert.assertEquals(\"foo_value\", csc.get(\"foo\"));\n- Assert.assertEquals(Arrays.asList(\"foo\"), dummyStore.requests);\n- }\n-\n- @Test\n- public void getCacheHit() {\n- DummyStore dummyStore = new DummyStore();\n- CachingStoreClient csc = new CachingStoreClient(dummyStore);\n- csc.get(\"foo\");\n- dummyStore.requests.clear();\n- Assert.assertEquals(\"foo_value\", csc.get(\"foo\"));\n- Assert.assertEquals(Arrays.asList(), dummyStore.requests);\n- }\n-\n- @Test\n- public void getAllCacheMiss() {\n- DummyStore dummyStore = new DummyStore();\n- CachingStoreClient csc = new CachingStoreClient(dummyStore);\n- Assert.assertEquals(\n- Arrays.asList(\"foo_value\", \"bar_value\", \"zum_value\"),\n- csc.getAll(Arrays.asList(\"foo\", \"bar\", \"zum\")));\n- Assert.assertEquals(Arrays.asList(\"foo\", \"bar\", \"zum\"), dummyStore.requests);\n- }\n-\n- @Test\n- public void getAllCacheHit() {\n- DummyStore dummyStore = new DummyStore();\n- CachingStoreClient csc = new CachingStoreClient(dummyStore);\n- csc.get(\"foo\");\n- csc.get(\"bar\");\n- csc.get(\"zum\");\n- dummyStore.requests.clear();\n- Assert.assertEquals(\n- Arrays.asList(\"foo_value\", \"bar_value\", \"zum_value\"),\n- csc.getAll(Arrays.asList(\"foo\", \"bar\", \"zum\")));\n- Assert.assertEquals(Arrays.asList(), dummyStore.requests);\n- }\n-}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Deleted unused CachingStoreClient fixes https://github.com/modelix/modelix/issues/21
426,496
22.08.2022 17:53:24
-7,200
545b3d24d549f233e091a75ffc488b027b88a9c9
logo on the index page was not loaded
[ { "change_type": "MODIFY", "old_path": "Dockerfile-proxy", "new_path": "Dockerfile-proxy", "diff": "@@ -2,7 +2,7 @@ FROM nginx\nCOPY proxy/nginx.conf /etc/nginx/nginx.conf.template\nCOPY proxy/run.sh /etc/nginx/run.sh\nCOPY proxy/index.html /usr/share/nginx/html/\n-COPY proxy/logo.svg /usr/share/nginx/html/\n+COPY proxy/public/ /usr/share/nginx/html/public/\n#COPY samples/angular/modelix-angular-sandbox/dist/modelix-angular-sandbox /usr/share/nginx/html/angular\nCMD [\"/etc/nginx/run.sh\"]\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/keycloak-realm.json", "new_path": "helm/modelix/keycloak-realm.json", "diff": "{\n\"id\": \"modelix\",\n\"realm\": \"modelix\",\n+ \"displayNameHtml\": \"<img src=\\\"../../../../public/logo.svg\\\" style=\\\"max-width:300px\\\" />\",\n\"notBefore\": 0,\n\"defaultSignatureAlgorithm\": \"RS256\",\n\"revokeRefreshToken\": false,\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/oauth-deployment.yaml", "new_path": "helm/modelix/templates/common/oauth-deployment.yaml", "diff": "@@ -82,6 +82,7 @@ spec:\n- --skip-auth-regex=\\/(resources|admin|js|realms|keycloak)\\/.* # keycloak\n- --skip-auth-regex=\\/model\\/.* # Model server checks there bearer token itself. Model client needs the 401.\n- --skip-auth-regex=^\\/$\n+ - --skip-auth-regex=^\\/public\\/.*$\n- --skip-jwt-bearer-tokens=true\n- --skip-provider-button=true\n- --http-address=0.0.0.0:4180\n" }, { "change_type": "MODIFY", "old_path": "proxy/index.html", "new_path": "proxy/index.html", "diff": "<body>\n<div id=\"logo-container\">\n- <img id=\"logo\" src=\"logo-with-text-dark.svg\" alt=\"Modelix\"/>\n+ <img id=\"logo\" src=\"public/logo.svg\" alt=\"Modelix\"/>\n</div>\n<div id=\"links\">\n" }, { "change_type": "RENAME", "old_path": "proxy/logo-with-text-dark.svg", "new_path": "proxy/public/logo.svg", "diff": "" } ]
Kotlin
Apache License 2.0
modelix/modelix
logo on the index page was not loaded
426,496
22.08.2022 18:10:58
-7,200
8cf7508c215d8b8a3d563ef79c1354604dd5c8ae
logo with small text
[ { "change_type": "MODIFY", "old_path": "helm/modelix/keycloak-realm.json", "new_path": "helm/modelix/keycloak-realm.json", "diff": "{\n\"id\": \"modelix\",\n\"realm\": \"modelix\",\n- \"displayNameHtml\": \"<img src=\\\"../../../../public/logo.svg\\\" style=\\\"max-width:300px\\\" />\",\n+ \"displayNameHtml\": \"<img src=\\\"../../../../public/logo-with-small-text-dark.svg\\\" style=\\\"max-width:300px\\\" />\",\n\"notBefore\": 0,\n\"defaultSignatureAlgorithm\": \"RS256\",\n\"revokeRefreshToken\": false,\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/oauth-deployment.yaml", "new_path": "helm/modelix/templates/common/oauth-deployment.yaml", "diff": "@@ -82,7 +82,7 @@ spec:\n- --skip-auth-regex=\\/(resources|admin|js|realms|keycloak)\\/.* # keycloak\n- --skip-auth-regex=\\/model\\/.* # Model server checks there bearer token itself. Model client needs the 401.\n- --skip-auth-regex=^\\/$\n- - --skip-auth-regex=^\\/public\\/.*$\n+ - --skip-auth-regex=\\/public\\/.*\n- --skip-jwt-bearer-tokens=true\n- --skip-provider-button=true\n- --http-address=0.0.0.0:4180\n" }, { "change_type": "DELETE", "old_path": "logo/logo.svg", "new_path": null, "diff": "-<svg width=\"500\" height=\"500\" xmlns=\"http://www.w3.org/2000/svg\">\n- <g>\n- <title>Layer 1</title>\n-<!-- <rect fill=\"#e5e5e5\" stroke-width=\"4\" x=\"2\" y=\"2\" width=\"496\" height=\"496\" id=\"svg_42\" stroke=\"#343434\"/>-->\n- <path fill=\"#fff\" stroke-width=\"4\" stroke=\"#343434\" d=\"M22,2 h456 a20,20 0 0 1 20,20 v456 a20,20 0 0 1 -20,20 h-456 a20,20 0 0 1 -20,-20 v-456 a20,20 0 0 1 20,-20 z\" />\n- <line fill=\"none\" stroke=\"#adeee3\" x1=\"425\" y1=\"250\" x2=\"275\" y2=\"50\" id=\"svg_41\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#adeee3\" x1=\"275\" y1=\"50\" x2=\"325\" y2=\"250\" id=\"svg_40\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#adeee3\" x1=\"275\" y1=\"50\" x2=\"225\" y2=\"150\" id=\"svg_38\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#adeee3\" x1=\"125\" y1=\"150\" x2=\"275\" y2=\"50\" id=\"svg_35\" stroke-width=\"10\"/>\n- <ellipse fill=\"#adeee3\" stroke=\"#adeee3\" stroke-width=\"0\" cx=\"275\" cy=\"50\" id=\"svg_33\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"75\" cy=\"350\" id=\"svg_12\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"175\" cy=\"350\" id=\"svg_13\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"275\" cy=\"350\" id=\"svg_14\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"125\" cy=\"150\" id=\"svg_15\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"225\" cy=\"150\" id=\"svg_16\" rx=\"20\" ry=\"20\"/>\n- <line fill=\"none\" stroke=\"#6290c3\" x1=\"75\" y1=\"350\" x2=\"125\" y2=\"150\" id=\"svg_17\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#6290c3\" stroke-width=\"10\" x1=\"125\" y1=\"150\" x2=\"175\" y2=\"350\" id=\"svg_18\"/>\n- <line fill=\"none\" stroke=\"#6290c3\" stroke-width=\"10\" x1=\"225\" y1=\"150\" x2=\"175\" y2=\"350\" id=\"svg_19\"/>\n- <line fill=\"none\" stroke=\"#6290c3\" stroke-width=\"10\" x1=\"275\" y1=\"350\" x2=\"225\" y2=\"150\" id=\"svg_20\"/>\n- <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"375\" cy=\"350\" id=\"svg_23\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"325\" cy=\"250\" id=\"svg_24\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"425\" cy=\"250\" id=\"svg_25\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"325\" cy=\"450\" id=\"svg_26\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"425\" cy=\"450\" id=\"svg_27\" rx=\"20\" ry=\"20\"/>\n- <line fill=\"none\" stroke=\"#343434\" x1=\"325\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_28\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#343434\" x1=\"425\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_29\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#343434\" x1=\"325\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_30\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#343434\" x1=\"425\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_31\" stroke-width=\"10\"/>\n- </g>\n-</svg>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "proxy/index.html", "new_path": "proxy/index.html", "diff": "}\n#logo {\nmax-width: 500px;\n- margin: auto;\n+ margin: 10px;\n}\n#links {\n<body>\n<div id=\"logo-container\">\n- <img id=\"logo\" src=\"public/logo.svg\" alt=\"Modelix\"/>\n+ <img id=\"logo\" src=\"public/logo-with-small-text-dark.svg\" alt=\"Modelix\"/>\n</div>\n<div id=\"links\">\n" }, { "change_type": "RENAME", "old_path": "logo/color-palette.html", "new_path": "proxy/public/color-palette.html", "diff": "" }, { "change_type": "RENAME", "old_path": "logo/logo-dark.svg", "new_path": "proxy/public/logo-dark.svg", "diff": "" }, { "change_type": "ADD", "old_path": null, "new_path": "proxy/public/logo-with-small-text-dark.svg", "diff": "+<svg width=\"1200\" height=\"300\" xmlns=\"http://www.w3.org/2000/svg\">\n+ <g transform=\"translate(-70, -100)\">\n+<!-- <rect fill=\"#343434\" stroke-width=\"4\" x=\"0\" y=\"0\" width=\"2150\" height=\"500\" id=\"svg_42\" stroke=\"#343434\"/>-->\n+<!-- <path fill=\"#343434\" stroke-width=\"4\" stroke=\"#adeee3\" d=\"M22,2 h2106 a20,20 0 0 1 20,20 v456 a20,20 0 0 1 -20,20 h-2106 a20,20 0 0 1 -20,-20 v-456 a20,20 0 0 1 20,-20 z\" />-->\n+ <g transform=\"scale(0.6, 0.6) translate(100, 180)\">\n+ <line fill=\"none\" stroke=\"#444\" x1=\"425\" y1=\"250\" x2=\"275\" y2=\"50\" id=\"svg_41\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#444\" x1=\"275\" y1=\"50\" x2=\"325\" y2=\"250\" id=\"svg_40\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#444\" x1=\"275\" y1=\"50\" x2=\"225\" y2=\"150\" id=\"svg_38\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#444\" x1=\"125\" y1=\"150\" x2=\"275\" y2=\"50\" id=\"svg_35\" stroke-width=\"10\"/>\n+ <ellipse fill=\"#444\" cx=\"275\" cy=\"50\" id=\"svg_33\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" cx=\"75\" cy=\"350\" id=\"svg_12\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" cx=\"175\" cy=\"350\" id=\"svg_13\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" cx=\"275\" cy=\"350\" id=\"svg_14\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" cx=\"125\" cy=\"150\" id=\"svg_15\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" cx=\"225\" cy=\"150\" id=\"svg_16\" rx=\"20\" ry=\"20\"/>\n+ <line fill=\"none\" stroke=\"#6290c3\" x1=\"75\" y1=\"350\" x2=\"125\" y2=\"150\" id=\"svg_17\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#6290c3\" stroke-width=\"10\" x1=\"125\" y1=\"150\" x2=\"175\" y2=\"350\" id=\"svg_18\"/>\n+ <line fill=\"none\" stroke=\"#6290c3\" stroke-width=\"10\" x1=\"225\" y1=\"150\" x2=\"175\" y2=\"350\" id=\"svg_19\"/>\n+ <line fill=\"none\" stroke=\"#6290c3\" stroke-width=\"10\" x1=\"275\" y1=\"350\" x2=\"225\" y2=\"150\" id=\"svg_20\"/>\n+ <ellipse fill=\"#adeee3\" cx=\"375\" cy=\"350\" id=\"svg_23\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#adeee3\" cx=\"325\" cy=\"250\" id=\"svg_24\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#adeee3\" cx=\"425\" cy=\"250\" id=\"svg_25\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#adeee3\" cx=\"325\" cy=\"450\" id=\"svg_26\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#adeee3\" cx=\"425\" cy=\"450\" id=\"svg_27\" rx=\"20\" ry=\"20\"/>\n+ <line fill=\"none\" stroke=\"#adeee3\" x1=\"325\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_28\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#adeee3\" x1=\"425\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_29\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#adeee3\" x1=\"325\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_30\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#adeee3\" x1=\"425\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_31\" stroke-width=\"10\"/>\n+ </g>\n+ <text transform=\"scale(1.2, 1)\" xml:space=\"preserve\" font-family=\"Arial\" font-weight=\"bold\" font-size=\"200\" id=\"svg_2\" y=\"330\" x=\"300\" stroke-width=\"0\" stroke=\"#343434\" fill=\"#6290c3\">Modelix</text>\n+ </g>\n+</svg>\n\\ No newline at end of file\n" }, { "change_type": "RENAME", "old_path": "logo/logo-with-text-dark.svg", "new_path": "proxy/public/logo-with-text-dark.svg", "diff": "" }, { "change_type": "RENAME", "old_path": "logo/logo-with-text.svg", "new_path": "proxy/public/logo-with-text.svg", "diff": "" }, { "change_type": "RENAME", "old_path": "logo/logo-with-text2.svg", "new_path": "proxy/public/logo-with-text2.svg", "diff": "" }, { "change_type": "MODIFY", "old_path": "proxy/public/logo.svg", "new_path": "proxy/public/logo.svg", "diff": "-<svg width=\"2200\" height=\"500\" xmlns=\"http://www.w3.org/2000/svg\">\n+<svg width=\"500\" height=\"500\" xmlns=\"http://www.w3.org/2000/svg\">\n<g>\n-<!-- <rect fill=\"#343434\" stroke-width=\"4\" x=\"0\" y=\"0\" width=\"2150\" height=\"500\" id=\"svg_42\" stroke=\"#343434\"/>-->\n-<!-- <path fill=\"#343434\" stroke-width=\"4\" stroke=\"#adeee3\" d=\"M22,2 h2106 a20,20 0 0 1 20,20 v456 a20,20 0 0 1 -20,20 h-2106 a20,20 0 0 1 -20,-20 v-456 a20,20 0 0 1 20,-20 z\" />-->\n- <g transform=\"scale(0.6, 0.6) translate(100, 180)\">\n- <line fill=\"none\" stroke=\"#444\" x1=\"425\" y1=\"250\" x2=\"275\" y2=\"50\" id=\"svg_41\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#444\" x1=\"275\" y1=\"50\" x2=\"325\" y2=\"250\" id=\"svg_40\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#444\" x1=\"275\" y1=\"50\" x2=\"225\" y2=\"150\" id=\"svg_38\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#444\" x1=\"125\" y1=\"150\" x2=\"275\" y2=\"50\" id=\"svg_35\" stroke-width=\"10\"/>\n- <ellipse fill=\"#444\" cx=\"275\" cy=\"50\" id=\"svg_33\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" cx=\"75\" cy=\"350\" id=\"svg_12\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" cx=\"175\" cy=\"350\" id=\"svg_13\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" cx=\"275\" cy=\"350\" id=\"svg_14\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" cx=\"125\" cy=\"150\" id=\"svg_15\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#6290c3\" cx=\"225\" cy=\"150\" id=\"svg_16\" rx=\"20\" ry=\"20\"/>\n+ <title>Layer 1</title>\n+<!-- <rect fill=\"#e5e5e5\" stroke-width=\"4\" x=\"2\" y=\"2\" width=\"496\" height=\"496\" id=\"svg_42\" stroke=\"#343434\"/>-->\n+ <path fill=\"#fff\" stroke-width=\"4\" stroke=\"#343434\" d=\"M22,2 h456 a20,20 0 0 1 20,20 v456 a20,20 0 0 1 -20,20 h-456 a20,20 0 0 1 -20,-20 v-456 a20,20 0 0 1 20,-20 z\" />\n+ <line fill=\"none\" stroke=\"#adeee3\" x1=\"425\" y1=\"250\" x2=\"275\" y2=\"50\" id=\"svg_41\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#adeee3\" x1=\"275\" y1=\"50\" x2=\"325\" y2=\"250\" id=\"svg_40\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#adeee3\" x1=\"275\" y1=\"50\" x2=\"225\" y2=\"150\" id=\"svg_38\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#adeee3\" x1=\"125\" y1=\"150\" x2=\"275\" y2=\"50\" id=\"svg_35\" stroke-width=\"10\"/>\n+ <ellipse fill=\"#adeee3\" stroke=\"#adeee3\" stroke-width=\"0\" cx=\"275\" cy=\"50\" id=\"svg_33\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"75\" cy=\"350\" id=\"svg_12\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"175\" cy=\"350\" id=\"svg_13\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"275\" cy=\"350\" id=\"svg_14\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"125\" cy=\"150\" id=\"svg_15\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#6290c3\" stroke=\"#6290c3\" stroke-width=\"0\" cx=\"225\" cy=\"150\" id=\"svg_16\" rx=\"20\" ry=\"20\"/>\n<line fill=\"none\" stroke=\"#6290c3\" x1=\"75\" y1=\"350\" x2=\"125\" y2=\"150\" id=\"svg_17\" stroke-width=\"10\"/>\n<line fill=\"none\" stroke=\"#6290c3\" stroke-width=\"10\" x1=\"125\" y1=\"150\" x2=\"175\" y2=\"350\" id=\"svg_18\"/>\n<line fill=\"none\" stroke=\"#6290c3\" stroke-width=\"10\" x1=\"225\" y1=\"150\" x2=\"175\" y2=\"350\" id=\"svg_19\"/>\n<line fill=\"none\" stroke=\"#6290c3\" stroke-width=\"10\" x1=\"275\" y1=\"350\" x2=\"225\" y2=\"150\" id=\"svg_20\"/>\n- <ellipse fill=\"#adeee3\" cx=\"375\" cy=\"350\" id=\"svg_23\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#adeee3\" cx=\"325\" cy=\"250\" id=\"svg_24\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#adeee3\" cx=\"425\" cy=\"250\" id=\"svg_25\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#adeee3\" cx=\"325\" cy=\"450\" id=\"svg_26\" rx=\"20\" ry=\"20\"/>\n- <ellipse fill=\"#adeee3\" cx=\"425\" cy=\"450\" id=\"svg_27\" rx=\"20\" ry=\"20\"/>\n- <line fill=\"none\" stroke=\"#adeee3\" x1=\"325\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_28\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#adeee3\" x1=\"425\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_29\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#adeee3\" x1=\"325\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_30\" stroke-width=\"10\"/>\n- <line fill=\"none\" stroke=\"#adeee3\" x1=\"425\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_31\" stroke-width=\"10\"/>\n- </g>\n- <text transform=\"scale(1.2, 1)\" xml:space=\"preserve\" font-family=\"Arial\" font-weight=\"bold\" font-size=\"400\" id=\"svg_2\" y=\"400\" x=\"350\" stroke-width=\"0\" stroke=\"#343434\" fill=\"#6290c3\">Modelix</text>\n+ <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"375\" cy=\"350\" id=\"svg_23\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"325\" cy=\"250\" id=\"svg_24\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"425\" cy=\"250\" id=\"svg_25\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"325\" cy=\"450\" id=\"svg_26\" rx=\"20\" ry=\"20\"/>\n+ <ellipse fill=\"#343434\" stroke=\"#343434\" stroke-width=\"0\" cx=\"425\" cy=\"450\" id=\"svg_27\" rx=\"20\" ry=\"20\"/>\n+ <line fill=\"none\" stroke=\"#343434\" x1=\"325\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_28\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#343434\" x1=\"425\" y1=\"250\" x2=\"375\" y2=\"350\" id=\"svg_29\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#343434\" x1=\"325\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_30\" stroke-width=\"10\"/>\n+ <line fill=\"none\" stroke=\"#343434\" x1=\"425\" y1=\"450\" x2=\"375\" y2=\"350\" id=\"svg_31\" stroke-width=\"10\"/>\n</g>\n</svg>\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
logo with small text
426,496
23.08.2022 20:05:51
-7,200
827a445a7ecdcf2ba52a2319c63ddfdbb3df1a69
fixed connection to git repository that doesn't allow basic auth Azure devops uses 'Negotiate' and if basic auth is not allowed the connection failed.
[ { "change_type": "MODIFY", "old_path": "gitui/build.gradle.kts", "new_path": "gitui/build.gradle.kts", "diff": "@@ -29,7 +29,7 @@ dependencies {\nimplementation(\"org.jetbrains.kotlinx\", \"kotlinx-coroutines-jdk8\", kotlinCoroutinesVersion)\nimplementation(\"org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2\")\nimplementation(\"com.charleskorn.kaml:kaml:0.40.0\")\n- implementation(\"org.eclipse.jgit:org.eclipse.jgit:5.8.0.202006091008-r\")\n+ implementation(\"org.eclipse.jgit:org.eclipse.jgit:6.2.0.202206071550-r\")\nimplementation(\"org.apache.maven.shared:maven-invoker:3.1.0\")\nimplementation(\"org.zeroturnaround:zt-zip:1.14\")\nimplementation(\"org.apache.commons:commons-text:1.9\")\n" }, { "change_type": "MODIFY", "old_path": "workspace-manager/build.gradle.kts", "new_path": "workspace-manager/build.gradle.kts", "diff": "@@ -33,7 +33,7 @@ dependencies {\nimplementation(\"org.jetbrains.kotlinx\", \"kotlinx-coroutines-jdk8\", kotlinCoroutinesVersion)\nimplementation(\"org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2\")\nimplementation(\"com.charleskorn.kaml:kaml:0.40.0\")\n- implementation(\"org.eclipse.jgit:org.eclipse.jgit:6.1.0.202203080745-r\")\n+ implementation(\"org.eclipse.jgit:org.eclipse.jgit:6.2.0.202206071550-r\")\nimplementation(\"org.apache.maven.shared:maven-invoker:3.1.0\")\nimplementation(\"org.zeroturnaround:zt-zip:1.14\")\nimplementation(\"org.apache.commons:commons-text:1.9\")\n" }, { "change_type": "MODIFY", "old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/GitRepositoryManager.kt", "new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/GitRepositoryManager.kt", "diff": "@@ -17,12 +17,17 @@ import org.eclipse.jgit.api.Git\nimport org.eclipse.jgit.api.GitCommand\nimport org.eclipse.jgit.api.TransportCommand\nimport org.eclipse.jgit.errors.RepositoryNotFoundException\n+import org.eclipse.jgit.transport.Transport\n+import org.eclipse.jgit.transport.TransportHttp\nimport org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider\n-import org.modelix.model.persistent.HashUtil\n-import org.modelix.workspaces.Credentials\n+import org.eclipse.jgit.transport.http.HttpConnection\n+import org.eclipse.jgit.transport.http.HttpConnectionFactory\n+import org.eclipse.jgit.transport.http.JDKHttpConnection\n+import org.eclipse.jgit.transport.http.JDKHttpConnectionFactory\nimport org.modelix.workspaces.GitRepository\n-import java.io.*\n-import java.lang.IllegalArgumentException\n+import java.io.File\n+import java.io.OutputStream\n+import java.net.*\nimport java.util.zip.ZipOutputStream\nclass GitRepositoryManager(val config: GitRepository, val workspaceDirectory: File) {\n@@ -63,10 +68,44 @@ class GitRepositoryManager(val config: GitRepository, val workspaceDirectory: Fi\nif (encryptedCredentials != null) {\nval decrypted = encryptedCredentials.decrypt()\ncmd.setCredentialsProvider(UsernamePasswordCredentialsProvider(decrypted.user, decrypted.password))\n+ cmd.setTransportConfigCallback { transport ->\n+ transport?.setAuthenticator(object : Authenticator() {\n+ override fun getPasswordAuthentication(): PasswordAuthentication {\n+ return PasswordAuthentication(decrypted.user, decrypted.password.toCharArray())\n+ }\n+ })\n+ }\n}\nreturn cmd\n}\n+ /**\n+ * The credentialsProvider only works with WWW-Authenticate: Basic, but not with WWW-Authenticate: Negotiate.\n+ * This is handled by the JDK.\n+ */\n+ private fun Transport.setAuthenticator(authenticator: Authenticator) {\n+ val transport = this as TransportHttp\n+ val originalFactory = transport.httpConnectionFactory as JDKHttpConnectionFactory\n+ transport.httpConnectionFactory = object : HttpConnectionFactory {\n+ override fun create(url: URL?): HttpConnection {\n+ return modify(originalFactory.create(url))\n+ }\n+\n+ override fun create(url: URL?, proxy: Proxy?): HttpConnection {\n+ return modify(originalFactory.create(url, proxy))\n+ }\n+\n+ fun modify(conn: HttpConnection): HttpConnection {\n+ val jdkConn = conn as JDKHttpConnection\n+ val field = jdkConn.javaClass.getDeclaredField(\"wrappedUrlConnection\")\n+ field.isAccessible = true\n+ val wrapped = field.get(jdkConn) as HttpURLConnection\n+ wrapped.setAuthenticator(authenticator)\n+ return conn\n+ }\n+ }\n+ }\n+\nprivate fun cloneRepo(): Git {\nval cmd = Git.cloneRepository()\napplyCredentials(cmd)\n" }, { "change_type": "ADD", "old_path": null, "new_path": "workspace-manager/src/test/kotlin/CredentialsTest.kt", "diff": "+import com.charleskorn.kaml.Yaml\n+import kotlinx.serialization.decodeFromString\n+import kotlinx.serialization.encodeToString\n+import org.junit.jupiter.api.Assertions\n+import org.junit.jupiter.api.Test\n+import org.modelix.workspaces.Credentials\n+\n+class CredentialsTest {\n+\n+ @Test\n+ fun testEncryption() {\n+ val credentials = Credentials(\"user\", \"1A.23bc\\$\")\n+ val encrypted = credentials.encrypt()\n+ val decrypted = encrypted.decrypt()\n+ Assertions.assertEquals(credentials.password, decrypted.password)\n+ Assertions.assertArrayEquals(credentials.password.toByteArray(), decrypted.password.toByteArray())\n+ }\n+\n+ @Test\n+ fun testSerialization() {\n+ val credentials = Credentials(\"user\", \"1A.23bc\\$\")\n+ val serialized = Yaml.default.encodeToString(credentials)\n+ val deserialized = Yaml.default.decodeFromString<Credentials>(serialized)\n+ val encrypted = deserialized.encrypt()\n+ val serialized2 = Yaml.default.encodeToString(encrypted)\n+ val deserialized2 = Yaml.default.decodeFromString<Credentials>(serialized2)\n+ val decrypted = deserialized2.decrypt()\n+ Assertions.assertEquals(credentials.password, decrypted.password)\n+ Assertions.assertArrayEquals(credentials.password.toByteArray(), decrypted.password.toByteArray())\n+ }\n+\n+}\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
fixed connection to git repository that doesn't allow basic auth Azure devops uses 'Negotiate' and if basic auth is not allowed the connection failed.
426,496
25.08.2022 12:29:12
-7,200
6c94e92c5706ba7eacc8a74b591212cf03fad61d
Meta-model generator from YAML to Kotlin
[ { "change_type": "MODIFY", "old_path": "build.gradle", "new_path": "build.gradle", "diff": "@@ -35,9 +35,9 @@ buildscript {\nplugins {\nid \"com.diffplug.gradle.spotless\" version \"4.5.1\" apply false\n- id \"org.jetbrains.kotlin.jvm\" version \"1.6.21\" apply false\n- id \"org.jetbrains.kotlin.multiplatform\" version \"1.6.21\" apply false\n- id \"org.jetbrains.kotlin.plugin.serialization\" version \"1.6.21\" apply false\n+ id \"org.jetbrains.kotlin.jvm\" version \"$kotlinVersion\" apply false\n+ id \"org.jetbrains.kotlin.multiplatform\" version \"$kotlinVersion\" apply false\n+ id \"org.jetbrains.kotlin.plugin.serialization\" version \"$kotlinVersion\" apply false\nid \"maven-publish\"\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-gen/build.gradle.kts", "diff": "+plugins {\n+ kotlin(\"jvm\")\n+ kotlin(\"plugin.serialization\")\n+}\n+\n+dependencies {\n+ implementation(\"org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2\")\n+ implementation(\"com.charleskorn.kaml:kaml:0.40.0\")\n+ implementation(project(\":metamodel-runtime\"))\n+ implementation(\"com.squareup:kotlinpoet:1.12.0\")\n+ testImplementation(kotlin(\"test\"))\n+ testImplementation(kotlin(\"test-junit\"))\n+}\n+\n+description = \"Generator for Kotlin meta model classes\"\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/definition/Language.kt", "diff": "+package org.modelix.metamodel.definition\n+\n+import kotlinx.serialization.Serializable\n+\n+@Serializable\n+data class Language(\n+ val name: String,\n+ val concepts: List<Concept>,\n+)\n+\n+@Serializable\n+data class Concept(\n+ val name: String,\n+ val properties: List<Property> = emptyList(),\n+ val children: List<Child> = emptyList(),\n+ val references: List<Reference> = emptyList(),\n+ val extends: List<String> = emptyList(),\n+)\n+\n+@Serializable\n+data class Property(\n+ val name: String,\n+ val type: PropertyType = PropertyType.STRING\n+)\n+\n+enum class PropertyType {\n+ STRING,\n+}\n+\n+@Serializable\n+data class Child(\n+ val name: String,\n+ val type: String,\n+ val multiple: Boolean = false,\n+ val optional: Boolean = true,\n+)\n+\n+@Serializable\n+data class Reference(\n+ val name: String,\n+ val type: String,\n+ val optional: Boolean = true,\n+)\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "diff": "+package org.modelix.metamodel.generator\n+\n+import com.squareup.kotlinpoet.*\n+import org.modelix.metamodel.definition.Concept\n+import org.modelix.metamodel.definition.Language\n+import java.nio.file.Path\n+\n+\n+class KotlinGenerator(val outputDir: Path) {\n+\n+ fun generate(languages: List<Language>) {\n+ for (language in languages) {\n+ val builder = FileSpec.builder(language.name, \"Language\")\n+ val file = builder.addType(generateLanguage(language)).build()\n+ for (concept in language.concepts) {\n+ generateConcept(language, concept)\n+ }\n+ file.writeTo(outputDir)\n+ }\n+ }\n+\n+ private fun generateLanguage(language: Language): TypeSpec {\n+ val builder = TypeSpec.classBuilder(ClassName(language.name, \"Language\"))\n+ for (concept in language.concepts) {\n+ builder.addProperty(concept.name, ClassName(language.name, concept.name))\n+ }\n+ return builder.build()\n+ }\n+\n+ private fun generateConcept(language: Language, concept: Concept) {\n+ val fileBuilder = FileSpec.builder(language.name, concept.name)\n+ val builder = TypeSpec.classBuilder(ClassName(language.name, concept.name))\n+ fileBuilder.addType(builder.build())\n+ fileBuilder.build().writeTo(outputDir)\n+ }\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-gen/src/test/kotlin/KotlinGeneratorTest.kt", "diff": "+import com.charleskorn.kaml.Yaml\n+import kotlinx.serialization.decodeFromString\n+import kotlinx.serialization.json.Json\n+import org.junit.Test\n+import org.modelix.metamodel.definition.Language\n+import org.modelix.metamodel.generator.KotlinGenerator\n+import java.io.File\n+import kotlin.io.path.Path\n+\n+class KotlinGeneratorTest {\n+\n+ @Test\n+ fun test() {\n+ val input = \"\"\"\n+ name: org.modelix.entities\n+ concepts:\n+ - name: Entity\n+ properties:\n+ - name: name\n+ children:\n+ - name: properties\n+ type: Property\n+ multiple: true\n+ optional: true\n+ - name: Property\n+ children:\n+ - name: type\n+ type: Type\n+ optional: false\n+ - name: Type\n+ - name: EntityType\n+ extends:\n+ - Type\n+ references:\n+ - name: entity\n+ type: Entity\n+ optional: false\n+ \"\"\".trimIndent()\n+\n+ val language = Yaml.default.decodeFromString<Language>(input)\n+ KotlinGenerator(File(\".\").toPath().resolve(\"languages_gen\")).generate(listOf(language))\n+ }\n+\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-runtime/build.gradle.kts", "diff": "+plugins {\n+ kotlin(\"multiplatform\")\n+ kotlin(\"plugin.serialization\")\n+}\n+\n+val kotlinVersion: String by rootProject\n+\n+kotlin {\n+ jvm()\n+ js() {\n+ //browser {}\n+ nodejs {\n+ testTask {\n+ useMocha {\n+ timeout = \"10s\"\n+ }\n+ }\n+ }\n+ }\n+\n+ sourceSets {\n+ val commonMain by getting {\n+ dependencies {\n+ implementation(kotlin(\"stdlib-common\"))\n+ implementation(\"io.github.microutils:kotlin-logging:2.1.21\")\n+ }\n+ }\n+ val commonTest by getting {\n+ dependencies {\n+ implementation(kotlin(\"test-common\"))\n+ implementation(kotlin(\"test-annotations-common\"))\n+ }\n+ }\n+ val jvmMain by getting {\n+ dependencies {\n+ }\n+ }\n+ val jvmTest by getting {\n+ dependencies {\n+ implementation(kotlin(\"test\"))\n+ implementation(kotlin(\"test-junit\"))\n+ }\n+ }\n+ val jsMain by getting {\n+ dependencies {\n+ }\n+ }\n+ val jsTest by getting {\n+ dependencies {\n+ implementation(kotlin(\"test-js\"))\n+ }\n+ }\n+ }\n+}\n+\n+description = \"Runtime for the meta model generator\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "settings.gradle", "new_path": "settings.gradle", "diff": "@@ -16,3 +16,5 @@ include 'workspace-client'\ninclude 'headless-mps'\ninclude 'gitui'\ninclude 'authorization'\n+include 'metamodel-runtime'\n+include 'metamodel-gen'\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Meta-model generator from YAML to Kotlin
426,496
25.08.2022 14:11:03
-7,200
de92914b947893ebb8da2c5fbc604df5fc2f562c
`node: INode` parameter
[ { "change_type": "MODIFY", "old_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "new_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "diff": "@@ -3,6 +3,7 @@ package org.modelix.metamodel.generator\nimport com.squareup.kotlinpoet.*\nimport org.modelix.metamodel.definition.Concept\nimport org.modelix.metamodel.definition.Language\n+import org.modelix.model.api.INode\nimport java.nio.file.Path\n@@ -22,7 +23,10 @@ class KotlinGenerator(val outputDir: Path) {\nprivate fun generateLanguage(language: Language): TypeSpec {\nval builder = TypeSpec.classBuilder(ClassName(language.name, \"Language\"))\nfor (concept in language.concepts) {\n- builder.addProperty(concept.name, ClassName(language.name, concept.name))\n+ val conceptProperty = PropertySpec.builder(concept.name, ClassName(language.name, concept.name))\n+ .initializer(\"${concept.name}()\")\n+ .build()\n+ builder.addProperty(conceptProperty)\n}\nreturn builder.build()\n}\n@@ -30,6 +34,8 @@ class KotlinGenerator(val outputDir: Path) {\nprivate fun generateConcept(language: Language, concept: Concept) {\nval fileBuilder = FileSpec.builder(language.name, concept.name)\nval builder = TypeSpec.classBuilder(ClassName(language.name, concept.name))\n+ .primaryConstructor(FunSpec.constructorBuilder().addParameter(\"node\", INode::class).build())\n+ .addProperty(PropertySpec.builder(\"node\", INode::class).initializer(\"node\").build())\nfileBuilder.addType(builder.build())\nfileBuilder.build().writeTo(outputDir)\n}\n" }, { "change_type": "MODIFY", "old_path": "metamodel-gen/src/test/kotlin/KotlinGeneratorTest.kt", "new_path": "metamodel-gen/src/test/kotlin/KotlinGeneratorTest.kt", "diff": "@@ -38,7 +38,8 @@ class KotlinGeneratorTest {\n\"\"\".trimIndent()\nval language = Yaml.default.decodeFromString<Language>(input)\n- KotlinGenerator(File(\".\").toPath().resolve(\"languages_gen\")).generate(listOf(language))\n+ val outputDir = File(\".\").toPath().resolve(\"build\").resolve(\"test-generator-output\")\n+ KotlinGenerator(outputDir).generate(listOf(language))\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/build.gradle.kts", "new_path": "metamodel-runtime/build.gradle.kts", "diff": "@@ -4,6 +4,7 @@ plugins {\n}\nval kotlinVersion: String by rootProject\n+val mpsExtensionsVersion: String by rootProject\nkotlin {\njvm()\n@@ -23,6 +24,7 @@ kotlin {\ndependencies {\nimplementation(kotlin(\"stdlib-common\"))\nimplementation(\"io.github.microutils:kotlin-logging:2.1.21\")\n+ api(\"org.modelix:model-api:1.0+\")\n}\n}\nval commonTest by getting {\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
`node: INode` parameter
426,496
25.08.2022 20:19:38
-7,200
89a6d7b827aefd3d44f2e53ce7503ac688d968fb
runtime classes for language and concept and a small demo language
[ { "change_type": "MODIFY", "old_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/definition/Language.kt", "new_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/definition/Language.kt", "diff": "@@ -11,6 +11,7 @@ data class Language(\n@Serializable\ndata class Concept(\nval name: String,\n+ val abstract: Boolean = false,\nval properties: List<Property> = emptyList(),\nval children: List<Child> = emptyList(),\nval references: List<Reference> = emptyList(),\n" }, { "change_type": "MODIFY", "old_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "new_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "diff": "package org.modelix.metamodel.generator\nimport com.squareup.kotlinpoet.*\n+import com.squareup.kotlinpoet.MemberName.Companion.member\n+import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy\n+import org.modelix.metamodel.BaseConceptInstance\n+import org.modelix.metamodel.GeneratedConcept\n+import org.modelix.metamodel.GeneratedLanguage\n+import org.modelix.metamodel.NodeChildren\nimport org.modelix.metamodel.definition.Concept\nimport org.modelix.metamodel.definition.Language\n+import org.modelix.model.api.IConcept\n+import org.modelix.model.api.ILanguage\nimport org.modelix.model.api.INode\nimport java.nio.file.Path\n+import kotlin.reflect.KClass\nclass KotlinGenerator(val outputDir: Path) {\n@@ -14,29 +23,79 @@ class KotlinGenerator(val outputDir: Path) {\nval builder = FileSpec.builder(language.name, \"Language\")\nval file = builder.addType(generateLanguage(language)).build()\nfor (concept in language.concepts) {\n- generateConcept(language, concept)\n+ generateConceptInstanceClass(language, concept)\n}\nfile.writeTo(outputDir)\n}\n}\nprivate fun generateLanguage(language: Language): TypeSpec {\n- val builder = TypeSpec.classBuilder(ClassName(language.name, \"Language\"))\n+ val builder = TypeSpec.objectBuilder(ClassName(language.name, \"Language\"))\n+ val conceptNamesList = language.concepts.joinToString(\", \") { it.name }\n+ builder.addFunction(FunSpec.builder(\"getConcepts\")\n+ .addModifiers(KModifier.OVERRIDE)\n+ .addStatement(\"return listOf($conceptNamesList)\")\n+ .build())\n+ builder.superclass(GeneratedLanguage::class)\nfor (concept in language.concepts) {\n- val conceptProperty = PropertySpec.builder(concept.name, ClassName(language.name, concept.name))\n- .initializer(\"${concept.name}()\")\n- .build()\n- builder.addProperty(conceptProperty)\n+ builder.addType(generateConceptObject(language, concept))\n}\nreturn builder.build()\n}\n- private fun generateConcept(language: Language, concept: Concept) {\n- val fileBuilder = FileSpec.builder(language.name, concept.name)\n- val builder = TypeSpec.classBuilder(ClassName(language.name, concept.name))\n- .primaryConstructor(FunSpec.constructorBuilder().addParameter(\"node\", INode::class).build())\n- .addProperty(PropertySpec.builder(\"node\", INode::class).initializer(\"node\").build())\n- fileBuilder.addType(builder.build())\n+ private fun generateConceptObject(language: Language, concept: Concept): TypeSpec {\n+ return TypeSpec.objectBuilder(concept.name).apply {\n+ superclass(GeneratedConcept::class)\n+ addSuperclassConstructorParameter(concept.abstract.toString())\n+ val instanceClassType = KClass::class.asClassName().parameterizedBy(ClassName(language.name, concept.name + \"Instance\"))\n+ addProperty(PropertySpec.builder(\"instanceClass\", instanceClassType, KModifier.OVERRIDE)\n+ .initializer(concept.name + \"Instance::class\")\n+ .build())\n+ addProperty(PropertySpec.builder(\"language\", ILanguage::class, KModifier.OVERRIDE)\n+ .initializer(\"Language\")\n+ .build())\n+ addFunction(FunSpec.builder(\"wrap\")\n+ .addModifiers(KModifier.OVERRIDE)\n+ .addParameter(\"node\", INode::class)\n+ .addStatement(\"return ${concept.name}Instance(node)\")\n+ .build())\n+ addFunction(FunSpec.builder(\"getDirectSuperConcepts\")\n+ .addModifiers(KModifier.OVERRIDE)\n+ .addStatement(\"return listOf(${concept.extends.joinToString(\", \")})\")\n+ .returns(List::class.asTypeName().parameterizedBy(IConcept::class.asTypeName()))\n+ .build())\n+ }.build()\n+ }\n+\n+ private fun generateConceptInstanceClass(language: Language, concept: Concept) {\n+ val fileBuilder = FileSpec.builder(language.name, concept.name + \"Instance\")\n+ val cls = TypeSpec.classBuilder(ClassName(language.name, concept.name + \"Instance\")).apply {\n+ addProperty(PropertySpec.builder(\"concept\", ClassName(language.name, \"Language.\" + concept.name), KModifier.OVERRIDE)\n+ .initializer(language.name + \".Language.\" + concept.name)\n+ .build())\n+ primaryConstructor(FunSpec.constructorBuilder().addParameter(\"node\", INode::class).build())\n+ superclass(BaseConceptInstance::class)\n+ addSuperclassConstructorParameter(\"node\")\n+ for (property in concept.properties) {\n+ val optionalString = String::class.asTypeName().copy(nullable = true)\n+ addProperty(PropertySpec.builder(property.name, optionalString)\n+ .mutable(true)\n+ .getter(FunSpec.getterBuilder().addStatement(\"\"\"return node.getPropertyValue(\"${property.name}\")\"\"\").build())\n+ .setter(FunSpec.setterBuilder().addParameter(\"v\", optionalString).addStatement(\"\"\"node.setPropertyValue(\"${property.name}\", v)\"\"\").build())\n+ .build())\n+ }\n+ for (link in concept.children) {\n+ // TODO resolve link.type and ensure it exists\n+ val type = NodeChildren::class.asClassName()\n+ .parameterizedBy(\n+ ClassName(language.name, concept.name + \"Instance\"),\n+ ClassName(language.name, link.type + \"Instance\"))\n+ addProperty(PropertySpec.builder(link.name, type)\n+ .initializer(\"\"\"NodeChildren(this, \"${link.name}\", ${language.name}.Language.${link.type}, ${link.type}Instance::class)\"\"\")\n+ .build())\n+ }\n+ }.build()\n+ fileBuilder.addType(cls)\nfileBuilder.build().writeTo(outputDir)\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "RENAME", "old_path": "metamodel-gen/src/test/kotlin/KotlinGeneratorTest.kt", "new_path": "metamodel-gen/src/test/kotlin/org/modelix/metamodel/generator/KotlinGeneratorTest.kt", "diff": "+package org.modelix.metamodel.generator\n+\nimport com.charleskorn.kaml.Yaml\nimport kotlinx.serialization.decodeFromString\n-import kotlinx.serialization.json.Json\nimport org.junit.Test\nimport org.modelix.metamodel.definition.Language\n-import org.modelix.metamodel.generator.KotlinGenerator\nimport java.io.File\n-import kotlin.io.path.Path\nclass KotlinGeneratorTest {\n@@ -38,7 +37,8 @@ class KotlinGeneratorTest {\n\"\"\".trimIndent()\nval language = Yaml.default.decodeFromString<Language>(input)\n- val outputDir = File(\".\").toPath().resolve(\"build\").resolve(\"test-generator-output\")\n+ //val outputDir = File(\".\").toPath().resolve(\"build\").resolve(\"test-generator-output\")\n+ val outputDir = File(\".\").toPath().resolve(\"src/test/kotlin/org/modelix/metamodel/generator/out\")\nKotlinGenerator(outputDir).generate(listOf(language))\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/BaseConceptInstance.kt", "diff": "+package org.modelix.metamodel\n+\n+import org.modelix.model.api.IConcept\n+import org.modelix.model.api.INode\n+import org.modelix.model.api.SimpleConcept\n+\n+val BaseConcept = SimpleConcept(\"BaseConcept\", true)\n+\n+open class BaseConceptInstance(val node: INode) {\n+ open val concept: IConcept = BaseConcept\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConcept.kt", "diff": "+package org.modelix.metamodel\n+\n+import org.modelix.model.api.*\n+import kotlin.reflect.KClass\n+\n+abstract class GeneratedConcept(private val is_abstract: Boolean) : IConcept {\n+ abstract val instanceClass: KClass<out BaseConceptInstance>\n+ private val propertiesMap: MutableMap<String, GeneratedProperty> = LinkedHashMap()\n+ private val childLinksMap: MutableMap<String, GeneratedChildLink> = LinkedHashMap()\n+ private val referenceLinksMap: MutableMap<String, GeneratedReferenceLink> = LinkedHashMap()\n+\n+ abstract fun wrap(node: INode): BaseConceptInstance\n+\n+ override fun isAbstract(): Boolean {\n+ return is_abstract\n+ }\n+\n+ fun newProperty(name: String): IProperty {\n+ return GeneratedProperty(this, name).also {\n+ propertiesMap[name] = it\n+ }\n+ }\n+\n+ fun newChildLink(name: String, isMultiple: Boolean, isOptional: Boolean, targetConcept: IConcept): IChildLink {\n+ return GeneratedChildLink(this, name, isMultiple, isOptional, targetConcept).also {\n+ childLinksMap[name] = it\n+ }\n+ }\n+\n+ fun newReferenceLink(name: String, isOptional: Boolean, targetConcept: IConcept): IReferenceLink {\n+ return GeneratedReferenceLink(this, name, isOptional, targetConcept).also {\n+ referenceLinksMap[name] = it\n+ }\n+ }\n+\n+ override fun getChildLink(name: String): IChildLink {\n+ return childLinksMap[name]\n+ ?: throw IllegalArgumentException(\"Concept ${getLongName()} doesn't contain child link $name\")\n+ }\n+\n+ override fun getProperty(name: String): IProperty {\n+ return propertiesMap[name]\n+ ?: throw IllegalArgumentException(\"Concept ${getLongName()} doesn't contain property $name\")\n+ }\n+\n+ override fun getReferenceLink(name: String): IReferenceLink {\n+ return referenceLinksMap[name]\n+ ?: throw IllegalArgumentException(\"Concept ${getLongName()} doesn't contain reference link $name\")\n+ }\n+\n+ override fun getReference(): IConceptReference {\n+ return UIDConceptReference(getUID())\n+ }\n+\n+ override fun getShortName(): String {\n+ return this::class.simpleName!!\n+ }\n+\n+ override fun getLongName(): String {\n+ return this::class.qualifiedName!!\n+ }\n+\n+ override fun getOwnChildLinks(): List<IChildLink> {\n+ return childLinksMap.values.toList()\n+ }\n+\n+ override fun getOwnReferenceLinks(): List<IReferenceLink> {\n+ return referenceLinksMap.values.toList()\n+ }\n+\n+ override fun getUID(): String {\n+ return this::class.qualifiedName!!\n+ }\n+\n+ override fun isExactly(concept: IConcept?): Boolean {\n+ return concept == this\n+ }\n+\n+ override fun isSubConceptOf(superConcept: IConcept?): Boolean {\n+ if (superConcept == null) return false\n+ if (isExactly(superConcept)) return true\n+\n+ for (c in getDirectSuperConcepts()) {\n+ if (c.isSubConceptOf(superConcept)) return true\n+ }\n+\n+ return false\n+ }\n+\n+ override fun getOwnProperties(): List<IProperty> {\n+ return propertiesMap.values.toList()\n+ }\n+\n+ override fun getAllProperties(): List<IProperty> {\n+ return getAllConcepts().flatMap { it.getOwnProperties() }\n+ }\n+\n+ override fun getAllChildLinks(): List<IChildLink> {\n+ return getAllConcepts().flatMap { it.getOwnChildLinks() }\n+ }\n+\n+ override fun getAllReferenceLinks(): List<IReferenceLink> {\n+ return getAllConcepts().flatMap { it.getOwnReferenceLinks() }\n+ }\n+}\n+\n+class GeneratedProperty(private val owner: IConcept, override val name: String) : IProperty {\n+ override fun getConcept(): IConcept = owner\n+ override fun getUID(): String = getConcept().getUID() + \".\" + name\n+}\n+\n+class GeneratedChildLink(\n+ private val owner: IConcept,\n+ override val name: String,\n+ override val isMultiple: Boolean,\n+ override val isOptional: Boolean,\n+ override val childConcept: IConcept,\n+) : IChildLink {\n+\n+ override fun getConcept(): IConcept = owner\n+\n+ override fun getUID(): String = getConcept().getUID() + \".\" + name\n+}\n+\n+class GeneratedReferenceLink(\n+ private val owner: IConcept,\n+ override val name: String,\n+ override val isOptional: Boolean,\n+ override val targetConcept: IConcept,\n+) : IReferenceLink {\n+\n+ override fun getConcept(): IConcept = owner\n+\n+ override fun getUID(): String = getConcept().getUID() + \".\" + name\n+}\n+\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedLanguage.kt", "diff": "+package org.modelix.metamodel\n+\n+import org.modelix.model.api.ILanguage\n+\n+abstract class GeneratedLanguage : ILanguage {\n+ override fun getName(): String {\n+ return this::class.qualifiedName!!\n+ }\n+\n+ override fun getUID(): String {\n+ return getName()\n+ }\n+\n+\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/LanguageRegistry.kt", "diff": "+package org.modelix.metamodel\n+\n+import org.modelix.model.api.INode\n+\n+object LanguageRegistry {\n+ private val conceptConstructors: MutableMap<String, (INode)->BaseConceptInstance> = HashMap()\n+ fun wrapNode(conceptName: String, node: INode): BaseConceptInstance {\n+ val conceptConstructor = conceptConstructors[conceptName]\n+ ?: throw IllegalArgumentException(\"Unknown concept: $conceptName\")\n+ return conceptConstructor(node)\n+ }\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/NodeChildren.kt", "diff": "+package org.modelix.metamodel\n+\n+import org.modelix.model.api.IConcept\n+import org.modelix.model.api.INode\n+import kotlin.reflect.KClass\n+import kotlin.reflect.cast\n+\n+class NodeChildren<ParentT : BaseConceptInstance, ChildT : BaseConceptInstance>(\n+ val parent: ParentT,\n+ val role: String,\n+ val childConcept: IConcept,\n+ val childType: KClass<ChildT>,\n+) : Iterable<ChildT> {\n+ override fun iterator(): Iterator<ChildT> {\n+ return parent.node.getChildren(role).map {\n+ val wrapped = when (childConcept) {\n+ is GeneratedConcept -> childConcept.wrap(it)\n+ BaseConcept -> BaseConceptInstance(it)\n+ else -> throw RuntimeException(\"Unsupported concept type: ${childConcept::class.qualifiedName} (${childConcept.getLongName()})\")\n+ }\n+ childType.cast(wrapped)\n+ }.iterator()\n+ }\n+\n+ fun addNew(index: Int = -1) {\n+ parent.node.addNewChild(role, index, childConcept)\n+ }\n+\n+ fun remove(child: INode) {\n+ parent.node.removeChild(child)\n+ }\n+\n+ fun remove(child: BaseConceptInstance) {\n+ remove(child.node)\n+ }\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-runtime/src/commonTest/kotlin/org/modelix/metamodel/SandboxLanguage.kt", "diff": "+package org.modelix.metamodel\n+\n+import org.modelix.model.api.*\n+import kotlin.reflect.KClass\n+\n+object SandboxLanguage : GeneratedLanguage() {\n+ override fun getConcepts(): List<IConcept> {\n+ return listOf(Concept1)\n+ }\n+\n+ object Concept1 : GeneratedConcept(false) {\n+ override val instanceClass = Concept1Instance::class\n+ val property1A = newProperty(\"property1A\")\n+ val childLink1A = newChildLink(\"childLink1A\", false, false, Concept2)\n+ val referenceLink1A = newReferenceLink(\"childLink1A\", false, Concept1)\n+\n+ override val language: ILanguage = SandboxLanguage\n+\n+ override fun getDirectSuperConcepts(): List<IConcept> {\n+ return listOf(Concept2)\n+ }\n+\n+ override fun wrap(node: INode) = Concept1Instance(node)\n+ }\n+\n+ class Concept1Instance(node: INode) : BaseConceptInstance(node) {\n+ override val concept = Concept1\n+ var property1A: String?\n+ get() = node.getPropertyValue(\"property1A\")\n+ set(value) = node.setPropertyValue(\"property1A\", value)\n+ val childLink1A = NodeChildren(this, \"childLink1A\", Concept2, Concept2Instance::class)\n+ }\n+\n+ object Concept2 : GeneratedConcept(false) {\n+ override val instanceClass = Concept2Instance::class\n+ override val language: ILanguage\n+ get() = SandboxLanguage\n+\n+ override fun getDirectSuperConcepts(): List<IConcept> {\n+ return listOf()\n+ }\n+\n+ override fun wrap(node: INode) = Concept2Instance(node)\n+ }\n+\n+ class Concept2Instance(node: INode) : BaseConceptInstance(node) {\n+\n+ }\n+}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
runtime classes for language and concept and a small demo language
426,496
26.08.2022 09:55:57
-7,200
66566171f64ac76520254af634a6c286ac84261e
generate example language into separate sub-project
[ { "change_type": "MODIFY", "old_path": "metamodel-gen/src/test/kotlin/org/modelix/metamodel/generator/KotlinGeneratorTest.kt", "new_path": "metamodel-gen/src/test/kotlin/org/modelix/metamodel/generator/KotlinGeneratorTest.kt", "diff": "@@ -38,7 +38,7 @@ class KotlinGeneratorTest {\nval language = Yaml.default.decodeFromString<Language>(input)\n//val outputDir = File(\".\").toPath().resolve(\"build\").resolve(\"test-generator-output\")\n- val outputDir = File(\".\").toPath().resolve(\"src/test/kotlin/org/modelix/metamodel/generator/out\")\n+ val outputDir = File(\"../metamodel-sandbox/src/main/kotlin\").toPath()\nKotlinGenerator(outputDir).generate(listOf(language))\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/build.gradle.kts", "diff": "+plugins {\n+ kotlin(\"jvm\")\n+ kotlin(\"plugin.serialization\")\n+}\n+\n+dependencies {\n+ implementation(project(\":metamodel-runtime\"))\n+ testImplementation(kotlin(\"test\"))\n+ testImplementation(kotlin(\"test-junit\"))\n+}\n" }, { "change_type": "MODIFY", "old_path": "settings.gradle", "new_path": "settings.gradle", "diff": "@@ -18,3 +18,4 @@ include 'gitui'\ninclude 'authorization'\ninclude 'metamodel-runtime'\ninclude 'metamodel-gen'\n+include 'metamodel-sandbox'\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
generate example language into separate sub-project
426,496
26.08.2022 11:20:00
-7,200
6bb3613bc1b58039b0d42777c7303728d5079aa2
generate properties, children and references
[ { "change_type": "MODIFY", "old_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "new_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "diff": "package org.modelix.metamodel.generator\nimport com.squareup.kotlinpoet.*\n-import com.squareup.kotlinpoet.MemberName.Companion.member\nimport com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy\n-import org.modelix.metamodel.BaseConceptInstance\n+import org.modelix.metamodel.GeneratedConceptInstance\nimport org.modelix.metamodel.GeneratedConcept\nimport org.modelix.metamodel.GeneratedLanguage\nimport org.modelix.metamodel.NodeChildren\nimport org.modelix.metamodel.definition.Concept\nimport org.modelix.metamodel.definition.Language\n-import org.modelix.model.api.IConcept\n-import org.modelix.model.api.ILanguage\n-import org.modelix.model.api.INode\n+import org.modelix.model.api.*\nimport java.nio.file.Path\nimport kotlin.reflect.KClass\n@@ -45,7 +42,7 @@ class KotlinGenerator(val outputDir: Path) {\nprivate fun generateConceptObject(language: Language, concept: Concept): TypeSpec {\nreturn TypeSpec.objectBuilder(concept.name).apply {\n- superclass(GeneratedConcept::class)\n+ superclass(GeneratedConcept::class.asTypeName().parameterizedBy(ClassName(language.name, concept.name + \"Instance\")))\naddSuperclassConstructorParameter(concept.abstract.toString())\nval instanceClassType = KClass::class.asClassName().parameterizedBy(ClassName(language.name, concept.name + \"Instance\"))\naddProperty(PropertySpec.builder(\"instanceClass\", instanceClassType, KModifier.OVERRIDE)\n@@ -64,6 +61,21 @@ class KotlinGenerator(val outputDir: Path) {\n.addStatement(\"return listOf(${concept.extends.joinToString(\", \")})\")\n.returns(List::class.asTypeName().parameterizedBy(IConcept::class.asTypeName()))\n.build())\n+ for (property in concept.properties) {\n+ addProperty(PropertySpec.builder(property.name, IProperty::class)\n+ .initializer(\"\"\"newProperty(\"${property.name}\")\"\"\")\n+ .build())\n+ }\n+ for (link in concept.references) {\n+ addProperty(PropertySpec.builder(link.name, IReferenceLink::class)\n+ .initializer(\"\"\"newReferenceLink(\"${link.name}\", ${link.optional}, ${link.type})\"\"\")\n+ .build())\n+ }\n+ for (link in concept.children) {\n+ addProperty(PropertySpec.builder(link.name, IChildLink::class)\n+ .initializer(\"\"\"newChildLink(\"${link.name}\", ${link.multiple}, ${link.optional}, ${link.type})\"\"\")\n+ .build())\n+ }\n}.build()\n}\n@@ -74,14 +86,19 @@ class KotlinGenerator(val outputDir: Path) {\n.initializer(language.name + \".Language.\" + concept.name)\n.build())\nprimaryConstructor(FunSpec.constructorBuilder().addParameter(\"node\", INode::class).build())\n- superclass(BaseConceptInstance::class)\n+ superclass(GeneratedConceptInstance::class)\naddSuperclassConstructorParameter(\"node\")\nfor (property in concept.properties) {\nval optionalString = String::class.asTypeName().copy(nullable = true)\naddProperty(PropertySpec.builder(property.name, optionalString)\n.mutable(true)\n- .getter(FunSpec.getterBuilder().addStatement(\"\"\"return node.getPropertyValue(\"${property.name}\")\"\"\").build())\n- .setter(FunSpec.setterBuilder().addParameter(\"v\", optionalString).addStatement(\"\"\"node.setPropertyValue(\"${property.name}\", v)\"\"\").build())\n+ .delegate(\"\"\"PropertyAccessor(\"${property.name}\")\"\"\")\n+ .build())\n+ }\n+ for (link in concept.references) {\n+ addProperty(PropertySpec.builder(link.name, ClassName(language.name, link.type + \"Instance\").copy(nullable = true))\n+ .mutable(true)\n+ .delegate(\"\"\"ReferenceAccessor(\"${link.name}\", ${link.type}Instance::class)\"\"\")\n.build())\n}\nfor (link in concept.children) {\n" }, { "change_type": "DELETE", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/BaseConceptInstance.kt", "new_path": null, "diff": "-package org.modelix.metamodel\n-\n-import org.modelix.model.api.IConcept\n-import org.modelix.model.api.INode\n-import org.modelix.model.api.SimpleConcept\n-\n-val BaseConcept = SimpleConcept(\"BaseConcept\", true)\n-\n-open class BaseConceptInstance(val node: INode) {\n- open val concept: IConcept = BaseConcept\n-}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConcept.kt", "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConcept.kt", "diff": "@@ -3,13 +3,13 @@ package org.modelix.metamodel\nimport org.modelix.model.api.*\nimport kotlin.reflect.KClass\n-abstract class GeneratedConcept(private val is_abstract: Boolean) : IConcept {\n- abstract val instanceClass: KClass<out BaseConceptInstance>\n+abstract class GeneratedConcept<InstanceT : GeneratedConceptInstance>(private val is_abstract: Boolean) : IConcept {\n+ abstract val instanceClass: KClass<InstanceT>\nprivate val propertiesMap: MutableMap<String, GeneratedProperty> = LinkedHashMap()\nprivate val childLinksMap: MutableMap<String, GeneratedChildLink> = LinkedHashMap()\nprivate val referenceLinksMap: MutableMap<String, GeneratedReferenceLink> = LinkedHashMap()\n- abstract fun wrap(node: INode): BaseConceptInstance\n+ abstract fun wrap(node: INode): InstanceT\noverride fun isAbstract(): Boolean {\nreturn is_abstract\n@@ -49,7 +49,7 @@ abstract class GeneratedConcept(private val is_abstract: Boolean) : IConcept {\n}\noverride fun getReference(): IConceptReference {\n- return UIDConceptReference(getUID())\n+ return GeneratedConceptReference(getUID())\n}\noverride fun getShortName(): String {\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConceptInstance.kt", "diff": "+package org.modelix.metamodel\n+\n+import org.modelix.model.api.IConcept\n+import org.modelix.model.api.INode\n+import kotlin.reflect.KClass\n+import kotlin.reflect.KProperty\n+import kotlin.reflect.cast\n+\n+abstract class GeneratedConceptInstance(val node: INode) {\n+ abstract val concept: IConcept\n+\n+ init {\n+ require(node.concept == concept) { \"Concept of node $node expected to be $concept, but was ${node.concept}\" }\n+ (concept.language as? GeneratedLanguage)?.assertRegistered()\n+ }\n+\n+ class ReferenceAccessor<SourceT : GeneratedConceptInstance, TargetT : GeneratedConceptInstance>(\n+ val role: String,\n+ val targetType: KClass<TargetT>\n+ ) {\n+ operator fun getValue(thisRef: SourceT, property: KProperty<*>): TargetT? {\n+ return thisRef.node.getReferenceTarget(role)?.let { targetType.cast(LanguageRegistry.wrapNode(it)) }\n+ }\n+\n+ operator fun setValue(thisRef: SourceT, property: KProperty<*>, target: TargetT?) {\n+ thisRef.node.setReferenceTarget(role, target?.node)\n+ }\n+ }\n+\n+ class PropertyAccessor(val role: String) {\n+ operator fun getValue(thisRef: GeneratedConceptInstance, property: KProperty<*>): String? {\n+ return thisRef.node.getPropertyValue(role)\n+ }\n+\n+ operator fun setValue(thisRef: GeneratedConceptInstance, property: KProperty<*>, value: String?) {\n+ thisRef.node.setPropertyValue(role, value)\n+ }\n+ }\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConceptReference.kt", "diff": "+package org.modelix.metamodel\n+\n+import org.modelix.model.api.IConcept\n+import org.modelix.model.api.IConceptReference\n+import org.modelix.model.area.IArea\n+\n+class GeneratedConceptReference(val uid: String) : IConceptReference {\n+ override fun resolve(area: IArea?): IConcept? {\n+ return LanguageRegistry.resolveConcept(uid)\n+ }\n+\n+ override fun serialize(): String {\n+ return PREFIX + uid\n+ }\n+\n+ companion object {\n+ const val PREFIX = \"gen:\"\n+ }\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedLanguage.kt", "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedLanguage.kt", "diff": "@@ -3,6 +3,22 @@ package org.modelix.metamodel\nimport org.modelix.model.api.ILanguage\nabstract class GeneratedLanguage : ILanguage {\n+ fun register() {\n+ LanguageRegistry.register(this)\n+ }\n+\n+ fun unregister() {\n+ LanguageRegistry.unregister(this)\n+ }\n+\n+ fun isRegistered(): Boolean {\n+ return LanguageRegistry.isRegistered(this)\n+ }\n+\n+ fun assertRegistered() {\n+ if (!isRegistered()) throw IllegalStateException(\"Language ${getUID()} is not registered\")\n+ }\n+\noverride fun getName(): String {\nreturn this::class.qualifiedName!!\n}\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/LanguageRegistry.kt", "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/LanguageRegistry.kt", "diff": "package org.modelix.metamodel\n+import org.modelix.model.api.IConceptReference\nimport org.modelix.model.api.INode\nobject LanguageRegistry {\n- private val conceptConstructors: MutableMap<String, (INode)->BaseConceptInstance> = HashMap()\n- fun wrapNode(conceptName: String, node: INode): BaseConceptInstance {\n- val conceptConstructor = conceptConstructors[conceptName]\n- ?: throw IllegalArgumentException(\"Unknown concept: $conceptName\")\n- return conceptConstructor(node)\n+ private var languages: Map<String, GeneratedLanguage> = emptyMap()\n+ private var concepts: Map<String, GeneratedConcept<*>> = emptyMap()\n+\n+ init {\n+ IConceptReference.registerDeserializer(this) { serialized ->\n+ if (serialized.startsWith(GeneratedConceptReference.PREFIX)) {\n+ GeneratedConceptReference(serialized.drop(GeneratedConceptReference.PREFIX.length))\n+ } else {\n+ null\n+ }\n+ }\n+ }\n+\n+ fun dispose() {\n+ IConceptReference.unregisterSerializer(this)\n+ }\n+\n+ fun register(language: GeneratedLanguage) {\n+ languages += language.getUID() to language\n+ concepts += language.getConcepts().filterIsInstance<GeneratedConcept<*>>().associateBy { it.getUID() }\n+ }\n+\n+ fun unregister(language: GeneratedLanguage) {\n+ languages -= language.getUID()\n+ concepts -= language.getConcepts().map { it.getUID() }\n+ }\n+\n+ fun isRegistered(language: GeneratedLanguage) = languages[language.getUID()] == language\n+\n+ fun resolveConcept(uid: String): GeneratedConcept<*>? {\n+ return concepts[uid]\n+ }\n+\n+ fun wrapNode(node: INode): GeneratedConceptInstance {\n+ val concept = (node.concept as? GeneratedConcept<*>)\n+ ?: throw IllegalArgumentException(\"Unknown concept: ${node.concept}\")\n+ return concept.wrap(node)\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/NodeChildren.kt", "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/NodeChildren.kt", "diff": "@@ -5,7 +5,7 @@ import org.modelix.model.api.INode\nimport kotlin.reflect.KClass\nimport kotlin.reflect.cast\n-class NodeChildren<ParentT : BaseConceptInstance, ChildT : BaseConceptInstance>(\n+class NodeChildren<ParentT : GeneratedConceptInstance, ChildT : GeneratedConceptInstance>(\nval parent: ParentT,\nval role: String,\nval childConcept: IConcept,\n@@ -14,8 +14,7 @@ class NodeChildren<ParentT : BaseConceptInstance, ChildT : BaseConceptInstance>(\noverride fun iterator(): Iterator<ChildT> {\nreturn parent.node.getChildren(role).map {\nval wrapped = when (childConcept) {\n- is GeneratedConcept -> childConcept.wrap(it)\n- BaseConcept -> BaseConceptInstance(it)\n+ is GeneratedConcept<*> -> childConcept.wrap(it)\nelse -> throw RuntimeException(\"Unsupported concept type: ${childConcept::class.qualifiedName} (${childConcept.getLongName()})\")\n}\nchildType.cast(wrapped)\n@@ -30,7 +29,7 @@ class NodeChildren<ParentT : BaseConceptInstance, ChildT : BaseConceptInstance>(\nparent.node.removeChild(child)\n}\n- fun remove(child: BaseConceptInstance) {\n+ fun remove(child: GeneratedConceptInstance) {\nremove(child.node)\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonTest/kotlin/org/modelix/metamodel/SandboxLanguage.kt", "new_path": "metamodel-runtime/src/commonTest/kotlin/org/modelix/metamodel/SandboxLanguage.kt", "diff": "package org.modelix.metamodel\nimport org.modelix.model.api.*\n-import kotlin.reflect.KClass\nobject SandboxLanguage : GeneratedLanguage() {\noverride fun getConcepts(): List<IConcept> {\nreturn listOf(Concept1)\n}\n- object Concept1 : GeneratedConcept(false) {\n+ object Concept1 : GeneratedConcept<Concept1Instance>(false) {\noverride val instanceClass = Concept1Instance::class\nval property1A = newProperty(\"property1A\")\nval childLink1A = newChildLink(\"childLink1A\", false, false, Concept2)\n@@ -23,15 +22,17 @@ object SandboxLanguage : GeneratedLanguage() {\noverride fun wrap(node: INode) = Concept1Instance(node)\n}\n- class Concept1Instance(node: INode) : BaseConceptInstance(node) {\n+ class Concept1Instance(node: INode) : GeneratedConceptInstance(node) {\noverride val concept = Concept1\n- var property1A: String?\n- get() = node.getPropertyValue(\"property1A\")\n- set(value) = node.setPropertyValue(\"property1A\", value)\n+ var property1A: String? by PropertyAccessor(\"property1A\")\nval childLink1A = NodeChildren(this, \"childLink1A\", Concept2, Concept2Instance::class)\n+ var reference1B: Concept2Instance? by ReferenceAccessor(\"reference1B\", Concept2Instance::class)\n+ var reference1A: Concept2Instance?\n+ get() = node.getReferenceTarget(\"reference1A\")?.let { LanguageRegistry.wrapNode(it) as Concept2Instance }\n+ set(value) = node.setReferenceTarget(\"reference1A\", value?.node)\n}\n- object Concept2 : GeneratedConcept(false) {\n+ object Concept2 : GeneratedConcept<Concept2Instance>(false) {\noverride val instanceClass = Concept2Instance::class\noverride val language: ILanguage\nget() = SandboxLanguage\n@@ -43,7 +44,7 @@ object SandboxLanguage : GeneratedLanguage() {\noverride fun wrap(node: INode) = Concept2Instance(node)\n}\n- class Concept2Instance(node: INode) : BaseConceptInstance(node) {\n-\n+ class Concept2Instance(node: INode) : GeneratedConceptInstance(node) {\n+ override val concept = Concept2\n}\n}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
generate properties, children and references
426,496
26.08.2022 11:29:14
-7,200
8395ead78465c8c2e8ea82af5f52a24959790aa9
Generated language classes renamed to L_...
[ { "change_type": "MODIFY", "old_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "new_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "diff": "@@ -17,7 +17,7 @@ class KotlinGenerator(val outputDir: Path) {\nfun generate(languages: List<Language>) {\nfor (language in languages) {\n- val builder = FileSpec.builder(language.name, \"Language\")\n+ val builder = FileSpec.builder(language.generatedClassName().packageName, language.generatedClassName().simpleName)\nval file = builder.addType(generateLanguage(language)).build()\nfor (concept in language.concepts) {\ngenerateConceptInstanceClass(language, concept)\n@@ -27,7 +27,7 @@ class KotlinGenerator(val outputDir: Path) {\n}\nprivate fun generateLanguage(language: Language): TypeSpec {\n- val builder = TypeSpec.objectBuilder(ClassName(language.name, \"Language\"))\n+ val builder = TypeSpec.objectBuilder(language.generatedClassName())\nval conceptNamesList = language.concepts.joinToString(\", \") { it.name }\nbuilder.addFunction(FunSpec.builder(\"getConcepts\")\n.addModifiers(KModifier.OVERRIDE)\n@@ -49,7 +49,7 @@ class KotlinGenerator(val outputDir: Path) {\n.initializer(concept.name + \"Instance::class\")\n.build())\naddProperty(PropertySpec.builder(\"language\", ILanguage::class, KModifier.OVERRIDE)\n- .initializer(\"Language\")\n+ .initializer(language.generatedClassName().simpleName)\n.build())\naddFunction(FunSpec.builder(\"wrap\")\n.addModifiers(KModifier.OVERRIDE)\n@@ -82,8 +82,8 @@ class KotlinGenerator(val outputDir: Path) {\nprivate fun generateConceptInstanceClass(language: Language, concept: Concept) {\nval fileBuilder = FileSpec.builder(language.name, concept.name + \"Instance\")\nval cls = TypeSpec.classBuilder(ClassName(language.name, concept.name + \"Instance\")).apply {\n- addProperty(PropertySpec.builder(\"concept\", ClassName(language.name, \"Language.\" + concept.name), KModifier.OVERRIDE)\n- .initializer(language.name + \".Language.\" + concept.name)\n+ addProperty(PropertySpec.builder(\"concept\", language.generatedClassName().nestedClass(concept.name), KModifier.OVERRIDE)\n+ .initializer(language.generatedClassName().nestedClass(concept.name).canonicalName)\n.build())\nprimaryConstructor(FunSpec.constructorBuilder().addParameter(\"node\", INode::class).build())\nsuperclass(GeneratedConceptInstance::class)\n@@ -107,12 +107,15 @@ class KotlinGenerator(val outputDir: Path) {\n.parameterizedBy(\nClassName(language.name, concept.name + \"Instance\"),\nClassName(language.name, link.type + \"Instance\"))\n+ val childConceptClassName = language.generatedClassName().nestedClass(link.type).canonicalName\naddProperty(PropertySpec.builder(link.name, type)\n- .initializer(\"\"\"NodeChildren(this, \"${link.name}\", ${language.name}.Language.${link.type}, ${link.type}Instance::class)\"\"\")\n+ .initializer(\"\"\"NodeChildren(this, \"${link.name}\", $childConceptClassName, ${link.type}Instance::class)\"\"\")\n.build())\n}\n}.build()\nfileBuilder.addType(cls)\nfileBuilder.build().writeTo(outputDir)\n}\n+\n+ private fun Language.generatedClassName() = ClassName(name, \"L_\" + name.replace(\".\", \"_\"))\n}\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Generated language classes renamed to L_...
426,496
26.08.2022 12:17:48
-7,200
b037d07a059543ba0a1733977d30369d347f9f01
Clean output directory before generation
[ { "change_type": "MODIFY", "old_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "new_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "diff": "@@ -15,14 +15,30 @@ import kotlin.reflect.KClass\nclass KotlinGenerator(val outputDir: Path) {\n+ private fun FileSpec.write() {\n+ writeTo(outputDir)\n+ }\n+\n+ private fun Language.packageDir(): Path {\n+ val packageName = name\n+ var packageDir = outputDir\n+ if (packageName.isNotEmpty()) {\n+ for (packageComponent in packageName.split('.').dropLastWhile { it.isEmpty() }) {\n+ packageDir = packageDir.resolve(packageComponent)\n+ }\n+ }\n+ return packageDir\n+ }\n+\nfun generate(languages: List<Language>) {\nfor (language in languages) {\n+ language.packageDir().toFile().listFiles()?.filter { it.isFile }?.forEach { it.delete() }\nval builder = FileSpec.builder(language.generatedClassName().packageName, language.generatedClassName().simpleName)\nval file = builder.addType(generateLanguage(language)).build()\nfor (concept in language.concepts) {\ngenerateConceptInstanceClass(language, concept)\n}\n- file.writeTo(outputDir)\n+ file.write()\n}\n}\n@@ -114,7 +130,7 @@ class KotlinGenerator(val outputDir: Path) {\n}\n}.build()\nfileBuilder.addType(cls)\n- fileBuilder.build().writeTo(outputDir)\n+ fileBuilder.build().write()\n}\nprivate fun Language.generatedClassName() = ClassName(name, \"L_\" + name.replace(\".\", \"_\"))\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Clean output directory before generation
426,496
26.08.2022 14:54:13
-7,200
f62bb7660a6e095801ce3efe4a25afd0df410adf
draft of an editor DSL
[ { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/EntityInstance.kt", "diff": "+package org.modelix.entities\n+\n+import kotlin.String\n+import org.modelix.metamodel.GeneratedConceptInstance\n+import org.modelix.metamodel.NodeChildren\n+import org.modelix.model.api.INode\n+\n+public class EntityInstance(\n+ node: INode,\n+) : GeneratedConceptInstance(node) {\n+ public override val concept: L_org_modelix_entities.Entity =\n+ org.modelix.entities.L_org_modelix_entities.Entity\n+\n+ public var name: String? by PropertyAccessor(\"name\")\n+\n+ public val properties: NodeChildren<EntityInstance, PropertyInstance> = NodeChildren(this,\n+ \"properties\", org.modelix.entities.L_org_modelix_entities.Property, PropertyInstance::class)\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/EntityTypeInstance.kt", "diff": "+package org.modelix.entities\n+\n+import org.modelix.metamodel.GeneratedConceptInstance\n+import org.modelix.model.api.INode\n+\n+public class EntityTypeInstance(\n+ node: INode,\n+) : GeneratedConceptInstance(node) {\n+ public override val concept: L_org_modelix_entities.EntityType =\n+ org.modelix.entities.L_org_modelix_entities.EntityType\n+\n+ public var entity: EntityInstance? by ReferenceAccessor(\"entity\", EntityInstance::class)\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/L_org_modelix_entities.kt", "diff": "+package org.modelix.entities\n+\n+import kotlin.collections.List\n+import kotlin.reflect.KClass\n+import org.modelix.metamodel.GeneratedConcept\n+import org.modelix.metamodel.GeneratedLanguage\n+import org.modelix.model.api.IChildLink\n+import org.modelix.model.api.IConcept\n+import org.modelix.model.api.ILanguage\n+import org.modelix.model.api.INode\n+import org.modelix.model.api.IProperty\n+import org.modelix.model.api.IReferenceLink\n+\n+public object L_org_modelix_entities : GeneratedLanguage() {\n+ public override fun getConcepts() = listOf(Entity, Property, Type, EntityType)\n+\n+ public object Entity : GeneratedConcept<EntityInstance>(false) {\n+ public override val instanceClass: KClass<EntityInstance> = EntityInstance::class\n+\n+ public override val language: ILanguage = L_org_modelix_entities\n+\n+ public val name: IProperty = newProperty(\"name\")\n+\n+ public val properties: IChildLink = newChildLink(\"properties\", true, true, Property)\n+\n+ public override fun wrap(node: INode) = EntityInstance(node)\n+\n+ public override fun getDirectSuperConcepts(): List<IConcept> = listOf()\n+ }\n+\n+ public object Property : GeneratedConcept<PropertyInstance>(false) {\n+ public override val instanceClass: KClass<PropertyInstance> = PropertyInstance::class\n+\n+ public override val language: ILanguage = L_org_modelix_entities\n+\n+ public val type: IChildLink = newChildLink(\"type\", false, false, Type)\n+\n+ public override fun wrap(node: INode) = PropertyInstance(node)\n+\n+ public override fun getDirectSuperConcepts(): List<IConcept> = listOf()\n+ }\n+\n+ public object Type : GeneratedConcept<TypeInstance>(false) {\n+ public override val instanceClass: KClass<TypeInstance> = TypeInstance::class\n+\n+ public override val language: ILanguage = L_org_modelix_entities\n+\n+ public override fun wrap(node: INode) = TypeInstance(node)\n+\n+ public override fun getDirectSuperConcepts(): List<IConcept> = listOf()\n+ }\n+\n+ public object EntityType : GeneratedConcept<EntityTypeInstance>(false) {\n+ public override val instanceClass: KClass<EntityTypeInstance> = EntityTypeInstance::class\n+\n+ public override val language: ILanguage = L_org_modelix_entities\n+\n+ public val entity: IReferenceLink = newReferenceLink(\"entity\", false, Entity)\n+\n+ public override fun wrap(node: INode) = EntityTypeInstance(node)\n+\n+ public override fun getDirectSuperConcepts(): List<IConcept> = listOf(Type)\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/PropertyInstance.kt", "diff": "+package org.modelix.entities\n+\n+import org.modelix.metamodel.GeneratedConceptInstance\n+import org.modelix.metamodel.NodeChildren\n+import org.modelix.model.api.INode\n+\n+public class PropertyInstance(\n+ node: INode,\n+) : GeneratedConceptInstance(node) {\n+ public override val concept: L_org_modelix_entities.Property =\n+ org.modelix.entities.L_org_modelix_entities.Property\n+\n+ public val type: NodeChildren<PropertyInstance, TypeInstance> = NodeChildren(this, \"type\",\n+ org.modelix.entities.L_org_modelix_entities.Type, TypeInstance::class)\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/TypeInstance.kt", "diff": "+package org.modelix.entities\n+\n+import org.modelix.metamodel.GeneratedConceptInstance\n+import org.modelix.model.api.INode\n+\n+public class TypeInstance(\n+ node: INode,\n+) : GeneratedConceptInstance(node) {\n+ public override val concept: L_org_modelix_entities.Type =\n+ org.modelix.entities.L_org_modelix_entities.Type\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/editor/EntityEditor.kt", "diff": "+package org.modelix.entities.editor\n+\n+import org.modelix.entities.L_org_modelix_entities\n+import org.modelix.metamodel.GeneratedConcept\n+import org.modelix.metamodel.GeneratedConceptInstance\n+import org.modelix.model.api.IConcept\n+import org.modelix.model.api.ILanguage\n+import org.modelix.model.api.IProperty\n+import org.modelix.model.api.IReferenceLink\n+\n+class EntityEditor {\n+\n+ val editors = languageEditors(L_org_modelix_entities) {\n+ conceptEditor(L_org_modelix_entities.Entity) {\n+ vertical {\n+ horizontal {\n+ constant(\"entity\")\n+ property(concept.name)\n+ curlyBrackets {\n+\n+ }\n+ constant(\"{\")\n+ }\n+ horizontal {\n+ constant(\"}\")\n+ }\n+ modelAccess {\n+ get { node.name }\n+ set { node.name = it }\n+ }\n+ modelAccess(\n+ getter = { node.name },\n+ setter = { node.name = it }\n+ )\n+ }\n+ }\n+ conceptEditor(L_org_modelix_entities.EntityType) {\n+ reference(concept.entity)\n+ }\n+ }\n+\n+ fun register() {\n+ editors.register()\n+ }\n+}\n+\n+open class Cell {\n+ val children: MutableList<Cell> = ArrayList()\n+}\n+\n+class TextCell(val text: String): Cell()\n+\n+\n+fun <LanguageT : ILanguage> languageEditors(language: LanguageT, body: LanguageEditors<LanguageT>.()->Unit): LanguageEditors<LanguageT> {\n+ TODO(\"Not implemented yet\")\n+}\n+\n+class LanguageEditors<LanguageT : ILanguage>(val language: LanguageT) {\n+\n+ fun <NodeT : GeneratedConceptInstance, ConceptT : GeneratedConcept<NodeT>> conceptEditor(concept: ConceptT, body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit): CellBuilder<Cell, NodeT, ConceptT> {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+ fun register() {\n+ TODO(\"Not implemented yet\")\n+ }\n+}\n+\n+class CellBuilder<CellT : Cell, NodeT, ConceptT : IConcept>(val node: NodeT, val concept: ConceptT) {\n+ fun constant(text: String, body: CellBuilder<TextCell, NodeT, ConceptT>.()->Unit = {}) {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+ fun color(color: String) {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+ fun vertical(body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit = {}) {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+ fun horizontal(body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit = {}) {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+ fun brackets(leftSymbol: String, rightSymbol: String, body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit = {}) {\n+ horizontal {\n+ constant(leftSymbol)\n+ body()\n+ constant(rightSymbol)\n+ }\n+ }\n+\n+ fun parentheses(body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit = {}) {\n+ brackets(\"(\", \")\", body)\n+ }\n+\n+ fun curlyBrackets(body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit = {}) {\n+ brackets(\"{\", \"}\", body)\n+ }\n+\n+ fun squareBrackets(body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit = {}) {\n+ brackets(\"[\", \"]\", body)\n+ }\n+\n+ fun indented(body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit = {}) {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+ fun property(property: IProperty): Cell {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+ fun reference(link: IReferenceLink) {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+ fun modelAccess(body: ModelAccessBuilder.()->Unit) {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+ fun modelAccess(getter: ()->String?, setter: (String?)->Unit) {\n+ TODO(\"Not implemented yet\")\n+ }\n+\n+\n+ fun build(): CellT {\n+ TODO(\"Not implemented yet\")\n+ }\n+}\n+\n+class ModelAccessBuilder {\n+ fun get(body: ()->String?) {\n+\n+ }\n+\n+ fun set(body: (String?)->Unit) {\n+\n+ }\n+}\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
draft of an editor DSL
426,496
26.08.2022 15:40:23
-7,200
e3b57eba137162c7bf31e18f9daadb06848acd53
separate source directory for generated sources
[ { "change_type": "MODIFY", "old_path": "metamodel-gen/src/test/kotlin/org/modelix/metamodel/generator/KotlinGeneratorTest.kt", "new_path": "metamodel-gen/src/test/kotlin/org/modelix/metamodel/generator/KotlinGeneratorTest.kt", "diff": "@@ -38,7 +38,7 @@ class KotlinGeneratorTest {\nval language = Yaml.default.decodeFromString<Language>(input)\n//val outputDir = File(\".\").toPath().resolve(\"build\").resolve(\"test-generator-output\")\n- val outputDir = File(\"../metamodel-sandbox/src/main/kotlin\").toPath()\n+ val outputDir = File(\"../metamodel-sandbox/src/main/kotlin_gen\").toPath()\nKotlinGenerator(outputDir).generate(listOf(language))\n}\n" }, { "change_type": "MODIFY", "old_path": "metamodel-sandbox/build.gradle.kts", "new_path": "metamodel-sandbox/build.gradle.kts", "diff": "@@ -8,3 +8,5 @@ dependencies {\ntestImplementation(kotlin(\"test\"))\ntestImplementation(kotlin(\"test-junit\"))\n}\n+\n+sourceSets[\"main\"].java.srcDir(file(\"src/main/kotlin_gen\"))\n\\ No newline at end of file\n" }, { "change_type": "RENAME", "old_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/EntityInstance.kt", "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities/EntityInstance.kt", "diff": "" }, { "change_type": "RENAME", "old_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/EntityTypeInstance.kt", "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities/EntityTypeInstance.kt", "diff": "" }, { "change_type": "RENAME", "old_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/L_org_modelix_entities.kt", "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities/L_org_modelix_entities.kt", "diff": "" }, { "change_type": "RENAME", "old_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/PropertyInstance.kt", "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities/PropertyInstance.kt", "diff": "" }, { "change_type": "RENAME", "old_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/TypeInstance.kt", "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities/TypeInstance.kt", "diff": "" } ]
Kotlin
Apache License 2.0
modelix/modelix
separate source directory for generated sources
426,496
26.08.2022 16:10:10
-7,200
be23711eb38d74a9ebea651e6237023b0b209a9b
reflection doesn't work when compiling to JS
[ { "change_type": "MODIFY", "old_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "new_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "diff": "@@ -50,6 +50,7 @@ class KotlinGenerator(val outputDir: Path) {\n.addStatement(\"return listOf($conceptNamesList)\")\n.build())\nbuilder.superclass(GeneratedLanguage::class)\n+ builder.addSuperclassConstructorParameter(\"\\\"${language.name}\\\"\")\nfor (concept in language.concepts) {\nbuilder.addType(generateConceptObject(language, concept))\n}\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConcept.kt", "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConcept.kt", "diff": "@@ -57,7 +57,7 @@ abstract class GeneratedConcept<InstanceT : GeneratedConceptInstance>(private va\n}\noverride fun getLongName(): String {\n- return this::class.qualifiedName!!\n+ return language!!.getName() + \".\" + getShortName()\n}\noverride fun getOwnChildLinks(): List<IChildLink> {\n@@ -69,7 +69,7 @@ abstract class GeneratedConcept<InstanceT : GeneratedConceptInstance>(private va\n}\noverride fun getUID(): String {\n- return this::class.qualifiedName!!\n+ return GeneratedConceptReference.PREFIX + getLongName()\n}\noverride fun isExactly(concept: IConcept?): Boolean {\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConceptReference.kt", "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConceptReference.kt", "diff": "@@ -5,12 +5,16 @@ import org.modelix.model.api.IConceptReference\nimport org.modelix.model.area.IArea\nclass GeneratedConceptReference(val uid: String) : IConceptReference {\n+ init {\n+ require(uid.startsWith(PREFIX)) { \"UID expected to start with '$PREFIX': $uid\" }\n+ }\n+\noverride fun resolve(area: IArea?): IConcept? {\nreturn LanguageRegistry.resolveConcept(uid)\n}\noverride fun serialize(): String {\n- return PREFIX + uid\n+ return uid\n}\ncompanion object {\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedLanguage.kt", "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedLanguage.kt", "diff": "@@ -2,7 +2,7 @@ package org.modelix.metamodel\nimport org.modelix.model.api.ILanguage\n-abstract class GeneratedLanguage : ILanguage {\n+abstract class GeneratedLanguage(private val name: String) : ILanguage {\nfun register() {\nLanguageRegistry.register(this)\n}\n@@ -20,7 +20,7 @@ abstract class GeneratedLanguage : ILanguage {\n}\noverride fun getName(): String {\n- return this::class.qualifiedName!!\n+ return name\n}\noverride fun getUID(): String {\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/LanguageRegistry.kt", "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/LanguageRegistry.kt", "diff": "@@ -10,7 +10,7 @@ object LanguageRegistry {\ninit {\nIConceptReference.registerDeserializer(this) { serialized ->\nif (serialized.startsWith(GeneratedConceptReference.PREFIX)) {\n- GeneratedConceptReference(serialized.drop(GeneratedConceptReference.PREFIX.length))\n+ GeneratedConceptReference(serialized)\n} else {\nnull\n}\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/NodeChildren.kt", "new_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/NodeChildren.kt", "diff": "@@ -15,7 +15,7 @@ class NodeChildren<ParentT : GeneratedConceptInstance, ChildT : GeneratedConcept\nreturn parent.node.getChildren(role).map {\nval wrapped = when (childConcept) {\nis GeneratedConcept<*> -> childConcept.wrap(it)\n- else -> throw RuntimeException(\"Unsupported concept type: ${childConcept::class.qualifiedName} (${childConcept.getLongName()})\")\n+ else -> throw RuntimeException(\"Unsupported concept type: ${childConcept::class} (${childConcept.getLongName()})\")\n}\nchildType.cast(wrapped)\n}.iterator()\n" }, { "change_type": "MODIFY", "old_path": "metamodel-runtime/src/commonTest/kotlin/org/modelix/metamodel/SandboxLanguage.kt", "new_path": "metamodel-runtime/src/commonTest/kotlin/org/modelix/metamodel/SandboxLanguage.kt", "diff": "@@ -2,7 +2,7 @@ package org.modelix.metamodel\nimport org.modelix.model.api.*\n-object SandboxLanguage : GeneratedLanguage() {\n+object SandboxLanguage : GeneratedLanguage(\"org.modelix.metamodel.sandboxlanguage\") {\noverride fun getConcepts(): List<IConcept> {\nreturn listOf(Concept1)\n}\n" }, { "change_type": "MODIFY", "old_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities/L_org_modelix_entities.kt", "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities/L_org_modelix_entities.kt", "diff": "@@ -11,7 +11,7 @@ import org.modelix.model.api.INode\nimport org.modelix.model.api.IProperty\nimport org.modelix.model.api.IReferenceLink\n-public object L_org_modelix_entities : GeneratedLanguage() {\n+public object L_org_modelix_entities : GeneratedLanguage(\"org.modelix.entities\") {\npublic override fun getConcepts() = listOf(Entity, Property, Type, EntityType)\npublic object Entity : GeneratedConcept<EntityInstance>(false) {\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
reflection doesn't work when compiling to JS
426,496
26.08.2022 18:56:54
-7,200
f7b687368ee62c8f6afe0c52372ef2926158b984
moved meta model generator to the model-api repo The generator project has to be built separately before it can be used. The new location seems to be a good fit.
[ { "change_type": "MODIFY", "old_path": "gradle.properties", "new_path": "gradle.properties", "diff": "@@ -5,3 +5,4 @@ ktorVersion=2.0.2\nkotlinCoroutinesVersion=1.6.0\nkotlinVersion=1.6.21\nlogbackVersion=1.2.1\n+modelApiVersion=1.0.2-1-g55bb72a.dirty-SNAPSHOT\n" }, { "change_type": "DELETE", "old_path": "metamodel-gen/build.gradle.kts", "new_path": null, "diff": "-plugins {\n- kotlin(\"jvm\")\n- kotlin(\"plugin.serialization\")\n-}\n-\n-dependencies {\n- implementation(\"org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2\")\n- implementation(\"com.charleskorn.kaml:kaml:0.40.0\")\n- implementation(project(\":metamodel-runtime\"))\n- implementation(\"com.squareup:kotlinpoet:1.12.0\")\n- testImplementation(kotlin(\"test\"))\n- testImplementation(kotlin(\"test-junit\"))\n-}\n-\n-description = \"Generator for Kotlin meta model classes\"\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/definition/Language.kt", "new_path": null, "diff": "-package org.modelix.metamodel.definition\n-\n-import kotlinx.serialization.Serializable\n-\n-@Serializable\n-data class Language(\n- val name: String,\n- val concepts: List<Concept>,\n-)\n-\n-@Serializable\n-data class Concept(\n- val name: String,\n- val abstract: Boolean = false,\n- val properties: List<Property> = emptyList(),\n- val children: List<Child> = emptyList(),\n- val references: List<Reference> = emptyList(),\n- val extends: List<String> = emptyList(),\n-)\n-\n-@Serializable\n-data class Property(\n- val name: String,\n- val type: PropertyType = PropertyType.STRING\n-)\n-\n-enum class PropertyType {\n- STRING,\n-}\n-\n-@Serializable\n-data class Child(\n- val name: String,\n- val type: String,\n- val multiple: Boolean = false,\n- val optional: Boolean = true,\n-)\n-\n-@Serializable\n-data class Reference(\n- val name: String,\n- val type: String,\n- val optional: Boolean = true,\n-)\n" }, { "change_type": "DELETE", "old_path": "metamodel-gen/src/main/kotlin/org/modelix/metamodel/generator/KotlinGenerator.kt", "new_path": null, "diff": "-package org.modelix.metamodel.generator\n-\n-import com.squareup.kotlinpoet.*\n-import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy\n-import org.modelix.metamodel.GeneratedConceptInstance\n-import org.modelix.metamodel.GeneratedConcept\n-import org.modelix.metamodel.GeneratedLanguage\n-import org.modelix.metamodel.NodeChildren\n-import org.modelix.metamodel.definition.Concept\n-import org.modelix.metamodel.definition.Language\n-import org.modelix.model.api.*\n-import java.nio.file.Path\n-import kotlin.reflect.KClass\n-\n-\n-class KotlinGenerator(val outputDir: Path) {\n-\n- private fun FileSpec.write() {\n- writeTo(outputDir)\n- }\n-\n- private fun Language.packageDir(): Path {\n- val packageName = name\n- var packageDir = outputDir\n- if (packageName.isNotEmpty()) {\n- for (packageComponent in packageName.split('.').dropLastWhile { it.isEmpty() }) {\n- packageDir = packageDir.resolve(packageComponent)\n- }\n- }\n- return packageDir\n- }\n-\n- fun generate(languages: List<Language>) {\n- for (language in languages) {\n- language.packageDir().toFile().listFiles()?.filter { it.isFile }?.forEach { it.delete() }\n- val builder = FileSpec.builder(language.generatedClassName().packageName, language.generatedClassName().simpleName)\n- val file = builder.addType(generateLanguage(language)).build()\n- for (concept in language.concepts) {\n- generateConceptInstanceClass(language, concept)\n- }\n- file.write()\n- }\n- }\n-\n- private fun generateLanguage(language: Language): TypeSpec {\n- val builder = TypeSpec.objectBuilder(language.generatedClassName())\n- val conceptNamesList = language.concepts.joinToString(\", \") { it.name }\n- builder.addFunction(FunSpec.builder(\"getConcepts\")\n- .addModifiers(KModifier.OVERRIDE)\n- .addStatement(\"return listOf($conceptNamesList)\")\n- .build())\n- builder.superclass(GeneratedLanguage::class)\n- builder.addSuperclassConstructorParameter(\"\\\"${language.name}\\\"\")\n- for (concept in language.concepts) {\n- builder.addType(generateConceptObject(language, concept))\n- }\n- return builder.build()\n- }\n-\n- private fun generateConceptObject(language: Language, concept: Concept): TypeSpec {\n- return TypeSpec.objectBuilder(concept.name).apply {\n- superclass(GeneratedConcept::class.asTypeName().parameterizedBy(ClassName(language.name, concept.name + \"Instance\")))\n- addSuperclassConstructorParameter(concept.abstract.toString())\n- val instanceClassType = KClass::class.asClassName().parameterizedBy(ClassName(language.name, concept.name + \"Instance\"))\n- addProperty(PropertySpec.builder(\"instanceClass\", instanceClassType, KModifier.OVERRIDE)\n- .initializer(concept.name + \"Instance::class\")\n- .build())\n- addProperty(PropertySpec.builder(\"language\", ILanguage::class, KModifier.OVERRIDE)\n- .initializer(language.generatedClassName().simpleName)\n- .build())\n- addFunction(FunSpec.builder(\"wrap\")\n- .addModifiers(KModifier.OVERRIDE)\n- .addParameter(\"node\", INode::class)\n- .addStatement(\"return ${concept.name}Instance(node)\")\n- .build())\n- addFunction(FunSpec.builder(\"getDirectSuperConcepts\")\n- .addModifiers(KModifier.OVERRIDE)\n- .addStatement(\"return listOf(${concept.extends.joinToString(\", \")})\")\n- .returns(List::class.asTypeName().parameterizedBy(IConcept::class.asTypeName()))\n- .build())\n- for (property in concept.properties) {\n- addProperty(PropertySpec.builder(property.name, IProperty::class)\n- .initializer(\"\"\"newProperty(\"${property.name}\")\"\"\")\n- .build())\n- }\n- for (link in concept.references) {\n- addProperty(PropertySpec.builder(link.name, IReferenceLink::class)\n- .initializer(\"\"\"newReferenceLink(\"${link.name}\", ${link.optional}, ${link.type})\"\"\")\n- .build())\n- }\n- for (link in concept.children) {\n- addProperty(PropertySpec.builder(link.name, IChildLink::class)\n- .initializer(\"\"\"newChildLink(\"${link.name}\", ${link.multiple}, ${link.optional}, ${link.type})\"\"\")\n- .build())\n- }\n- }.build()\n- }\n-\n- private fun generateConceptInstanceClass(language: Language, concept: Concept) {\n- val fileBuilder = FileSpec.builder(language.name, concept.name + \"Instance\")\n- val cls = TypeSpec.classBuilder(ClassName(language.name, concept.name + \"Instance\")).apply {\n- addProperty(PropertySpec.builder(\"concept\", language.generatedClassName().nestedClass(concept.name), KModifier.OVERRIDE)\n- .initializer(language.generatedClassName().nestedClass(concept.name).canonicalName)\n- .build())\n- primaryConstructor(FunSpec.constructorBuilder().addParameter(\"node\", INode::class).build())\n- superclass(GeneratedConceptInstance::class)\n- addSuperclassConstructorParameter(\"node\")\n- for (property in concept.properties) {\n- val optionalString = String::class.asTypeName().copy(nullable = true)\n- addProperty(PropertySpec.builder(property.name, optionalString)\n- .mutable(true)\n- .delegate(\"\"\"PropertyAccessor(\"${property.name}\")\"\"\")\n- .build())\n- }\n- for (link in concept.references) {\n- addProperty(PropertySpec.builder(link.name, ClassName(language.name, link.type + \"Instance\").copy(nullable = true))\n- .mutable(true)\n- .delegate(\"\"\"ReferenceAccessor(\"${link.name}\", ${link.type}Instance::class)\"\"\")\n- .build())\n- }\n- for (link in concept.children) {\n- // TODO resolve link.type and ensure it exists\n- val type = NodeChildren::class.asClassName()\n- .parameterizedBy(\n- ClassName(language.name, concept.name + \"Instance\"),\n- ClassName(language.name, link.type + \"Instance\"))\n- val childConceptClassName = language.generatedClassName().nestedClass(link.type).canonicalName\n- addProperty(PropertySpec.builder(link.name, type)\n- .initializer(\"\"\"NodeChildren(this, \"${link.name}\", $childConceptClassName, ${link.type}Instance::class)\"\"\")\n- .build())\n- }\n- }.build()\n- fileBuilder.addType(cls)\n- fileBuilder.build().write()\n- }\n-\n- private fun Language.generatedClassName() = ClassName(name, \"L_\" + name.replace(\".\", \"_\"))\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "metamodel-gen/src/test/kotlin/org/modelix/metamodel/generator/KotlinGeneratorTest.kt", "new_path": null, "diff": "-package org.modelix.metamodel.generator\n-\n-import com.charleskorn.kaml.Yaml\n-import kotlinx.serialization.decodeFromString\n-import org.junit.Test\n-import org.modelix.metamodel.definition.Language\n-import java.io.File\n-\n-class KotlinGeneratorTest {\n-\n- @Test\n- fun test() {\n- val input = \"\"\"\n- name: org.modelix.entities\n- concepts:\n- - name: Entity\n- properties:\n- - name: name\n- children:\n- - name: properties\n- type: Property\n- multiple: true\n- optional: true\n- - name: Property\n- children:\n- - name: type\n- type: Type\n- optional: false\n- - name: Type\n- - name: EntityType\n- extends:\n- - Type\n- references:\n- - name: entity\n- type: Entity\n- optional: false\n- \"\"\".trimIndent()\n-\n- val language = Yaml.default.decodeFromString<Language>(input)\n- //val outputDir = File(\".\").toPath().resolve(\"build\").resolve(\"test-generator-output\")\n- val outputDir = File(\"../metamodel-sandbox/src/main/kotlin_gen\").toPath()\n- KotlinGenerator(outputDir).generate(listOf(language))\n- }\n-\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "metamodel-runtime/build.gradle.kts", "new_path": null, "diff": "-plugins {\n- kotlin(\"multiplatform\")\n- kotlin(\"plugin.serialization\")\n-}\n-\n-val kotlinVersion: String by rootProject\n-val mpsExtensionsVersion: String by rootProject\n-\n-kotlin {\n- jvm()\n- js() {\n- //browser {}\n- nodejs {\n- testTask {\n- useMocha {\n- timeout = \"10s\"\n- }\n- }\n- }\n- }\n-\n- sourceSets {\n- val commonMain by getting {\n- dependencies {\n- implementation(kotlin(\"stdlib-common\"))\n- implementation(\"io.github.microutils:kotlin-logging:2.1.21\")\n- api(\"org.modelix:model-api:1.0+\")\n- }\n- }\n- val commonTest by getting {\n- dependencies {\n- implementation(kotlin(\"test-common\"))\n- implementation(kotlin(\"test-annotations-common\"))\n- }\n- }\n- val jvmMain by getting {\n- dependencies {\n- }\n- }\n- val jvmTest by getting {\n- dependencies {\n- implementation(kotlin(\"test\"))\n- implementation(kotlin(\"test-junit\"))\n- }\n- }\n- val jsMain by getting {\n- dependencies {\n- }\n- }\n- val jsTest by getting {\n- dependencies {\n- implementation(kotlin(\"test-js\"))\n- }\n- }\n- }\n-}\n-\n-description = \"Runtime for the meta model generator\"\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConcept.kt", "new_path": null, "diff": "-package org.modelix.metamodel\n-\n-import org.modelix.model.api.*\n-import kotlin.reflect.KClass\n-\n-abstract class GeneratedConcept<InstanceT : GeneratedConceptInstance>(private val is_abstract: Boolean) : IConcept {\n- abstract val instanceClass: KClass<InstanceT>\n- private val propertiesMap: MutableMap<String, GeneratedProperty> = LinkedHashMap()\n- private val childLinksMap: MutableMap<String, GeneratedChildLink> = LinkedHashMap()\n- private val referenceLinksMap: MutableMap<String, GeneratedReferenceLink> = LinkedHashMap()\n-\n- abstract fun wrap(node: INode): InstanceT\n-\n- override fun isAbstract(): Boolean {\n- return is_abstract\n- }\n-\n- fun newProperty(name: String): IProperty {\n- return GeneratedProperty(this, name).also {\n- propertiesMap[name] = it\n- }\n- }\n-\n- fun newChildLink(name: String, isMultiple: Boolean, isOptional: Boolean, targetConcept: IConcept): IChildLink {\n- return GeneratedChildLink(this, name, isMultiple, isOptional, targetConcept).also {\n- childLinksMap[name] = it\n- }\n- }\n-\n- fun newReferenceLink(name: String, isOptional: Boolean, targetConcept: IConcept): IReferenceLink {\n- return GeneratedReferenceLink(this, name, isOptional, targetConcept).also {\n- referenceLinksMap[name] = it\n- }\n- }\n-\n- override fun getChildLink(name: String): IChildLink {\n- return childLinksMap[name]\n- ?: throw IllegalArgumentException(\"Concept ${getLongName()} doesn't contain child link $name\")\n- }\n-\n- override fun getProperty(name: String): IProperty {\n- return propertiesMap[name]\n- ?: throw IllegalArgumentException(\"Concept ${getLongName()} doesn't contain property $name\")\n- }\n-\n- override fun getReferenceLink(name: String): IReferenceLink {\n- return referenceLinksMap[name]\n- ?: throw IllegalArgumentException(\"Concept ${getLongName()} doesn't contain reference link $name\")\n- }\n-\n- override fun getReference(): IConceptReference {\n- return GeneratedConceptReference(getUID())\n- }\n-\n- override fun getShortName(): String {\n- return this::class.simpleName!!\n- }\n-\n- override fun getLongName(): String {\n- return language!!.getName() + \".\" + getShortName()\n- }\n-\n- override fun getOwnChildLinks(): List<IChildLink> {\n- return childLinksMap.values.toList()\n- }\n-\n- override fun getOwnReferenceLinks(): List<IReferenceLink> {\n- return referenceLinksMap.values.toList()\n- }\n-\n- override fun getUID(): String {\n- return GeneratedConceptReference.PREFIX + getLongName()\n- }\n-\n- override fun isExactly(concept: IConcept?): Boolean {\n- return concept == this\n- }\n-\n- override fun isSubConceptOf(superConcept: IConcept?): Boolean {\n- if (superConcept == null) return false\n- if (isExactly(superConcept)) return true\n-\n- for (c in getDirectSuperConcepts()) {\n- if (c.isSubConceptOf(superConcept)) return true\n- }\n-\n- return false\n- }\n-\n- override fun getOwnProperties(): List<IProperty> {\n- return propertiesMap.values.toList()\n- }\n-\n- override fun getAllProperties(): List<IProperty> {\n- return getAllConcepts().flatMap { it.getOwnProperties() }\n- }\n-\n- override fun getAllChildLinks(): List<IChildLink> {\n- return getAllConcepts().flatMap { it.getOwnChildLinks() }\n- }\n-\n- override fun getAllReferenceLinks(): List<IReferenceLink> {\n- return getAllConcepts().flatMap { it.getOwnReferenceLinks() }\n- }\n-}\n-\n-class GeneratedProperty(private val owner: IConcept, override val name: String) : IProperty {\n- override fun getConcept(): IConcept = owner\n- override fun getUID(): String = getConcept().getUID() + \".\" + name\n-}\n-\n-class GeneratedChildLink(\n- private val owner: IConcept,\n- override val name: String,\n- override val isMultiple: Boolean,\n- override val isOptional: Boolean,\n- override val childConcept: IConcept,\n-) : IChildLink {\n-\n- override fun getConcept(): IConcept = owner\n-\n- override fun getUID(): String = getConcept().getUID() + \".\" + name\n-}\n-\n-class GeneratedReferenceLink(\n- private val owner: IConcept,\n- override val name: String,\n- override val isOptional: Boolean,\n- override val targetConcept: IConcept,\n-) : IReferenceLink {\n-\n- override fun getConcept(): IConcept = owner\n-\n- override fun getUID(): String = getConcept().getUID() + \".\" + name\n-}\n-\n" }, { "change_type": "DELETE", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConceptInstance.kt", "new_path": null, "diff": "-package org.modelix.metamodel\n-\n-import org.modelix.model.api.IConcept\n-import org.modelix.model.api.INode\n-import kotlin.reflect.KClass\n-import kotlin.reflect.KProperty\n-import kotlin.reflect.cast\n-\n-abstract class GeneratedConceptInstance(val node: INode) {\n- abstract val concept: IConcept\n-\n- init {\n- require(node.concept == concept) { \"Concept of node $node expected to be $concept, but was ${node.concept}\" }\n- (concept.language as? GeneratedLanguage)?.assertRegistered()\n- }\n-\n- class ReferenceAccessor<SourceT : GeneratedConceptInstance, TargetT : GeneratedConceptInstance>(\n- val role: String,\n- val targetType: KClass<TargetT>\n- ) {\n- operator fun getValue(thisRef: SourceT, property: KProperty<*>): TargetT? {\n- return thisRef.node.getReferenceTarget(role)?.let { targetType.cast(LanguageRegistry.wrapNode(it)) }\n- }\n-\n- operator fun setValue(thisRef: SourceT, property: KProperty<*>, target: TargetT?) {\n- thisRef.node.setReferenceTarget(role, target?.node)\n- }\n- }\n-\n- class PropertyAccessor(val role: String) {\n- operator fun getValue(thisRef: GeneratedConceptInstance, property: KProperty<*>): String? {\n- return thisRef.node.getPropertyValue(role)\n- }\n-\n- operator fun setValue(thisRef: GeneratedConceptInstance, property: KProperty<*>, value: String?) {\n- thisRef.node.setPropertyValue(role, value)\n- }\n- }\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedConceptReference.kt", "new_path": null, "diff": "-package org.modelix.metamodel\n-\n-import org.modelix.model.api.IConcept\n-import org.modelix.model.api.IConceptReference\n-import org.modelix.model.area.IArea\n-\n-class GeneratedConceptReference(val uid: String) : IConceptReference {\n- init {\n- require(uid.startsWith(PREFIX)) { \"UID expected to start with '$PREFIX': $uid\" }\n- }\n-\n- override fun resolve(area: IArea?): IConcept? {\n- return LanguageRegistry.resolveConcept(uid)\n- }\n-\n- override fun serialize(): String {\n- return uid\n- }\n-\n- companion object {\n- const val PREFIX = \"gen:\"\n- }\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/GeneratedLanguage.kt", "new_path": null, "diff": "-package org.modelix.metamodel\n-\n-import org.modelix.model.api.ILanguage\n-\n-abstract class GeneratedLanguage(private val name: String) : ILanguage {\n- fun register() {\n- LanguageRegistry.register(this)\n- }\n-\n- fun unregister() {\n- LanguageRegistry.unregister(this)\n- }\n-\n- fun isRegistered(): Boolean {\n- return LanguageRegistry.isRegistered(this)\n- }\n-\n- fun assertRegistered() {\n- if (!isRegistered()) throw IllegalStateException(\"Language ${getUID()} is not registered\")\n- }\n-\n- override fun getName(): String {\n- return name\n- }\n-\n- override fun getUID(): String {\n- return getName()\n- }\n-\n-\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/LanguageRegistry.kt", "new_path": null, "diff": "-package org.modelix.metamodel\n-\n-import org.modelix.model.api.IConceptReference\n-import org.modelix.model.api.INode\n-\n-object LanguageRegistry {\n- private var languages: Map<String, GeneratedLanguage> = emptyMap()\n- private var concepts: Map<String, GeneratedConcept<*>> = emptyMap()\n-\n- init {\n- IConceptReference.registerDeserializer(this) { serialized ->\n- if (serialized.startsWith(GeneratedConceptReference.PREFIX)) {\n- GeneratedConceptReference(serialized)\n- } else {\n- null\n- }\n- }\n- }\n-\n- fun dispose() {\n- IConceptReference.unregisterSerializer(this)\n- }\n-\n- fun register(language: GeneratedLanguage) {\n- languages += language.getUID() to language\n- concepts += language.getConcepts().filterIsInstance<GeneratedConcept<*>>().associateBy { it.getUID() }\n- }\n-\n- fun unregister(language: GeneratedLanguage) {\n- languages -= language.getUID()\n- concepts -= language.getConcepts().map { it.getUID() }\n- }\n-\n- fun isRegistered(language: GeneratedLanguage) = languages[language.getUID()] == language\n-\n- fun resolveConcept(uid: String): GeneratedConcept<*>? {\n- return concepts[uid]\n- }\n-\n- fun wrapNode(node: INode): GeneratedConceptInstance {\n- val concept = (node.concept as? GeneratedConcept<*>)\n- ?: throw IllegalArgumentException(\"Unknown concept: ${node.concept}\")\n- return concept.wrap(node)\n- }\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "metamodel-runtime/src/commonMain/kotlin/org/modelix/metamodel/NodeChildren.kt", "new_path": null, "diff": "-package org.modelix.metamodel\n-\n-import org.modelix.model.api.IConcept\n-import org.modelix.model.api.INode\n-import kotlin.reflect.KClass\n-import kotlin.reflect.cast\n-\n-class NodeChildren<ParentT : GeneratedConceptInstance, ChildT : GeneratedConceptInstance>(\n- val parent: ParentT,\n- val role: String,\n- val childConcept: IConcept,\n- val childType: KClass<ChildT>,\n-) : Iterable<ChildT> {\n- override fun iterator(): Iterator<ChildT> {\n- return parent.node.getChildren(role).map {\n- val wrapped = when (childConcept) {\n- is GeneratedConcept<*> -> childConcept.wrap(it)\n- else -> throw RuntimeException(\"Unsupported concept type: ${childConcept::class} (${childConcept.getLongName()})\")\n- }\n- childType.cast(wrapped)\n- }.iterator()\n- }\n-\n- fun addNew(index: Int = -1) {\n- parent.node.addNewChild(role, index, childConcept)\n- }\n-\n- fun remove(child: INode) {\n- parent.node.removeChild(child)\n- }\n-\n- fun remove(child: GeneratedConceptInstance) {\n- remove(child.node)\n- }\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "metamodel-runtime/src/commonTest/kotlin/org/modelix/metamodel/SandboxLanguage.kt", "new_path": null, "diff": "-package org.modelix.metamodel\n-\n-import org.modelix.model.api.*\n-\n-object SandboxLanguage : GeneratedLanguage(\"org.modelix.metamodel.sandboxlanguage\") {\n- override fun getConcepts(): List<IConcept> {\n- return listOf(Concept1)\n- }\n-\n- object Concept1 : GeneratedConcept<Concept1Instance>(false) {\n- override val instanceClass = Concept1Instance::class\n- val property1A = newProperty(\"property1A\")\n- val childLink1A = newChildLink(\"childLink1A\", false, false, Concept2)\n- val referenceLink1A = newReferenceLink(\"childLink1A\", false, Concept1)\n-\n- override val language: ILanguage = SandboxLanguage\n-\n- override fun getDirectSuperConcepts(): List<IConcept> {\n- return listOf(Concept2)\n- }\n-\n- override fun wrap(node: INode) = Concept1Instance(node)\n- }\n-\n- class Concept1Instance(node: INode) : GeneratedConceptInstance(node) {\n- override val concept = Concept1\n- var property1A: String? by PropertyAccessor(\"property1A\")\n- val childLink1A = NodeChildren(this, \"childLink1A\", Concept2, Concept2Instance::class)\n- var reference1B: Concept2Instance? by ReferenceAccessor(\"reference1B\", Concept2Instance::class)\n- var reference1A: Concept2Instance?\n- get() = node.getReferenceTarget(\"reference1A\")?.let { LanguageRegistry.wrapNode(it) as Concept2Instance }\n- set(value) = node.setReferenceTarget(\"reference1A\", value?.node)\n- }\n-\n- object Concept2 : GeneratedConcept<Concept2Instance>(false) {\n- override val instanceClass = Concept2Instance::class\n- override val language: ILanguage\n- get() = SandboxLanguage\n-\n- override fun getDirectSuperConcepts(): List<IConcept> {\n- return listOf()\n- }\n-\n- override fun wrap(node: INode) = Concept2Instance(node)\n- }\n-\n- class Concept2Instance(node: INode) : GeneratedConceptInstance(node) {\n- override val concept = Concept2\n- }\n-}\n" }, { "change_type": "MODIFY", "old_path": "metamodel-sandbox/build.gradle.kts", "new_path": "metamodel-sandbox/build.gradle.kts", "diff": "+import org.modelix.metamodel.definition.Language\n+import org.modelix.metamodel.generator.KotlinGenerator\n+\n+buildscript {\n+ repositories {\n+ mavenLocal()\n+ maven { url = uri(\"https://artifacts.itemis.cloud/repository/maven-mps/\") }\n+ }\n+ dependencies {\n+ val modelApiVersion: String by rootProject\n+ classpath(\"org.modelix:metamodel-generator:$modelApiVersion\")\n+ }\n+}\n+\nplugins {\nkotlin(\"jvm\")\nkotlin(\"plugin.serialization\")\n}\ndependencies {\n- implementation(project(\":metamodel-runtime\"))\n+ val modelApiVersion: String by rootProject\n+ implementation(\"org.modelix:metamodel-runtime:$modelApiVersion\")\ntestImplementation(kotlin(\"test\"))\ntestImplementation(kotlin(\"test-junit\"))\n}\n-sourceSets[\"main\"].java.srcDir(file(\"src/main/kotlin_gen\"))\n\\ No newline at end of file\n+val generatorOutputDir = file(\"src/main/kotlin_gen\")\n+sourceSets[\"main\"].java.srcDir(generatorOutputDir)\n+\n+val generateMetaModelSources = tasks.create(\"generateMetaModelSources\") {\n+ val languageFile = file(\"src/main/resources/EntitiesLanguage.yaml\")\n+ inputs.file(languageFile)\n+ outputs.dir(generatorOutputDir)\n+ doLast {\n+ KotlinGenerator(generatorOutputDir.toPath()).generate(listOf(\n+ Language.fromFile(languageFile)\n+ ))\n+ }\n+}\n+\n+tasks.named(\"compileKotlin\") {\n+ dependsOn(generateMetaModelSources)\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/resources/EntitiesLanguage.yaml", "diff": "+name: org.modelix.entities\n+concepts:\n+ - name: Entity\n+ properties:\n+ - name: name\n+ children:\n+ - name: properties\n+ type: Property\n+ multiple: true\n+ optional: true\n+ - name: Property\n+ children:\n+ - name: type\n+ type: Type\n+ optional: false\n+ - name: Type\n+ - name: EntityType\n+ extends:\n+ - Type\n+ references:\n+ - name: entity\n+ type: Entity\n+ optional: false\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "settings.gradle", "new_path": "settings.gradle", "diff": "@@ -16,6 +16,4 @@ include 'workspace-client'\ninclude 'headless-mps'\ninclude 'gitui'\ninclude 'authorization'\n-include 'metamodel-runtime'\n-include 'metamodel-gen'\ninclude 'metamodel-sandbox'\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
moved meta model generator to the model-api repo The generator project has to be built separately before it can be used. The new location seems to be a good fit.
426,496
26.08.2022 19:55:10
-7,200
5b3614970d95fde2ddd01f8c290e2b988c356df4
Kotlin DSL for specifying the meta model In addition to the yaml/json files a language can also be specified in Kotlin and used as an input for the generator.
[ { "change_type": "MODIFY", "old_path": "metamodel-sandbox/build.gradle.kts", "new_path": "metamodel-sandbox/build.gradle.kts", "diff": "-import org.modelix.metamodel.definition.Language\n-import org.modelix.metamodel.generator.KotlinGenerator\n+import org.modelix.metamodel.generator.*\nbuildscript {\nrepositories {\n@@ -27,13 +26,27 @@ dependencies {\nval generatorOutputDir = file(\"src/main/kotlin_gen\")\nsourceSets[\"main\"].java.srcDir(generatorOutputDir)\n+val entitiesLanguage = newLanguage(\"org.modelix.entities2\") {\n+ concept(\"INamedConcept\") {\n+ property(\"name\")\n+ }\n+ concept(\"Entity\") {\n+ extends(\"INamedConcept\")\n+ child0n(\"properties\", \"Property\")\n+ }\n+ concept(\"Property\") {\n+ extends(\"INamedConcept\")\n+ }\n+}\n+\nval generateMetaModelSources = tasks.create(\"generateMetaModelSources\") {\nval languageFile = file(\"src/main/resources/EntitiesLanguage.yaml\")\ninputs.file(languageFile)\noutputs.dir(generatorOutputDir)\ndoLast {\n- KotlinGenerator(generatorOutputDir.toPath()).generate(listOf(\n- Language.fromFile(languageFile)\n+ MetaModelGenerator(generatorOutputDir.toPath()).generate(listOf(\n+ Language.fromFile(languageFile),\n+ entitiesLanguage\n))\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities2/EntityInstance.kt", "diff": "+package org.modelix.entities2\n+\n+import org.modelix.metamodel.GeneratedConceptInstance\n+import org.modelix.metamodel.NodeChildren\n+import org.modelix.model.api.INode\n+\n+public class EntityInstance(\n+ node: INode,\n+) : GeneratedConceptInstance(node) {\n+ public override val concept: L_org_modelix_entities2.Entity =\n+ org.modelix.entities2.L_org_modelix_entities2.Entity\n+\n+ public val properties: NodeChildren<EntityInstance, PropertyInstance> = NodeChildren(this,\n+ \"properties\", org.modelix.entities2.L_org_modelix_entities2.Property, PropertyInstance::class)\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities2/INamedConceptInstance.kt", "diff": "+package org.modelix.entities2\n+\n+import kotlin.String\n+import org.modelix.metamodel.GeneratedConceptInstance\n+import org.modelix.model.api.INode\n+\n+public class INamedConceptInstance(\n+ node: INode,\n+) : GeneratedConceptInstance(node) {\n+ public override val concept: L_org_modelix_entities2.INamedConcept =\n+ org.modelix.entities2.L_org_modelix_entities2.INamedConcept\n+\n+ public var name: String? by PropertyAccessor(\"name\")\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities2/L_org_modelix_entities2.kt", "diff": "+package org.modelix.entities2\n+\n+import kotlin.collections.List\n+import kotlin.reflect.KClass\n+import org.modelix.metamodel.GeneratedConcept\n+import org.modelix.metamodel.GeneratedLanguage\n+import org.modelix.model.api.IChildLink\n+import org.modelix.model.api.IConcept\n+import org.modelix.model.api.ILanguage\n+import org.modelix.model.api.INode\n+import org.modelix.model.api.IProperty\n+\n+public object L_org_modelix_entities2 : GeneratedLanguage(\"org.modelix.entities2\") {\n+ public override fun getConcepts() = listOf(INamedConcept, Entity, Property)\n+\n+ public object INamedConcept : GeneratedConcept<INamedConceptInstance>(false) {\n+ public override val instanceClass: KClass<INamedConceptInstance> = INamedConceptInstance::class\n+\n+ public override val language: ILanguage = L_org_modelix_entities2\n+\n+ public val name: IProperty = newProperty(\"name\")\n+\n+ public override fun wrap(node: INode) = INamedConceptInstance(node)\n+\n+ public override fun getDirectSuperConcepts(): List<IConcept> = listOf()\n+ }\n+\n+ public object Entity : GeneratedConcept<EntityInstance>(false) {\n+ public override val instanceClass: KClass<EntityInstance> = EntityInstance::class\n+\n+ public override val language: ILanguage = L_org_modelix_entities2\n+\n+ public val properties: IChildLink = newChildLink(\"properties\", true, true, Property)\n+\n+ public override fun wrap(node: INode) = EntityInstance(node)\n+\n+ public override fun getDirectSuperConcepts(): List<IConcept> = listOf(INamedConcept)\n+ }\n+\n+ public object Property : GeneratedConcept<PropertyInstance>(false) {\n+ public override val instanceClass: KClass<PropertyInstance> = PropertyInstance::class\n+\n+ public override val language: ILanguage = L_org_modelix_entities2\n+\n+ public override fun wrap(node: INode) = PropertyInstance(node)\n+\n+ public override fun getDirectSuperConcepts(): List<IConcept> = listOf(INamedConcept)\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "metamodel-sandbox/src/main/kotlin_gen/org/modelix/entities2/PropertyInstance.kt", "diff": "+package org.modelix.entities2\n+\n+import org.modelix.metamodel.GeneratedConceptInstance\n+import org.modelix.model.api.INode\n+\n+public class PropertyInstance(\n+ node: INode,\n+) : GeneratedConceptInstance(node) {\n+ public override val concept: L_org_modelix_entities2.Property =\n+ org.modelix.entities2.L_org_modelix_entities2.Property\n+}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Kotlin DSL for specifying the meta model In addition to the yaml/json files a language can also be specified in Kotlin and used as an input for the generator.
426,496
28.08.2022 12:30:41
-7,200
9f4f66ed6390a5491c5e9cdb3470d5d0e4b66551
meta DSLs (3)
[ { "change_type": "MODIFY", "old_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/editor/EditorDSL.kt", "new_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/editor/EditorDSL.kt", "diff": "package org.modelix.entities.editor\nimport org.modelix.metamodel.GeneratedConcept\n-import org.modelix.metamodel.GeneratedConceptInstance\n-import org.modelix.metamodel.IConceptWrapper\n+import org.modelix.metamodel.ITypedConcept\n+import org.modelix.metamodel.ITypedNode\nimport org.modelix.model.api.*\n@@ -12,7 +12,7 @@ fun <LanguageT : ILanguage> languageEditors(language: LanguageT, body: LanguageE\nclass LanguageEditors<LanguageT : ILanguage>(val language: LanguageT) {\n- fun <NodeT : GeneratedConceptInstance, ConceptT : GeneratedConcept<NodeT, WrapperT>, WrapperT : IConceptWrapper> conceptEditor(concept: ConceptT, body: CellBuilder<Cell, NodeT, WrapperT>.()->Unit): CellBuilder<Cell, NodeT, WrapperT> {\n+ fun <NodeT : ITypedNode, ConceptT : GeneratedConcept<NodeT, TypedConceptT>, TypedConceptT : ITypedConcept> conceptEditor(concept: ConceptT, body: CellBuilder<Cell, NodeT, TypedConceptT>.()->Unit): CellBuilder<Cell, NodeT, TypedConceptT> {\nTODO(\"Not implemented yet\")\n}\n@@ -21,7 +21,7 @@ class LanguageEditors<LanguageT : ILanguage>(val language: LanguageT) {\n}\n}\n-class CellBuilder<CellT : Cell, NodeT, ConceptT : IConceptWrapper>(val node: NodeT, val concept: ConceptT) {\n+class CellBuilder<CellT : Cell, NodeT : ITypedNode, ConceptT : ITypedConcept>(val node: NodeT, val concept: ConceptT) {\nval properties = CellProperties()\nfun constant(text: String, body: CellBuilder<TextCell, NodeT, ConceptT>.()->Unit = {}) {\n@@ -52,7 +52,7 @@ class CellBuilder<CellT : Cell, NodeT, ConceptT : IConceptWrapper>(val node: Nod\nbrackets(\"(\", \")\", body)\n}\n- fun curlyBrackets(body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit = {}) {\n+ fun curlyBrackets(singleLine: Boolean = false, body: CellBuilder<Cell, NodeT, ConceptT>.()->Unit = {}) {\nbrackets(\"{\", \"}\", body)\n}\n" }, { "change_type": "MODIFY", "old_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/editor/EntityEditor.kt", "new_path": "metamodel-sandbox/src/main/kotlin/org/modelix/entities/editor/EntityEditor.kt", "diff": "@@ -11,7 +11,7 @@ class EntityEditor {\nhorizontal {\nconstant(\"entity\")\nconcept.name.cell()\n- curlyBrackets {\n+ curlyBrackets() {\n}\nconstant(\"{\")\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
meta DSLs (3)
426,496
31.08.2022 12:07:47
-7,200
d7630b709da40d733d80a1a5683fb10657be2207
use model-api 1.1.0
[ { "change_type": "MODIFY", "old_path": "buildSrc/build.gradle.kts", "new_path": "buildSrc/build.gradle.kts", "diff": "+import java.util.Properties\n+val properties: Properties = file(\"${rootDir.parentFile}/gradle.properties\")\n+ .inputStream().use { stream -> Properties().also { it.load(stream) } }\nplugins {\n- kotlin(\"jvm\") version \"1.6.21\"\n+ val kotlinVersion = \"1.6.21\"\n+ kotlin(\"jvm\") version kotlinVersion\n}\nrepositories {\n@@ -11,6 +15,6 @@ repositories {\n}\ndependencies {\n- val modelApiVersion = \"1.0.2-36-gda67783.dirty-SNAPSHOT\"\n+ val modelApiVersion: String by properties\nimplementation(\"org.modelix:metamodel-generator:$modelApiVersion\")\n}\n" }, { "change_type": "MODIFY", "old_path": "gradle.properties", "new_path": "gradle.properties", "diff": "@@ -6,4 +6,4 @@ ktorVersion=2.0.2\nkotlinCoroutinesVersion=1.6.0\nkotlinVersion=1.6.21\nlogbackVersion=1.2.1\n-modelApiVersion=1.0.2-36-gda67783.dirty-SNAPSHOT\n+modelApiVersion=1.1.+\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
use model-api 1.1.0
426,496
31.08.2022 16:17:33
-7,200
5c02df915ac62389e504801f3cf06008076da1bb
sorted lines
[ { "change_type": "MODIFY", "old_path": "mps/org.modelix.model.client/org.modelix.model.client.msd", "new_path": "mps/org.modelix.model.client/org.modelix.model.client.msd", "diff": "<sourceRoot location=\"model-client.jar\" />\n<sourceRoot location=\"model-client-kotlin-sources.jar\" />\n<sourceRoot location=\"ktor-client-auth-jvm.jar\" />\n+ <sourceRoot location=\"kotlin-stdlib-jdk7.jar\" />\n+ <sourceRoot location=\"kotlin-stdlib-jdk8.jar\" />\n+ <sourceRoot location=\"kotlin-stdlib.jar\" />\n</modelRoot>\n</models>\n<facets>\n</facet>\n</facets>\n<stubModelEntries>\n- <stubModelEntry path=\"${module}/lib/model-client-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/model-client-metadata.jar\" />\n- <stubModelEntry path=\"${module}/lib/model-client.jar\" />\n- <stubModelEntry path=\"${module}/lib/model-client-kotlin-sources.jar\" />\n- <stubModelEntry path=\"${module}/lib/grpc-context.jar\" />\n+ <stubModelEntry path=\"${module}/lib/aopalliance-repackaged.jar\" />\n+ <stubModelEntry path=\"${module}/lib/checker-qual.jar\" />\n<stubModelEntry path=\"${module}/lib/commons-codec.jar\" />\n+ <stubModelEntry path=\"${module}/lib/commons-collections4.jar\" />\n+ <stubModelEntry path=\"${module}/lib/commons-io.jar\" />\n+ <stubModelEntry path=\"${module}/lib/commons-lang3.jar\" />\n<stubModelEntry path=\"${module}/lib/commons-logging.jar\" />\n- <stubModelEntry path=\"${module}/lib/slf4j-api.jar\" />\n+ <stubModelEntry path=\"${module}/lib/error_prone_annotations.jar\" />\n+ <stubModelEntry path=\"${module}/lib/failureaccess.jar\" />\n+ <stubModelEntry path=\"${module}/lib/google-http-client-gson.jar\" />\n+ <stubModelEntry path=\"${module}/lib/google-http-client.jar\" />\n+ <stubModelEntry path=\"${module}/lib/google-oauth-client-java6.jar\" />\n+ <stubModelEntry path=\"${module}/lib/google-oauth-client-jetty.jar\" />\n+ <stubModelEntry path=\"${module}/lib/google-oauth-client.jar\" />\n+ <stubModelEntry path=\"${module}/lib/grpc-context.jar\" />\n<stubModelEntry path=\"${module}/lib/gson.jar\" />\n- <stubModelEntry path=\"${module}/lib/opencensus-api.jar\" />\n- <stubModelEntry path=\"${module}/lib/httpcore.jar\" />\n+ <stubModelEntry path=\"${module}/lib/guava-android.jar\" />\n+ <stubModelEntry path=\"${module}/lib/hk2-api.jar\" />\n+ <stubModelEntry path=\"${module}/lib/hk2-locator.jar\" />\n+ <stubModelEntry path=\"${module}/lib/hk2-utils.jar\" />\n<stubModelEntry path=\"${module}/lib/httpclient.jar\" />\n- <stubModelEntry path=\"${module}/lib/jakarta.validation-api.jar\" />\n- <stubModelEntry path=\"${module}/lib/aopalliance-repackaged.jar\" />\n- <stubModelEntry path=\"${module}/lib/osgi-resource-locator.jar\" />\n+ <stubModelEntry path=\"${module}/lib/httpcore.jar\" />\n+ <stubModelEntry path=\"${module}/lib/j2objc-annotations.jar\" />\n<stubModelEntry path=\"${module}/lib/jakarta.annotation-api.jar\" />\n- <stubModelEntry path=\"${module}/lib/javax.activation-api.jar\" />\n- <stubModelEntry path=\"${module}/lib/javassist-GA.jar\" />\n<stubModelEntry path=\"${module}/lib/jakarta.inject.jar\" />\n- <stubModelEntry path=\"${module}/lib/hk2-utils.jar\" />\n- <stubModelEntry path=\"${module}/lib/hk2-api.jar\" />\n- <stubModelEntry path=\"${module}/lib/hk2-locator.jar\" />\n+ <stubModelEntry path=\"${module}/lib/jakarta.validation-api.jar\" />\n<stubModelEntry path=\"${module}/lib/jakarta.ws.rs-api.jar\" />\n+ <stubModelEntry path=\"${module}/lib/javassist-GA.jar\" />\n+ <stubModelEntry path=\"${module}/lib/javax.activation-api.jar\" />\n+ <stubModelEntry path=\"${module}/lib/jaxb-api.jar\" />\n+ <stubModelEntry path=\"${module}/lib/jersey-client.jar\" />\n<stubModelEntry path=\"${module}/lib/jersey-common.jar\" />\n+ <stubModelEntry path=\"${module}/lib/jersey-hk2.jar\" />\n<stubModelEntry path=\"${module}/lib/jersey-media-jaxb.jar\" />\n- <stubModelEntry path=\"${module}/lib/j2objc-annotations.jar\" />\n- <stubModelEntry path=\"${module}/lib/error_prone_annotations.jar\" />\n- <stubModelEntry path=\"${module}/lib/checker-qual.jar\" />\n+ <stubModelEntry path=\"${module}/lib/jersey-media-sse.jar\" />\n+ <stubModelEntry path=\"${module}/lib/jersey-server.jar\" />\n+ <stubModelEntry path=\"${module}/lib/json.jar\" />\n<stubModelEntry path=\"${module}/lib/jsr305.jar\" />\n- <stubModelEntry path=\"${module}/lib/listenablefuture-empty-to-avoid-conflict-with-guava.jar\" />\n- <stubModelEntry path=\"${module}/lib/failureaccess.jar\" />\n- <stubModelEntry path=\"${module}/lib/vavr-match.jar\" />\n- <stubModelEntry path=\"${module}/lib/kotlinx-serialization-core-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/kotlinx-serialization-json-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/kotlinx-collections-immutable-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/commons-collections4.jar\" />\n- <stubModelEntry path=\"${module}/lib/trove4j.jar\" />\n- <stubModelEntry path=\"${module}/lib/json.jar\" />\n- <stubModelEntry path=\"${module}/lib/commons-io.jar\" />\n- <stubModelEntry path=\"${module}/lib/jaxb-api.jar\" />\n- <stubModelEntry path=\"${module}/lib/jersey-hk2.jar\" />\n- <stubModelEntry path=\"${module}/lib/jersey-client.jar\" />\n- <stubModelEntry path=\"${module}/lib/jersey-server.jar\" />\n- <stubModelEntry path=\"${module}/lib/jersey-media-sse.jar\" />\n- <stubModelEntry path=\"${module}/lib/guava-android.jar\" />\n- <stubModelEntry path=\"${module}/lib/opencensus-contrib-http-util.jar\" />\n- <stubModelEntry path=\"${module}/lib/google-http-client.jar\" />\n- <stubModelEntry path=\"${module}/lib/google-http-client-gson.jar\" />\n- <stubModelEntry path=\"${module}/lib/google-oauth-client.jar\" />\n- <stubModelEntry path=\"${module}/lib/google-oauth-client-java6.jar\" />\n- <stubModelEntry path=\"${module}/lib/google-oauth-client-jetty.jar\" />\n- <stubModelEntry path=\"${module}/lib/commons-lang3.jar\" />\n- <stubModelEntry path=\"${module}/lib/vavr.jar\" />\n+ <stubModelEntry path=\"${module}/lib/kotlinx-coroutines-core-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/kotlinx-coroutines-jdk8.jar\" />\n+ <stubModelEntry path=\"${module}/lib/kotlinx-coroutines-slf4j.jar\" />\n+ <stubModelEntry path=\"${module}/lib/kotlinx-serialization-core-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/kotlinx-serialization-json-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-client-auth-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-client-cio-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-client-content-negotiation-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-client-core-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-events-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-http-cio-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-http-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-io-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-utils-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-network-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-network-tls-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-http-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-websockets-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-serialization-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-serialization-kotlinx-json-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-serialization-kotlinx-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-http-cio-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-utils-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-websocket-serialization-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-events-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/kotlinx-coroutines-core-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/kotlinx-coroutines-slf4j.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-serialization-kotlinx-json-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-client-core-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-client-content-negotiation-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-client-auth-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/ktor-client-cio-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ktor-websockets-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/listenablefuture-empty-to-avoid-conflict-with-guava.jar\" />\n+ <stubModelEntry path=\"${module}/lib/model-client-jvm.jar\" />\n+ <stubModelEntry path=\"${module}/lib/model-client-kotlin-sources.jar\" />\n+ <stubModelEntry path=\"${module}/lib/model-client-metadata.jar\" />\n+ <stubModelEntry path=\"${module}/lib/model-client.jar\" />\n+ <stubModelEntry path=\"${module}/lib/opencensus-api.jar\" />\n+ <stubModelEntry path=\"${module}/lib/opencensus-contrib-http-util.jar\" />\n+ <stubModelEntry path=\"${module}/lib/osgi-resource-locator.jar\" />\n+ <stubModelEntry path=\"${module}/lib/slf4j-api.jar\" />\n+ <stubModelEntry path=\"${module}/lib/trove4j.jar\" />\n+ <stubModelEntry path=\"${module}/lib/vavr-match.jar\" />\n+ <stubModelEntry path=\"${module}/lib/vavr.jar\" />\n</stubModelEntries>\n<sourcePath />\n<dependencies>\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
sorted lines
426,496
31.08.2022 17:29:46
-7,200
1306bcb1d2c6dd60bfce4b29bfdac335ef246ae1
ensure org.modelix.model.client doesn't contain jars already included in org.modelix.model.api
[ { "change_type": "MODIFY", "old_path": "model-client/build.gradle", "new_path": "model-client/build.gradle", "diff": "@@ -147,25 +147,3 @@ spotless {\n'\\n'\n}\n}\n-\n-task copyModelClientToMps(type: Sync) {\n- from configurations.jvmRuntimeClasspath\n- from \"$buildDir/libs\"\n- into \"$projectDir/../mps/org.modelix.model.client/lib\"\n- rename { fileName ->\n- stripVersion(fileName)\n- }\n- exclude 'log4j*.jar'\n- exclude 'annotations*.jar'\n- exclude 'model-api*.jar'\n-}\n-\n-assemble.finalizedBy(copyModelClientToMps)\n-\n-String stripVersion(String fileNameWithVersion) {\n- String name = fileNameWithVersion\n- if (version != null && version.length() > 0) name = name.replace(\"-\" + version, \"\")\n- name = name.replaceAll(/-\\d+(\\.\\d+)*(-SNAPSHOT)?/, \"\")\n- println \"stripVersion($fileNameWithVersion) -> $name\"\n- return name\n-}\n" }, { "change_type": "MODIFY", "old_path": "mps/build.gradle", "new_path": "mps/build.gradle", "diff": "@@ -80,12 +80,53 @@ ext.defaultAntScriptArgs = [\n]\next.buildScriptClasspath = project.configurations.ant_lib.fileCollection({ true })\n+\n+// -------- Model Client ----------------------\n+\n+configurations {\n+ modelApi\n+ modelClient\n+}\n+\n+dependencies {\n+ modelApi(\"org.modelix:model-api:$mpsExtensionsVersion\")\n+ modelClient(project(path: \":model-client\", configuration: \"jvmRuntimeElements\"))\n+}\n+\n+task copyModelClientToMps() {\n+ dependsOn configurations.modelApi\n+ dependsOn configurations.modelClient\n+ doLast {\n+ // copy transitive dependencies without version in the file name\n+ // otherwise each new version would require a change of the MPS solution\n+\n+ def jarsFromModelApi = configurations.modelApi.resolvedConfiguration.resolvedArtifacts\n+ .collect { it.file }.toSet()\n+\n+ def libFolder = file(\"$projectDir/org.modelix.model.client/lib\")\n+ libFolder.deleteDir()\n+ libFolder.mkdir()\n+ def versionsFile = file(\"$libFolder/versions.txt\")\n+\n+ def modelClientResolved = configurations.modelClient.resolvedConfiguration\n+ for (final def artifact in modelClientResolved.resolvedArtifacts) {\n+ if (jarsFromModelApi.contains(artifact.file)) continue\n+ def sourceFile = java.nio.file.Path.of(artifact.file.absolutePath)\n+ def targetFile = java.nio.file.Path.of(libFolder.absolutePath).resolve(artifact.moduleVersion.id.name + \".\" + artifact.extension)\n+ java.nio.file.Files.copy(sourceFile, targetFile)\n+ versionsFile.append(artifact.file.name + \"\\n\")\n+ }\n+ }\n+}\n+\n+// -------------------------------------------\n+\ntask generateMpsBuildScript(type: BuildLanguages, dependsOn: [\nresolveMps,\nresolveMpsArtifacts,\n':ui-client:packageNpmApp',\n':model-client:assemble',\n- ':model-client:copyModelClientToMps'\n+ copyModelClientToMps\n]) {\nscriptArgs = defaultAntScriptArgs\nscriptClasspath = buildScriptClasspath\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.build/models/org.modelix.build.mps", "new_path": "mps/org.modelix.build/models/org.modelix.build.mps", "diff": "</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"1KzYa3AlHrD\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"1KzYa3AlHrE\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"1KzYa3AlHrw\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHrx\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHry\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHrz\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"javassist-GA.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n<node concept=\"1SiIV0\" id=\"1KzYa3AlHrO\" role=\"3bR37C\">\n<node concept=\"1BurEX\" id=\"1KzYa3AlHrP\" role=\"1SiIV1\">\n<node concept=\"398BVA\" id=\"1KzYa3AlHrF\" role=\"1BurEY\">\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"1KzYa3AlHue\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"1KzYa3AlHuf\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"1KzYa3AlHu5\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHu6\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHu7\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHu8\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"listenablefuture-empty-to-avoid-conflict-with-guava.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"1SiIV0\" id=\"1KzYa3AlHu$\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"1KzYa3AlHu_\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"1KzYa3AlHur\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHus\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHut\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHuu\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"model-client-jvm.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"1SiIV0\" id=\"1KzYa3AlHuU\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"1KzYa3AlHuV\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"1KzYa3AlHuL\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHuM\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHuN\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"1KzYa3AlHuO\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"model-client-metadata.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n<node concept=\"1SiIV0\" id=\"1KzYa3AlHv5\" role=\"3bR37C\">\n<node concept=\"1BurEX\" id=\"1KzYa3AlHv6\" role=\"1SiIV1\">\n<node concept=\"398BVA\" id=\"1KzYa3AlHuW\" role=\"1BurEY\">\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"51AkiRkUhMe\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"51AkiRkUhMf\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"51AkiRkUhM5\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"51AkiRkUhM6\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"51AkiRkUhM7\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"51AkiRkUhM8\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"guava-android.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n<node concept=\"1SiIV0\" id=\"51AkiRkUhMO\" role=\"3bR37C\">\n<node concept=\"1BurEX\" id=\"51AkiRkUhMP\" role=\"1SiIV1\">\n<node concept=\"398BVA\" id=\"51AkiRkUhMF\" role=\"1BurEY\">\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"4nxIG0bJc0Z\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"4nxIG0bJc10\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"4nxIG0bJc0Q\" role=\"1BurEY\">\n+ <node concept=\"1SiIV0\" id=\"4nxIG0bJc1_\" role=\"3bR37C\">\n+ <node concept=\"1BurEX\" id=\"4nxIG0bJc1A\" role=\"1SiIV1\">\n+ <node concept=\"398BVA\" id=\"4nxIG0bJc1s\" role=\"1BurEY\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc0R\" role=\"iGT6I\">\n+ <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc1t\" role=\"iGT6I\">\n<property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc0S\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc1u\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc0T\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"model-client-kotlin-sources.jar\" />\n+ <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc1v\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"slf4j-api.jar\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"4nxIG0bJc1_\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"4nxIG0bJc1A\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"4nxIG0bJc1s\" role=\"1BurEY\">\n+ <node concept=\"1SiIV0\" id=\"3cfNRjMvkmj\" role=\"3bR37C\">\n+ <node concept=\"1BurEX\" id=\"3cfNRjMvkmk\" role=\"1SiIV1\">\n+ <node concept=\"398BVA\" id=\"3cfNRjMvkma\" role=\"1BurEY\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc1t\" role=\"iGT6I\">\n+ <node concept=\"2Ry0Ak\" id=\"3cfNRjMvkmb\" role=\"iGT6I\">\n<property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc1u\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"3cfNRjMvkmc\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc1v\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"slf4j-api.jar\" />\n+ <node concept=\"2Ry0Ak\" id=\"3cfNRjMvkmd\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"guava.jar\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"1SiIV0\" id=\"3cfNRjMvknS\" role=\"3bR37C\">\n+ <node concept=\"1BurEX\" id=\"3cfNRjMvknT\" role=\"1SiIV1\">\n+ <node concept=\"398BVA\" id=\"3cfNRjMvknJ\" role=\"1BurEY\">\n+ <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n+ <node concept=\"2Ry0Ak\" id=\"3cfNRjMvknK\" role=\"iGT6I\">\n+ <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n+ <node concept=\"2Ry0Ak\" id=\"3cfNRjMvknL\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"lib\" />\n+ <node concept=\"2Ry0Ak\" id=\"3cfNRjMvknM\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"javassist.jar\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"1SiIV0\" id=\"3cfNRjMvksz\" role=\"3bR37C\">\n+ <node concept=\"1BurEX\" id=\"3cfNRjMvks$\" role=\"1SiIV1\">\n+ <node concept=\"398BVA\" id=\"3cfNRjMvksq\" role=\"1BurEY\">\n+ <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n+ <node concept=\"2Ry0Ak\" id=\"3cfNRjMvksr\" role=\"iGT6I\">\n+ <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n+ <node concept=\"2Ry0Ak\" id=\"3cfNRjMvkss\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"lib\" />\n+ <node concept=\"2Ry0Ak\" id=\"3cfNRjMvkst\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"listenablefuture.jar\" />\n</node>\n</node>\n</node>\n<node concept=\"3LEDTy\" id=\"7BujJjYSJ9v\" role=\"3LEDUa\">\n<ref role=\"3LEDTV\" node=\"7gF2HTviNPn\" resolve=\"org.modelix.ui.sm\" />\n</node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpK_\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L2l\" resolve=\"jetbrains.mps.baseLanguage.logging\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKA\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KZG\" resolve=\"jetbrains.mps.baseLanguage.closures\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKB\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L4j\" resolve=\"jetbrains.mps.lang.actions\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKC\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KYb\" resolve=\"jetbrains.mps.baseLanguage\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKD\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KZ0\" resolve=\"jetbrains.mps.baseLanguageInternal\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKE\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:7c10t$7lQIA\" resolve=\"de.q60.mps.shadowmodels.gen.typesystem\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKF\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:2$QnGbtLXzL\" resolve=\"de.q60.mps.shadowmodels.gen.desugar\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKG\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:4iIKqJTZ5HO\" resolve=\"de.q60.mps.shadowmodels.transformation\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKH\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:14x5$qAUbkb\" resolve=\"jetbrains.mps.lang.access\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKI\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:4iIKqJTZ5Hs\" resolve=\"de.q60.mps.polymorphicfunctions\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKJ\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L2F\" resolve=\"jetbrains.mps.baseLanguage.tuples\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKK\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L0h\" resolve=\"jetbrains.mps.baseLanguage.collections\" />\n+ <node concept=\"3LEDTy\" id=\"3cfNRjMvkuK\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L9c\" resolve=\"jetbrains.mps.lang.quotation\" />\n</node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKL\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L9O\" resolve=\"jetbrains.mps.lang.smodel\" />\n+ <node concept=\"3LEDTy\" id=\"3cfNRjMvkuL\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KXW\" resolve=\"jetbrains.mps.lang.core\" />\n</node>\n- <node concept=\"3LEDTy\" id=\"1zWHbGorpKM\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:4iIKqJTZ5Hg\" resolve=\"de.q60.mps.shadowmodels.gen.afterPF\" />\n+ <node concept=\"3LEDTy\" id=\"3cfNRjMvkuM\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KZc\" resolve=\"jetbrains.mps.baseLanguage.checkedDots\" />\n</node>\n</node>\n<node concept=\"1E1JtD\" id=\"7BujJjXYVmv\" role=\"2G$12L\">\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.model.client/org.modelix.model.client.msd", "new_path": "mps/org.modelix.model.client/org.modelix.model.client.msd", "diff": "<sourceRoot location=\"jakarta.inject.jar\" />\n<sourceRoot location=\"jakarta.validation-api.jar\" />\n<sourceRoot location=\"jakarta.ws.rs-api.jar\" />\n- <sourceRoot location=\"javassist-GA.jar\" />\n<sourceRoot location=\"javax.activation-api.jar\" />\n<sourceRoot location=\"jaxb-api.jar\" />\n<sourceRoot location=\"jersey-client.jar\" />\n<sourceRoot location=\"jersey-server.jar\" />\n<sourceRoot location=\"json.jar\" />\n<sourceRoot location=\"jsr305.jar\" />\n- <sourceRoot location=\"listenablefuture-empty-to-avoid-conflict-with-guava.jar\" />\n- <sourceRoot location=\"model-client-jvm.jar\" />\n- <sourceRoot location=\"model-client-metadata.jar\" />\n<sourceRoot location=\"osgi-resource-locator.jar\" />\n<sourceRoot location=\"trove4j.jar\" />\n<sourceRoot location=\"vavr-match.jar\" />\n<sourceRoot location=\"opencensus-api.jar\" />\n<sourceRoot location=\"opencensus-contrib-http-util.jar\" />\n<sourceRoot location=\"model-client.jar\" />\n- <sourceRoot location=\"model-client-kotlin-sources.jar\" />\n<sourceRoot location=\"ktor-client-auth-jvm.jar\" />\n- <sourceRoot location=\"kotlin-stdlib-jdk7.jar\" />\n- <sourceRoot location=\"kotlin-stdlib-jdk8.jar\" />\n- <sourceRoot location=\"kotlin-stdlib.jar\" />\n+ <sourceRoot location=\"commons-codec.jar\" />\n+ <sourceRoot location=\"commons-logging.jar\" />\n+ <sourceRoot location=\"google-http-client-gson.jar\" />\n+ <sourceRoot location=\"google-http-client.jar\" />\n+ <sourceRoot location=\"google-oauth-client-java6.jar\" />\n+ <sourceRoot location=\"google-oauth-client-jetty.jar\" />\n+ <sourceRoot location=\"google-oauth-client.jar\" />\n+ <sourceRoot location=\"grpc-context.jar\" />\n+ <sourceRoot location=\"gson.jar\" />\n+ <sourceRoot location=\"guava.jar\" />\n+ <sourceRoot location=\"httpclient.jar\" />\n+ <sourceRoot location=\"httpcore.jar\" />\n+ <sourceRoot location=\"javassist.jar\" />\n+ <sourceRoot location=\"kotlinx-collections-immutable-jvm.jar\" />\n+ <sourceRoot location=\"kotlinx-coroutines-core-jvm.jar\" />\n+ <sourceRoot location=\"kotlinx-coroutines-jdk8.jar\" />\n+ <sourceRoot location=\"kotlinx-coroutines-slf4j.jar\" />\n+ <sourceRoot location=\"kotlinx-serialization-core-jvm.jar\" />\n+ <sourceRoot location=\"kotlinx-serialization-json-jvm.jar\" />\n+ <sourceRoot location=\"ktor-client-cio-jvm.jar\" />\n+ <sourceRoot location=\"ktor-client-content-negotiation-jvm.jar\" />\n+ <sourceRoot location=\"ktor-client-core-jvm.jar\" />\n+ <sourceRoot location=\"ktor-events-jvm.jar\" />\n+ <sourceRoot location=\"ktor-http-cio-jvm.jar\" />\n+ <sourceRoot location=\"ktor-http-jvm.jar\" />\n+ <sourceRoot location=\"ktor-io-jvm.jar\" />\n+ <sourceRoot location=\"ktor-network-jvm.jar\" />\n+ <sourceRoot location=\"ktor-network-tls-jvm.jar\" />\n+ <sourceRoot location=\"ktor-serialization-jvm.jar\" />\n+ <sourceRoot location=\"ktor-serialization-kotlinx-json-jvm.jar\" />\n+ <sourceRoot location=\"ktor-serialization-kotlinx-jvm.jar\" />\n+ <sourceRoot location=\"ktor-utils-jvm.jar\" />\n+ <sourceRoot location=\"ktor-websocket-serialization-jvm.jar\" />\n+ <sourceRoot location=\"ktor-websockets-jvm.jar\" />\n+ <sourceRoot location=\"listenablefuture.jar\" />\n+ <sourceRoot location=\"slf4j-api.jar\" />\n</modelRoot>\n</models>\n<facets>\n<stubModelEntry path=\"${module}/lib/google-oauth-client.jar\" />\n<stubModelEntry path=\"${module}/lib/grpc-context.jar\" />\n<stubModelEntry path=\"${module}/lib/gson.jar\" />\n- <stubModelEntry path=\"${module}/lib/guava-android.jar\" />\n+ <stubModelEntry path=\"${module}/lib/guava.jar\" />\n<stubModelEntry path=\"${module}/lib/hk2-api.jar\" />\n<stubModelEntry path=\"${module}/lib/hk2-locator.jar\" />\n<stubModelEntry path=\"${module}/lib/hk2-utils.jar\" />\n<stubModelEntry path=\"${module}/lib/jakarta.inject.jar\" />\n<stubModelEntry path=\"${module}/lib/jakarta.validation-api.jar\" />\n<stubModelEntry path=\"${module}/lib/jakarta.ws.rs-api.jar\" />\n- <stubModelEntry path=\"${module}/lib/javassist-GA.jar\" />\n+ <stubModelEntry path=\"${module}/lib/javassist.jar\" />\n<stubModelEntry path=\"${module}/lib/javax.activation-api.jar\" />\n<stubModelEntry path=\"${module}/lib/jaxb-api.jar\" />\n<stubModelEntry path=\"${module}/lib/jersey-client.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-utils-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-websocket-serialization-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-websockets-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/listenablefuture-empty-to-avoid-conflict-with-guava.jar\" />\n- <stubModelEntry path=\"${module}/lib/model-client-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/model-client-kotlin-sources.jar\" />\n- <stubModelEntry path=\"${module}/lib/model-client-metadata.jar\" />\n+ <stubModelEntry path=\"${module}/lib/listenablefuture.jar\" />\n<stubModelEntry path=\"${module}/lib/model-client.jar\" />\n<stubModelEntry path=\"${module}/lib/opencensus-api.jar\" />\n<stubModelEntry path=\"${module}/lib/opencensus-contrib-http-util.jar\" />\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
ensure org.modelix.model.client doesn't contain jars already included in org.modelix.model.api
426,496
01.09.2022 21:39:54
-7,200
9cea0cbe64353e7dbb77e10940f527ab28ffb5d3
Tokens where expected to be received via http in model export mode Correct is to expect this only in PROJECTOR mode. The gradle plugin was waiting forever.
[ { "change_type": "MODIFY", "old_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.mps", "new_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.mps", "diff": "<node concept=\"17QB3L\" id=\"1VUIoKf$qv5\" role=\"11_B2D\" />\n</node>\n<node concept=\"3K4zz7\" id=\"1VUIoKf$Akg\" role=\"33vP2m\">\n- <node concept=\"37vLTw\" id=\"1VUIoKfA_kw\" role=\"3K4GZi\">\n+ <node concept=\"10Nm6u\" id=\"7rweduTMyFS\" role=\"3K4GZi\" />\n+ <node concept=\"37vLTw\" id=\"7rweduTMyd4\" role=\"3K4E3e\">\n<ref role=\"3cqZAo\" node=\"1VUIoKfAz0x\" resolve=\"workspaceTokenProvider\" />\n</node>\n- <node concept=\"10Nm6u\" id=\"1VUIoKf$Bis\" role=\"3K4E3e\" />\n<node concept=\"3clFbC\" id=\"1VUIoKf$AXw\" role=\"3K4Cdx\">\n- <node concept=\"Rm8GO\" id=\"1VUIoKf$AXx\" role=\"3uHU7w\">\n- <ref role=\"Rm8GQ\" to=\"nhvc:5Le8ZRJdWMd\" resolve=\"DEFAULT\" />\n+ <node concept=\"Rm8GO\" id=\"7rweduTLWRs\" role=\"3uHU7w\">\n+ <ref role=\"Rm8GQ\" to=\"nhvc:DOf0T7u4WT\" resolve=\"PROJECTOR\" />\n<ref role=\"1Px2BO\" to=\"nhvc:5Le8ZRJdWor\" resolve=\"EModelixExecutionMode\" />\n</node>\n<node concept=\"2YIFZM\" id=\"1VUIoKf$AXy\" role=\"3uHU7B\">\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Tokens where expected to be received via http in model export mode Correct is to expect this only in PROJECTOR mode. The gradle plugin was waiting forever.
426,496
01.09.2022 21:47:25
-7,200
a99c750f66e1d087f1a99d27df7457f3f2e9284f
Allow http if only a self-signed certificate is used.
[ { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/ingress.yaml", "new_path": "helm/modelix/templates/common/ingress.yaml", "diff": "@@ -5,6 +5,10 @@ metadata:\nannotations:\nnginx.ingress.kubernetes.io/use-regex: \"true\"\nnginx.ingress.kubernetes.io/proxy-body-size: 200m\n+ {{ if and (not .Values.ingress.tls.crt) (not .Values.ingress.certSecret) }}\n+ # self-signed certificate. Allow http to avoid certificate errors.\n+ nginx.ingress.kubernetes.io/ssl-redirect: \"false\"\n+ {{ end }}\nspec:\ningressClassName: nginx\ntls:\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Allow http if only a self-signed certificate is used.
426,496
02.09.2022 09:58:00
-7,200
9c9ec0ff4230e37a92f6a117070aefcef49f39cc
use the new itemis nexus in the gradle-plugin-test project
[ { "change_type": "MODIFY", "old_path": "gradle-plugin-test/build.gradle", "new_path": "gradle-plugin-test/build.gradle", "diff": "buildscript {\nrepositories {\nmavenCentral()\n- maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }\n+ maven { url 'https://artifacts.itemis.cloud/repository/maven-mps/' }\nmavenLocal()\n}\ndependencies {\n- classpath group: 'org.modelix', name: 'gradle-plugin', version: '2020.3.5-202201200839-SNAPSHOT'\n+ classpath group: 'org.modelix', name: 'gradle-plugin', version: '2020.3.6-202208312022-SNAPSHOT'\n}\n}\nrepositories {\nmavenCentral()\n- maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }\n+ maven { url 'https://artifacts.itemis.cloud/repository/maven-mps/' }\nmavenLocal()\n}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
use the new itemis nexus in the gradle-plugin-test project
426,496
02.09.2022 10:45:25
-7,200
7219a2c87bb8d5075ed9ea89ff91df1d8c8d2a6b
Ensure gradle-plugin-test uses the correct plugin version
[ { "change_type": "MODIFY", "old_path": "gradle-plugin-test/build.gradle", "new_path": "gradle-plugin-test/build.gradle", "diff": "@@ -5,8 +5,14 @@ buildscript {\nmavenLocal()\n}\n+ def versionFile = new File(\"$rootDir/../modelix.version\")\n+ if (!versionFile.exists()) {\n+ throw new GradleException(\"$versionFile doesn't exist\")\n+ }\n+ def modelixVersion = versionFile.text.trim()\n+\ndependencies {\n- classpath group: 'org.modelix', name: 'gradle-plugin', version: '2020.3.6-202208312022-SNAPSHOT'\n+ classpath group: 'org.modelix', name: 'gradle-plugin', version: modelixVersion\n}\n}\n@@ -18,7 +24,6 @@ repositories {\napply plugin: 'modelix-gradle-plugin'\n-\ndef artifactsDir = project.file(\"artifacts\")\ndef mpsDir = project.hasProperty('mpsPath') ? new File(project.property('mpsPath')) : new File(artifactsDir, 'mps')\ndef mpsExtensionsDir = new File(\"./artifacts/de.itemis.mps.extensions\")\n@@ -37,6 +42,7 @@ modelixModel {\nserverUrl = \"https://myserver.com/\"\nrepositoryId = \"repo4\"\ntimeout = 25000\n+ setProjectPath(\"$projectDir/downloadedProject\")\n// // MPS Extensions\n// addLibraryDir(new File(\"${mpsExtensionsDir.getAbsolutePath()}/mps-apache-commons\"))\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Ensure gradle-plugin-test uses the correct plugin version
426,496
02.09.2022 11:42:29
-7,200
e90c89b39ab0f33b2a1356b4ad96b52e27a0f079
Fixed the gradle-plugin-test build script
[ { "change_type": "MODIFY", "old_path": "gradle-plugin-test/build.gradle", "new_path": "gradle-plugin-test/build.gradle", "diff": "@@ -38,11 +38,14 @@ def pluginsDirFromExtensions = [\n\"org.modelix.model.api\",\n\"mps-apache-commons\"]\n+def mpsProjectDir = file(\"$projectDir/downloadedProject\")\n+mpsProjectDir.mkdirs()\n+\nmodelixModel {\n- serverUrl = \"https://myserver.com/\"\n- repositoryId = \"repo4\"\n- timeout = 25000\n- setProjectPath(\"$projectDir/downloadedProject\")\n+ serverUrl = \"http://localhost/model/\"\n+ repositoryId = \"default\"\n+ timeout = 180\n+ setProjectPath(mpsProjectDir.path)\n// // MPS Extensions\n// addLibraryDir(new File(\"${mpsExtensionsDir.getAbsolutePath()}/mps-apache-commons\"))\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Fixed the gradle-plugin-test build script
426,496
07.09.2022 09:10:46
-7,200
184adfa528a72fc20a75b42b906790146f52a305
Git workflow for the model-client is not needed anymore
[ { "change_type": "DELETE", "old_path": ".github/workflows/modelclient.yml", "new_path": null, "diff": "-name: ModelClient\n-\n-on:\n- push:\n- branches:\n- - '**'\n-\n-jobs:\n- build:\n-\n- runs-on: ubuntu-latest\n-\n- steps:\n- - uses: actions/checkout@v1\n- - uses: actions/[email protected]\n- with:\n- path: |\n- ~/.gradle/caches\n- ~/.gradle/wrapper\n- key: gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}\n- restore-keys: |\n- gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}\n- gradle-build-\n- gradle-\n- - name: Set up JDK 11\n- uses: actions/setup-java@v2\n- with:\n- distribution: 'temurin'\n- java-version: '11'\n- - name: Assemble\n- env:\n- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n- run: cd model-client && ../gradlew compileKotlinJs compileKotlinJvm\n-\n- jvmTest:\n-\n- runs-on: ubuntu-latest\n-\n- steps:\n- - uses: actions/checkout@v1\n- - name: Set up JDK 11\n- uses: actions/setup-java@v2\n- with:\n- distribution: 'temurin'\n- java-version: '11'\n- - uses: actions/[email protected]\n- with:\n- path: |\n- ~/.gradle/caches\n- ~/.gradle/wrapper\n- key: gradle-jvmTest-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}\n- restore-keys: |\n- gradle-jvmTest-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}\n- gradle-jvmTest-\n- gradle-\n- - name: Run JVM unit tests\n- env:\n- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n- run: cd model-client && ../gradlew jvmTest\n-\n- jsTest:\n-\n- runs-on: ubuntu-latest\n-\n- steps:\n- - uses: actions/checkout@v1\n- - name: Set up JDK 11\n- uses: actions/setup-java@v2\n- with:\n- distribution: 'temurin'\n- java-version: '11'\n- - uses: actions/[email protected]\n- with:\n- path: |\n- ~/.gradle/caches\n- ~/.gradle/wrapper\n- key: gradle-jsTest-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}\n- restore-keys: |\n- gradle-jsTest-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}\n- gradle-jsTest-\n- gradle-\n- - name: Run JS unit tests\n- env:\n- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n- run: cd model-client && ../gradlew jsTest\n-\n- lint:\n-\n- runs-on: ubuntu-latest\n-\n- steps:\n- - uses: actions/checkout@v1\n- - name: Set up JDK 11\n- uses: actions/setup-java@v2\n- with:\n- distribution: 'temurin'\n- java-version: '11'\n- - uses: actions/[email protected]\n- with:\n- path: |\n- ~/.gradle/caches\n- ~/.gradle/wrapper\n- key: gradle-lint-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}\n- restore-keys: |\n- gradle-lint-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}\n- gradle-lint-\n- gradle-\n- - name: Run linter\n- env:\n- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n- run: cd model-client && ../gradlew ktlintCheck\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Git workflow for the model-client is not needed anymore
426,496
07.09.2022 09:31:15
-7,200
9c4dfbb605f91b21d29e05e8aa3fcb5e5c31ffe5
Moved some tests from model-client model-server They need the model server and after the repository split the client cannot have a dependency on the server
[ { "change_type": "RENAME", "old_path": "model-server/src/test/kotlin/JsonAPITest.kt", "new_path": "model-server/src/test/kotlin/org/modelix/model/server/JsonAPITest.kt", "diff": "* limitations under the License.\n*/\n+package org.modelix.model.server\n+\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.http.*\nimport io.ktor.server.testing.*\n-import org.json.JSONArray\nimport org.json.JSONObject\nimport org.modelix.authorization.installAuthentication\nimport org.modelix.model.api.ITree\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model-server/src/test/kotlin/org/modelix/model/server/ModelClient_Test.kt", "diff": "+/*\n+ * Copyright (c) 2022.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied. See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+package org.modelix.model.server\n+\n+import org.junit.After\n+import org.junit.Assert\n+import org.junit.Before\n+import org.junit.Test\n+import org.modelix.model.client.RestWebModelClient\n+import java.util.*\n+import kotlin.test.fail\n+\n+class ModelClient_Test {\n+\n+ private var modelServer = ModelServerManager()\n+\n+ @Before\n+ fun prepare() {\n+ if (modelServer.isUp()) {\n+ throw IllegalStateException(\"The model-server is already up\")\n+ }\n+ modelServer.startServerInMemory(emptyMap())\n+ modelServer.waitItIsUp()\n+\n+ Runtime.getRuntime()\n+ .addShutdownHook(\n+ Thread(\n+ Runnable {\n+ try {\n+ modelServer.kill()\n+ } catch (ex: Exception) {\n+ System.err.println(\"Exception: \" + ex.message)\n+ ex.printStackTrace()\n+ }\n+ }\n+ )\n+ )\n+ }\n+\n+ @After\n+ fun cleaning() {\n+ modelServer.kill()\n+ }\n+\n+ // This test requires a running model server\n+ // It should be marked as a slow test and run separately from unit tests\n+ @Test\n+ fun test_t1() {\n+ val numClients = 3 * Runtime.getRuntime().availableProcessors() // tests were failing on the CI server, but not locally\n+ val numListenersPerClient = 3\n+ val numKeys = numListenersPerClient * 2\n+\n+ val rand = Random(67845)\n+ val url = \"http://localhost:28101/\"\n+ val clients = (0 until numClients).map { RestWebModelClient(url) }\n+ val listeners: MutableList<Listener> = ArrayList()\n+ val expected: MutableMap<String, String> = HashMap()\n+ for (client in clients.withIndex()) {\n+ for (i in 0 until numListenersPerClient) {\n+ println(\"Phase A: client $client i=$i of ${clients.size}\")\n+// Thread.sleep(50)\n+ val key = \"test_$i\"\n+ val l = Listener(key, client.value, client.index, i)\n+ client.value.listen(key, l)\n+ listeners.add(l)\n+ }\n+ }\n+ Thread.sleep(2000)\n+ for (i in (1..2).flatMap { 0 until numKeys }) {\n+ println(\"Phase B: i=$i of $numKeys\")\n+ if (!modelServer.isUp()) {\n+ throw IllegalStateException(\"The model-server is not up\")\n+ }\n+ val key = \"test_$i\"\n+ val value = rand.nextLong().toString()\n+ expected[key] = value\n+ println(\" put $key = $value\")\n+ val writingClientIndex = rand.nextInt(clients.size)\n+ println(\" client is $writingClientIndex\")\n+ try {\n+ clients[writingClientIndex].put(key, value)\n+ } catch (e: Exception) {\n+ System.err.println(e.message)\n+ e.printStackTrace(System.err)\n+ throw e\n+ }\n+ println(\" put to client $writingClientIndex\")\n+ for (client in clients) {\n+ Assert.assertEquals(expected[key], client.get(key))\n+ }\n+ println(\" verified\")\n+ for (timeout in 0..3000) {\n+ if (listeners.all { expected[it.key] == it.lastValue }) {\n+ println(\"All changes received after $timeout ms\")\n+ break\n+ }\n+ Thread.sleep(1)\n+ }\n+ val unsuccessfulListeners = listeners.filter { expected[it.key] != it.lastValue }\n+ if (unsuccessfulListeners.isNotEmpty()) {\n+ fail(\"change not received by listeners: $unsuccessfulListeners\")\n+ }\n+ println(\" verified also on listeners\")\n+ }\n+ for (client in clients) {\n+ client.dispose()\n+ }\n+ }\n+\n+ inner class Listener(var key: String, private val client: RestWebModelClient, val clientIndex: Int, val listenerIndex: Int) : IKeyListener {\n+ var lastValue: String? = null\n+ override fun changed(key: String, value: String?) {\n+ lastValue = value\n+ println(\"+change \" + this + \" / \" + this.key + \" / \" + key + \" = \" + value)\n+ }\n+ override fun toString() = \"$clientIndex.$listenerIndex:$key\"\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model-server/src/test/kotlin/org/modelix/model/server/ModelServerManager.kt", "diff": "+package org.modelix.model.server\n+\n+import com.google.common.base.Charsets\n+import java.io.BufferedReader\n+import java.io.File\n+import java.io.IOException\n+import java.io.InputStreamReader\n+import java.net.ConnectException\n+import java.net.URI\n+import java.net.http.HttpClient\n+import java.net.http.HttpRequest\n+import java.net.http.HttpResponse\n+import java.util.stream.Collectors\n+\n+class ModelServerManager {\n+ private val VERBOSE_SERVER = true\n+ private val VERBOSE_CONNECTION = false\n+ private var p: Process? = null\n+ fun kill() {\n+ if (p != null) {\n+ p!!.destroy()\n+ p = null\n+ try {\n+ Thread.sleep(1000)\n+ } catch (e: InterruptedException) {\n+ }\n+ }\n+ }\n+\n+ fun isUp(): Boolean {\n+ return try {\n+ httpRequest(\"GET\", \"/\")\n+ true\n+ } catch (e: ConnectException) {\n+ false\n+ }\n+ }\n+\n+ fun waitItIsUp() {\n+ httpRequest(\"GET\", \"/\")\n+ }\n+\n+ private fun httpRequest(method: String, path: String, nRetries: Int = 10) {\n+ try {\n+ val client = HttpClient.newHttpClient()\n+ val request = HttpRequest.newBuilder(URI.create(\"http://localhost:28101$path\"))\n+ .method(method, HttpRequest.BodyPublishers.noBody())\n+ .header(\"accept\", \"application/json\")\n+ .build()\n+ client.send(request, HttpResponse.BodyHandlers.ofString(Charsets.UTF_8))\n+ } catch (e: ConnectException) {\n+ if (nRetries > 0) {\n+ if (VERBOSE_CONNECTION) {\n+ println(\n+ \" (connection failed, retrying in a bit. nRetries=$nRetries)\"\n+ )\n+ }\n+ try {\n+ Thread.sleep(1000)\n+ } catch (e2: InterruptedException) {\n+ }\n+ httpRequest(method, path, nRetries - 1)\n+ } else {\n+ throw e\n+ }\n+ } catch (e: IOException) {\n+ e.printStackTrace()\n+ } catch (e: InterruptedException) {\n+ e.printStackTrace()\n+ }\n+ }\n+\n+ fun startServerInMemory(presetValues: Map<String, String>) {\n+ try {\n+ val argsToSetValues = presetValues.entries.stream()\n+ .map { e: Map.Entry<String, String> -> \" -set \" + e.key + \" \" + e.value }\n+ .collect(Collectors.joining())\n+ val modelServerJar = File(\"../model-server/build/libs/model-server-latest-fatJar.jar\")\n+ if (!modelServerJar.exists()) {\n+ throw RuntimeException(\"Cannot start Model Server as the JAR was not found at ${modelServerJar.absolutePath}\")\n+ }\n+ val commandLine = (\n+ \"${System.getProperty(\"java.home\")}/bin/java -jar ${modelServerJar.path} -inmemory\" +\n+ argsToSetValues\n+ )\n+ println(\"commandLine: $commandLine\")\n+ p = Runtime.getRuntime().exec(commandLine)\n+ val stdInput = BufferedReader(InputStreamReader(p!!.inputStream))\n+ val stdError = BufferedReader(InputStreamReader(p!!.errorStream))\n+ Thread {\n+ try {\n+ var s: String?\n+ while (stdInput.readLine().also { s = it } != null) {\n+ if (VERBOSE_SERVER) {\n+ println(\"SERVER OUT $s\")\n+ }\n+ }\n+ while (stdError.readLine().also { s = it } != null) {\n+ if (VERBOSE_SERVER) {\n+ println(\"SERVER ERR $s\")\n+ }\n+ }\n+ } catch (e: IOException) {\n+ // this may happen when closing\n+ }\n+ }\n+ .start()\n+ try {\n+ Thread.sleep(1000)\n+ } catch (e: InterruptedException) {\n+ }\n+ } catch (e: IOException) {\n+ throw RuntimeException(e)\n+ }\n+ }\n+}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Moved some tests from model-client model-server They need the model server and after the repository split the client cannot have a dependency on the server
426,496
07.09.2022 12:06:52
-7,200
47c9f663251108b4e0d783edaa82d46183463582
Fixed the model client test It uses ktor to run the server/client test in the same process instead of starting the server in a new process.
[ { "change_type": "MODIFY", "old_path": "gradle.properties", "new_path": "gradle.properties", "diff": "@@ -2,8 +2,9 @@ systemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000\nkotlin.daemon.jvmargs=-Xmx2G\n-ktorVersion=2.0.2\n-kotlinCoroutinesVersion=1.6.0\n-kotlinVersion=1.6.21\n+kotlinVersion=1.7.10\n+kotlinCoroutinesVersion=1.6.3\n+ktorVersion=2.0.3\n+kotlinLoggingVersion=2.1.21\nlogbackVersion=1.2.1\n-modelixCoreVersion=1.1.0-extract.core.3\n+modelixCoreVersion=1.1.0-extract.core.4\n" }, { "change_type": "MODIFY", "old_path": "model-server/src/test/kotlin/org/modelix/model/server/ModelClient_Test.kt", "new_path": "model-server/src/test/kotlin/org/modelix/model/server/ModelClient_Test.kt", "diff": "package org.modelix.model.server\n-import org.junit.After\n+import io.ktor.server.testing.*\n+import kotlinx.coroutines.delay\n+import kotlinx.coroutines.withTimeout\nimport org.junit.Assert\n-import org.junit.Before\nimport org.junit.Test\n+import org.modelix.authorization.installAuthentication\n+import org.modelix.model.IKeyListener\nimport org.modelix.model.client.RestWebModelClient\nimport java.util.*\nimport kotlin.test.fail\n+import kotlin.time.Duration.Companion.seconds\nclass ModelClient_Test {\n- private var modelServer = ModelServerManager()\n-\n- @Before\n- fun prepare() {\n- if (modelServer.isUp()) {\n- throw IllegalStateException(\"The model-server is already up\")\n- }\n- modelServer.startServerInMemory(emptyMap())\n- modelServer.waitItIsUp()\n-\n- Runtime.getRuntime()\n- .addShutdownHook(\n- Thread(\n- Runnable {\n- try {\n- modelServer.kill()\n- } catch (ex: Exception) {\n- System.err.println(\"Exception: \" + ex.message)\n- ex.printStackTrace()\n- }\n+ private fun runTest(block: suspend ApplicationTestBuilder.() -> Unit) = testApplication {\n+ application {\n+ installAuthentication(unitTestMode = true)\n+ KtorModelServer(InMemoryStoreClient()).init(this)\n}\n- )\n- )\n+ block()\n}\n- @After\n- fun cleaning() {\n- modelServer.kill()\n- }\n-\n- // This test requires a running model server\n- // It should be marked as a slow test and run separately from unit tests\n@Test\n- fun test_t1() {\n- val numClients = 3 * Runtime.getRuntime().availableProcessors() // tests were failing on the CI server, but not locally\n+ fun test_t1() = runTest {\n+ val numClients = 3\nval numListenersPerClient = 3\nval numKeys = numListenersPerClient * 2\nval rand = Random(67845)\n- val url = \"http://localhost:28101/\"\n- val clients = (0 until numClients).map { RestWebModelClient(url) }\n+ val url = \"http://localhost/\"\n+ val clients = (0 until numClients).map { RestWebModelClient(baseUrl = url, providedClient = client) }\nval listeners: MutableList<Listener> = ArrayList()\nval expected: MutableMap<String, String> = HashMap()\nfor (client in clients.withIndex()) {\nfor (i in 0 until numListenersPerClient) {\nprintln(\"Phase A: client $client i=$i of ${clients.size}\")\n-// Thread.sleep(50)\n+// delay(50)\nval key = \"test_$i\"\nval l = Listener(key, client.value, client.index, i)\nclient.value.listen(key, l)\nlisteners.add(l)\n}\n}\n- Thread.sleep(2000)\n+ delay(3.seconds)\nfor (i in (1..2).flatMap { 0 until numKeys }) {\nprintln(\"Phase B: i=$i of $numKeys\")\n- if (!modelServer.isUp()) {\n- throw IllegalStateException(\"The model-server is not up\")\n- }\nval key = \"test_$i\"\nval value = rand.nextLong().toString()\nexpected[key] = value\n@@ -107,7 +84,7 @@ class ModelClient_Test {\nval writingClientIndex = rand.nextInt(clients.size)\nprintln(\" client is $writingClientIndex\")\ntry {\n- clients[writingClientIndex].put(key, value)\n+ clients[writingClientIndex].putA(key, value)\n} catch (e: Exception) {\nSystem.err.println(e.message)\ne.printStackTrace(System.err)\n@@ -115,15 +92,17 @@ class ModelClient_Test {\n}\nprintln(\" put to client $writingClientIndex\")\nfor (client in clients) {\n- Assert.assertEquals(expected[key], client.get(key))\n+ withTimeout(1.seconds) {\n+ Assert.assertEquals(expected[key], client.getA(key))\n+ }\n}\nprintln(\" verified\")\n- for (timeout in 0..3000) {\n+ for (timeout in 0..30) {\nif (listeners.all { expected[it.key] == it.lastValue }) {\n- println(\"All changes received after $timeout ms\")\n+ println(\"All changes received after ${timeout * 100} ms\")\nbreak\n}\n- Thread.sleep(1)\n+ delay(100)\n}\nval unsuccessfulListeners = listeners.filter { expected[it.key] != it.lastValue }\nif (unsuccessfulListeners.isNotEmpty()) {\n" }, { "change_type": "DELETE", "old_path": "model-server/src/test/kotlin/org/modelix/model/server/ModelServerManager.kt", "new_path": null, "diff": "-package org.modelix.model.server\n-\n-import com.google.common.base.Charsets\n-import java.io.BufferedReader\n-import java.io.File\n-import java.io.IOException\n-import java.io.InputStreamReader\n-import java.net.ConnectException\n-import java.net.URI\n-import java.net.http.HttpClient\n-import java.net.http.HttpRequest\n-import java.net.http.HttpResponse\n-import java.util.stream.Collectors\n-\n-class ModelServerManager {\n- private val VERBOSE_SERVER = true\n- private val VERBOSE_CONNECTION = false\n- private var p: Process? = null\n- fun kill() {\n- if (p != null) {\n- p!!.destroy()\n- p = null\n- try {\n- Thread.sleep(1000)\n- } catch (e: InterruptedException) {\n- }\n- }\n- }\n-\n- fun isUp(): Boolean {\n- return try {\n- httpRequest(\"GET\", \"/\")\n- true\n- } catch (e: ConnectException) {\n- false\n- }\n- }\n-\n- fun waitItIsUp() {\n- httpRequest(\"GET\", \"/\")\n- }\n-\n- private fun httpRequest(method: String, path: String, nRetries: Int = 10) {\n- try {\n- val client = HttpClient.newHttpClient()\n- val request = HttpRequest.newBuilder(URI.create(\"http://localhost:28101$path\"))\n- .method(method, HttpRequest.BodyPublishers.noBody())\n- .header(\"accept\", \"application/json\")\n- .build()\n- client.send(request, HttpResponse.BodyHandlers.ofString(Charsets.UTF_8))\n- } catch (e: ConnectException) {\n- if (nRetries > 0) {\n- if (VERBOSE_CONNECTION) {\n- println(\n- \" (connection failed, retrying in a bit. nRetries=$nRetries)\"\n- )\n- }\n- try {\n- Thread.sleep(1000)\n- } catch (e2: InterruptedException) {\n- }\n- httpRequest(method, path, nRetries - 1)\n- } else {\n- throw e\n- }\n- } catch (e: IOException) {\n- e.printStackTrace()\n- } catch (e: InterruptedException) {\n- e.printStackTrace()\n- }\n- }\n-\n- fun startServerInMemory(presetValues: Map<String, String>) {\n- try {\n- val argsToSetValues = presetValues.entries.stream()\n- .map { e: Map.Entry<String, String> -> \" -set \" + e.key + \" \" + e.value }\n- .collect(Collectors.joining())\n- val modelServerJar = File(\"../model-server/build/libs/model-server-latest-fatJar.jar\")\n- if (!modelServerJar.exists()) {\n- throw RuntimeException(\"Cannot start Model Server as the JAR was not found at ${modelServerJar.absolutePath}\")\n- }\n- val commandLine = (\n- \"${System.getProperty(\"java.home\")}/bin/java -jar ${modelServerJar.path} -inmemory\" +\n- argsToSetValues\n- )\n- println(\"commandLine: $commandLine\")\n- p = Runtime.getRuntime().exec(commandLine)\n- val stdInput = BufferedReader(InputStreamReader(p!!.inputStream))\n- val stdError = BufferedReader(InputStreamReader(p!!.errorStream))\n- Thread {\n- try {\n- var s: String?\n- while (stdInput.readLine().also { s = it } != null) {\n- if (VERBOSE_SERVER) {\n- println(\"SERVER OUT $s\")\n- }\n- }\n- while (stdError.readLine().also { s = it } != null) {\n- if (VERBOSE_SERVER) {\n- println(\"SERVER ERR $s\")\n- }\n- }\n- } catch (e: IOException) {\n- // this may happen when closing\n- }\n- }\n- .start()\n- try {\n- Thread.sleep(1000)\n- } catch (e: InterruptedException) {\n- }\n- } catch (e: IOException) {\n- throw RuntimeException(e)\n- }\n- }\n-}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Fixed the model client test It uses ktor to run the server/client test in the same process instead of starting the server in a new process.
426,496
07.09.2022 12:55:58
-7,200
cbfd6c8ec34e25d5101bd68aefda2038e1489ba0
added missing dependency to graphql-server
[ { "change_type": "MODIFY", "old_path": "graphql-server/build.gradle.kts", "new_path": "graphql-server/build.gradle.kts", "diff": "@@ -21,6 +21,7 @@ dependencies {\nimplementation(\"com.expediagroup\", \"graphql-kotlin-server\", graphqlKotlinVersion)\nimplementation(\"io.ktor\", \"ktor-server-core\", ktorVersion)\nimplementation(\"io.ktor\", \"ktor-server-netty\", ktorVersion)\n+ implementation(\"io.ktor:ktor-client-cio:$ktorVersion\")\nimplementation(\"io.ktor:ktor-server-cors:$ktorVersion\")\nimplementation(\"ch.qos.logback\", \"logback-classic\", logbackVersion)\nimplementation(\"org.jetbrains.kotlinx\", \"kotlinx-coroutines-jdk8\", kotlinCoroutinesVersion)\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
added missing dependency to graphql-server
426,496
04.10.2022 11:34:53
-7,200
89041a5188a6e989f3fd5d59445bf273bbb2ae65
helm/update-versions.sh failed on github actions
[ { "change_type": "MODIFY", "old_path": "helm/update-versions.sh", "new_path": "helm/update-versions.sh", "diff": "@@ -6,7 +6,7 @@ cd \"$(dirname \"$0\")\"\nwhile IFS='=' read -r key value\ndo\n- if [ \"modelixCoreVersion\" == \"${key}\" ]; then\n+ if [[ \"modelixCoreVersion\" == \"${key}\" ]]; then\neval \"${key}\"=\\${value}\nfi\ndone < \"../gradle.properties\"\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
helm/update-versions.sh failed on github actions
426,496
05.10.2022 16:37:44
-7,200
fe9651a9b222813b6054a50f11ad74b1d181ccfb
replaced log4j in instances-manager
[ { "change_type": "MODIFY", "old_path": "instances-manager/build.gradle", "new_path": "instances-manager/build.gradle", "diff": "@@ -27,14 +27,13 @@ shadowJar {\ndef ktorVersion = rootProject.ktorVersion\ndef kotlinCoroutinesVersion = rootProject.kotlinCoroutinesVersion\ndef kotlinVersion = rootProject.kotlinVersion\n+def kotlinLoggingVersion = rootProject.kotlinLoggingVersion\ndef logbackVersion = rootProject.logbackVersion\ndef modelixCoreVersion = rootProject.modelixCoreVersion\ndependencies {\ntestCompile group: 'junit', name: 'junit', version: '4.12'\ncompile 'io.kubernetes:client-java:8.0.2'\n- compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.30'\n- compile group: 'log4j', name: 'log4j', version: '1.2.17'\ncompile group: 'commons-codec', name: 'commons-codec', version: '1.14'\ncompile group: 'commons-io', name: 'commons-io', version: '2.6'\ncompile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'\n@@ -61,6 +60,7 @@ dependencies {\nimplementation(group: \"org.jetbrains.kotlinx\", name: \"kotlinx-coroutines-jdk8\", version: kotlinCoroutinesVersion)\nimplementation(\"io.ktor:ktor-server-cors:$ktorVersion\")\nimplementation(\"io.ktor:ktor-server-html-builder:$ktorVersion\")\n+ implementation(\"io.github.microutils:kotlin-logging:$kotlinLoggingVersion\")\n}\nassemble.dependsOn shadowJar\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/DeploymentManager.kt", "new_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/DeploymentManager.kt", "diff": "@@ -22,7 +22,6 @@ import io.kubernetes.client.openapi.models.*\nimport io.kubernetes.client.util.ClientBuilder\nimport io.kubernetes.client.util.Yaml\nimport org.apache.commons.collections4.map.LRUMap\n-import org.apache.log4j.Logger\nimport org.eclipse.jetty.server.Request\nimport org.modelix.authorization.AccessTokenPrincipal\nimport org.modelix.workspaces.Workspace\n@@ -484,7 +483,7 @@ class DeploymentManager {\n}\ncompanion object {\n- private val LOG = Logger.getLogger(DeploymentManager::class.java)\n+ private val LOG = mu.KotlinLogging.logger {}\nval KUBERNETES_NAMESPACE = System.getenv(\"WORKSPACE_CLIENT_NAMESPACE\") ?: \"default\"\nval PERSONAL_DEPLOYMENT_PREFIX = System.getenv(\"WORKSPACE_CLIENT_PREFIX\") ?: \"wsclt-\"\nval WORKSPACE_CLIENT_DEPLOYMENT_NAME = System.getenv(\"WORKSPACE_CLIENT_DEPLOYMENT_NAME\") ?: \"workspace-client\"\n" }, { "change_type": "MODIFY", "old_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/DeploymentManagingHandler.kt", "new_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/DeploymentManagingHandler.kt", "diff": "*/\npackage org.modelix.instancesmanager\n-import org.apache.log4j.Logger\nimport org.eclipse.jetty.server.Request\nimport org.eclipse.jetty.server.handler.AbstractHandler\nimport javax.servlet.http.HttpServletRequest\n@@ -79,6 +78,6 @@ class DeploymentManagingHandler : AbstractHandler() {\n}\ncompanion object {\n- private val LOG = Logger.getLogger(DeploymentManagingHandler::class.java)\n+ private val LOG = mu.KotlinLogging.logger {}\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/Main.kt", "new_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/Main.kt", "diff": "package org.modelix.instancesmanager\nimport io.kubernetes.client.openapi.ApiException\n-import org.apache.log4j.Logger\nimport org.eclipse.jetty.server.Request\nimport org.eclipse.jetty.server.Server\nimport org.eclipse.jetty.server.handler.DefaultHandler\n@@ -32,7 +31,7 @@ import javax.servlet.http.HttpServletRequest\nimport javax.servlet.http.HttpServletResponse\nobject Main {\n- private val LOG = Logger.getLogger(Main::class.java)\n+ private val LOG = mu.KotlinLogging.logger {}\n@JvmStatic\nfun main(args: Array<String>) {\ntry {\n" }, { "change_type": "MODIFY", "old_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/ProxyServletWithWebsocketSupport.kt", "new_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/ProxyServletWithWebsocketSupport.kt", "diff": "*/\npackage org.modelix.instancesmanager\n-import org.apache.log4j.Logger\nimport org.eclipse.jetty.client.HttpClient\nimport org.eclipse.jetty.proxy.ProxyServlet\nimport org.eclipse.jetty.websocket.api.Session\n@@ -197,7 +196,6 @@ abstract class ProxyServletWithWebsocketSupport : ProxyServlet() {\n}\ncompanion object {\n- // --------------------------- copied from org.modelix.instancesmanager.WebSocketProxyServlet ----------------------\n- private val LOG = Logger.getLogger(WebSocketProxyServlet::class.java)\n+ private val LOG = mu.KotlinLogging.logger {}\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/WebSocketProxyServlet.kt", "new_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/WebSocketProxyServlet.kt", "diff": "*/\npackage org.modelix.instancesmanager\n-import org.apache.log4j.Logger\nimport org.eclipse.jetty.websocket.api.Session\nimport org.eclipse.jetty.websocket.api.WebSocketListener\nimport org.eclipse.jetty.websocket.client.ClientUpgradeRequest\n@@ -102,6 +101,6 @@ abstract class WebSocketProxyServlet : WebSocketServlet() {\n}\ncompanion object {\n- private val LOG = Logger.getLogger(WebSocketProxyServlet::class.java)\n+ private val LOG = mu.KotlinLogging.logger {}\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "instances-manager/src/main/resources/log4j.xml", "new_path": null, "diff": "-<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n-<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">\n-<log4j:configuration debug=\"true\"\n- xmlns:log4j='http://jakarta.apache.org/log4j/'>\n-\n- <appender name=\"console\" class=\"org.apache.log4j.ConsoleAppender\">\n- <param name=\"follow\" value=\"true\"/>\n- <layout class=\"org.apache.log4j.PatternLayout\">\n- <param name=\"ConversionPattern\" value=\"[%7r] %6p - %30.30c - %m \\n\" />\n- </layout>\n- </appender>\n-\n- <category name=\"org.modelix\" additivity=\"true\">\n- <priority value=\"DEBUG\"/>\n- <appender-ref ref=\"console\"/>\n- </category>\n-\n- <root>\n- <level value=\"INFO\" />\n- <appender-ref ref=\"console\" />\n- </root>\n-\n-</log4j:configuration>\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
replaced log4j in instances-manager https://github.com/modelix/modelix/issues/178
426,496
11.10.2022 09:03:40
-7,200
5fba305e191e797a0e4d84c607404cde4d932861
added resource requests/limits to all deployments Deploying to rancher failed because this was missing on some deployments.
[ { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/keycloak-deployment.yaml", "new_path": "helm/modelix/templates/common/keycloak-deployment.yaml", "diff": "@@ -82,6 +82,13 @@ spec:\nhttpGet:\npath: /realms/master\nport: 8080\n+ resources:\n+ requests:\n+ memory: \"500Mi\"\n+ cpu: \"0.1\"\n+ limits:\n+ memory: \"500Mi\"\n+ cpu: \"1.0\"\nvolumeMounts:\n- name: keycloak-volume\nmountPath: /opt/keycloak/data/import\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/oauth-deployment.yaml", "new_path": "helm/modelix/templates/common/oauth-deployment.yaml", "diff": "@@ -29,9 +29,10 @@ spec:\nresources:\nrequests:\nmemory: \"100Mi\"\n- cpu: 100m\n+ cpu: \"0.1\"\nlimits:\nmemory: \"200Mi\"\n+ cpu: \"1.0\"\nreadinessProbe:\ntcpSocket:\nport: 6379\n@@ -106,7 +107,8 @@ spec:\nresources:\nrequests:\nmemory: \"100Mi\"\n- cpu: 100m\n+ cpu: \"0.1\"\nlimits:\nmemory: \"200Mi\"\n+ cpu: \"1.0\"\n{{- include \"modelix.pullSecret\" . | nindent 6 }}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/templates/gcloud/db-deployment.yaml", "new_path": "helm/modelix/templates/gcloud/db-deployment.yaml", "diff": "@@ -36,6 +36,9 @@ spec:\nrequests:\nmemory: \"50Mi\"\ncpu: \"0.01\"\n+ limits:\n+ memory: \"100Mi\"\n+ cpu: \"1.0\"\nreadinessProbe:\ntcpSocket:\nport: 5432\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/templates/local/db-deployment.yaml", "new_path": "helm/modelix/templates/local/db-deployment.yaml", "diff": "@@ -36,6 +36,13 @@ spec:\nvolumeMounts:\n- mountPath: /var/lib/postgresql/data\nname: db-data\n+ resources:\n+ requests:\n+ memory: \"500Mi\"\n+ cpu: \"0.1\"\n+ limits:\n+ memory: \"500Mi\"\n+ cpu: \"1.0\"\nreadinessProbe:\ntcpSocket:\nport: 5432\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
added resource requests/limits to all deployments Deploying to rancher failed because this was missing on some deployments.
426,496
11.10.2022 09:59:44
-7,200
b73b83d5ccb408bd8405e0e2ba83a49e567808e8
helm/update-versions.sh didn't work on github actions
[ { "change_type": "MODIFY", "old_path": "helm/update-versions.sh", "new_path": "helm/update-versions.sh", "diff": "@@ -6,7 +6,7 @@ cd \"$(dirname \"$0\")\"\nwhile IFS='=' read -r key value\ndo\n- if [[ \"modelixCoreVersion\" == \"${key}\" ]]; then\n+ if [ \"modelixCoreVersion\" = \"${key}\" ]; then\neval \"${key}\"=\\${value}\nfi\ndone < \"../gradle.properties\"\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
helm/update-versions.sh didn't work on github actions
426,496
26.10.2022 10:36:59
-7,200
80e6bea1692eace62f2dbb1bc1ea500f079cf4b2
wrong model server version was used when running helm/install.sh
[ { "change_type": "MODIFY", "old_path": "helm/dev.yaml", "new_path": "helm/dev.yaml", "diff": "imageTags:\ndb: \"\"\ninstancesManager: \"\"\n- model: \"\"\n- oauth: \"\"\nproxy: \"\"\nwsClient: \"\"\nwsManager: \"\"\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/values.yaml", "new_path": "helm/modelix/values.yaml", "diff": "@@ -5,7 +5,7 @@ fullnameOverride: \"\"\nimageTags:\ndb: \"\"\ninstancesManager: \"\"\n- model: \"1.3.1-model.server.3\"\n+ model: \"1.3.2\"\noauth: \"\"\nproxy: \"\"\nwsClient: \"\"\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
wrong model server version was used when running helm/install.sh
426,496
26.10.2022 10:38:36
-7,200
ce237960ae49af7897df0ade0862976ec5b6655b
used fixed version of oauth-proxy
[ { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/oauth-deployment.yaml", "new_path": "helm/modelix/templates/common/oauth-deployment.yaml", "diff": "@@ -45,7 +45,7 @@ spec:\ninitialDelaySeconds: 3\nperiodSeconds: 10\ntimeoutSeconds: 5\n- - image: \"{{ default .Values.dockerProxy.prefix \"quay.io/\" }}oauth2-proxy/oauth2-proxy\"\n+ - image: \"{{ default .Values.dockerProxy.prefix \"quay.io/\" }}oauth2-proxy/oauth2-proxy:{{ .Values.imageTags.oauth | default \"v7.3.0\" }}\"\nname: oauth2-proxy\nenv:\n- name: OAUTH2_PROXY_CLIENT_SECRET\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
used fixed version of oauth-proxy
426,496
02.12.2022 14:49:09
-3,600
47d49da5971e47f81215244e6983b073005098ba
The headless-mps subproject was using an old version of kotlinx-serialization It's now using the same as in modelix.core.
[ { "change_type": "MODIFY", "old_path": "gradle.properties", "new_path": "gradle.properties", "diff": "@@ -4,6 +4,7 @@ kotlin.daemon.jvmargs=-Xmx2G\nkotlinVersion=1.7.10\nkotlinCoroutinesVersion=1.6.3\n+kotlinxSerializationVersion=1.4.1\nktorVersion=2.0.3\nkotlinLoggingVersion=2.1.21\nlogbackVersion=1.2.1\n" }, { "change_type": "MODIFY", "old_path": "headless-mps/build.gradle.kts", "new_path": "headless-mps/build.gradle.kts", "diff": "@@ -13,11 +13,12 @@ application {\nmainClassName = \"org.modelix.headlessmps.ModelImportMain\"\n}\n+val kotlinxSerializationVersion: String by rootProject\ndependencies {\ncompileOnly(fileTree(\"../artifacts/mps/lib\") {\ninclude(\"*.jar\")\n})\n- implementation(\"org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2\")\n+ implementation(\"org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion\")\ntestImplementation(\"org.junit.jupiter:junit-jupiter-api:5.6.0\")\ntestRuntimeOnly(\"org.junit.jupiter:junit-jupiter-engine\")\n}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
The headless-mps subproject was using an old version of kotlinx-serialization It's now using the same as in modelix.core.
426,496
02.12.2022 14:49:54
-3,600
a6a37791b7f70560b3f854f1ab0941966f0159e2
Migrated VirtualRepository (org.modelix.ui.common) to modelix.core 1.4.1
[ { "change_type": "MODIFY", "old_path": "mps/org.modelix.ui.common/models/org.modelix.ui.common.mps", "new_path": "mps/org.modelix.ui.common/models/org.modelix.ui.common.mps", "diff": "</node>\n</node>\n</node>\n+ <node concept=\"2tJIrI\" id=\"1oe$moqhu4v\" role=\"jymVt\" />\n+ <node concept=\"3clFb_\" id=\"1oe$moqhebB\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"wrapNode\" />\n+ <node concept=\"37vLTG\" id=\"1oe$moqhebC\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"node\" />\n+ <node concept=\"3uibUv\" id=\"1oe$moqhebD\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"jks5:~INodeReference\" resolve=\"INodeReference\" />\n+ </node>\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqhebE\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~Nullable\" resolve=\"Nullable\" />\n+ </node>\n+ </node>\n+ <node concept=\"3uibUv\" id=\"1oe$moqhebF\" role=\"3clF45\">\n+ <ref role=\"3uigEE\" node=\"mtS_g4raHN\" resolve=\"VirtualRepositoryArea.NodeWrapperReference\" />\n+ </node>\n+ <node concept=\"3Tm1VV\" id=\"1oe$moqhebG\" role=\"1B3o_S\" />\n+ <node concept=\"3clFbS\" id=\"1oe$moqhebH\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"1oe$moqhebI\" role=\"3cqZAp\">\n+ <node concept=\"3K4zz7\" id=\"1oe$moqhebJ\" role=\"3clFbG\">\n+ <node concept=\"3clFbC\" id=\"1oe$moqhebK\" role=\"3K4Cdx\">\n+ <node concept=\"10Nm6u\" id=\"1oe$moqhebL\" role=\"3uHU7w\" />\n+ <node concept=\"37vLTw\" id=\"1oe$moqhebM\" role=\"3uHU7B\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqhebC\" resolve=\"node\" />\n+ </node>\n+ </node>\n+ <node concept=\"10Nm6u\" id=\"1oe$moqhebN\" role=\"3K4E3e\" />\n+ <node concept=\"2ShNRf\" id=\"1oe$moqhebO\" role=\"3K4GZi\">\n+ <node concept=\"1pGfFk\" id=\"1oe$moqhebP\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" node=\"mtS_g4rt4q\" resolve=\"VirtualRepositoryArea.NodeWrapperReference\" />\n+ <node concept=\"37vLTw\" id=\"1oe$moqhebQ\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqhebC\" resolve=\"node\" />\n+ </node>\n+ <node concept=\"1rXfSq\" id=\"1oe$moqhVZo\" role=\"37wK5m\">\n+ <ref role=\"37wK5l\" node=\"7$7_4Ziiz7V\" resolve=\"getReference\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"2tJIrI\" id=\"4z6TrYVZLvh\" role=\"jymVt\" />\n<node concept=\"3clFb_\" id=\"4z6TrYVZNRA\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"unwrap\" />\n</node>\n</node>\n</node>\n+ <node concept=\"2tJIrI\" id=\"1oe$moqi$bi\" role=\"jymVt\" />\n+ <node concept=\"3clFb_\" id=\"1oe$moqhW$v\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"unwrap\" />\n+ <node concept=\"37vLTG\" id=\"1oe$moqhW$w\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"node\" />\n+ <node concept=\"3uibUv\" id=\"1oe$moqhW$x\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"jks5:~INodeReference\" resolve=\"INodeReference\" />\n+ </node>\n+ </node>\n+ <node concept=\"3uibUv\" id=\"1oe$moqhW$y\" role=\"3clF45\">\n+ <ref role=\"3uigEE\" to=\"jks5:~INodeReference\" resolve=\"INodeReference\" />\n+ </node>\n+ <node concept=\"3Tm1VV\" id=\"1oe$moqhW$z\" role=\"1B3o_S\" />\n+ <node concept=\"3clFbS\" id=\"1oe$moqhW$$\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"1oe$moqhW$_\" role=\"3cqZAp\">\n+ <node concept=\"3K4zz7\" id=\"1oe$moqhW$A\" role=\"3clFbG\">\n+ <node concept=\"2OqwBi\" id=\"1oe$moqhW$B\" role=\"3K4E3e\">\n+ <node concept=\"1eOMI4\" id=\"1oe$moqhW$C\" role=\"2Oq$k0\">\n+ <node concept=\"10QFUN\" id=\"1oe$moqhW$D\" role=\"1eOMHV\">\n+ <node concept=\"3uibUv\" id=\"1oe$moqhW$E\" role=\"10QFUM\">\n+ <ref role=\"3uigEE\" node=\"mtS_g4raHN\" resolve=\"VirtualRepositoryArea.NodeWrapperReference\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"1oe$moqhW$F\" role=\"10QFUP\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqhW$w\" resolve=\"node\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2OwXpG\" id=\"1oe$moqhW$G\" role=\"2OqNvi\">\n+ <ref role=\"2Oxat5\" node=\"mtS_g4rqeZ\" resolve=\"nodeRef\" />\n+ </node>\n+ </node>\n+ <node concept=\"37vLTw\" id=\"1oe$moqhW$H\" role=\"3K4GZi\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqhW$w\" resolve=\"node\" />\n+ </node>\n+ <node concept=\"1Wc70l\" id=\"1oe$moqhW$I\" role=\"3K4Cdx\">\n+ <node concept=\"2ZW3vV\" id=\"1oe$moqhW$J\" role=\"3uHU7B\">\n+ <node concept=\"3uibUv\" id=\"1oe$moqhW$K\" role=\"2ZW6by\">\n+ <ref role=\"3uigEE\" node=\"mtS_g4raHN\" resolve=\"VirtualRepositoryArea.NodeWrapperReference\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"1oe$moqhW$L\" role=\"2ZW6bz\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqhW$w\" resolve=\"node\" />\n+ </node>\n+ </node>\n+ <node concept=\"17R0WA\" id=\"1oe$moqhW$M\" role=\"3uHU7w\">\n+ <node concept=\"2OqwBi\" id=\"1oe$moqihR6\" role=\"3uHU7w\">\n+ <node concept=\"Xjq3P\" id=\"1oe$moqhW$N\" role=\"2Oq$k0\" />\n+ <node concept=\"liA8E\" id=\"1oe$moqii4J\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" node=\"7$7_4Ziiz7V\" resolve=\"getReference\" />\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"1oe$moqhW$O\" role=\"3uHU7B\">\n+ <node concept=\"1eOMI4\" id=\"1oe$moqieBh\" role=\"2Oq$k0\">\n+ <node concept=\"10QFUN\" id=\"1oe$moqieBg\" role=\"1eOMHV\">\n+ <node concept=\"37vLTw\" id=\"1oe$moqieBf\" role=\"10QFUP\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqhW$w\" resolve=\"node\" />\n+ </node>\n+ <node concept=\"3uibUv\" id=\"1oe$moqif8L\" role=\"10QFUM\">\n+ <ref role=\"3uigEE\" node=\"mtS_g4raHN\" resolve=\"VirtualRepositoryArea.NodeWrapperReference\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2OwXpG\" id=\"1oe$moqig0K\" role=\"2OqNvi\">\n+ <ref role=\"2Oxat5\" node=\"mtS_g4rs8x\" resolve=\"areaRef\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"2tJIrI\" id=\"28I3pJBYjbC\" role=\"jymVt\" />\n<node concept=\"3clFb_\" id=\"28I3pJBXNZk\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"isTransparentParent\" />\n<ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n</node>\n</node>\n+ <node concept=\"3clFb_\" id=\"1oe$moqg8gk\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"addNewChild\" />\n+ <node concept=\"3Tm1VV\" id=\"1oe$moqg8gl\" role=\"1B3o_S\" />\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqg8gn\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~NotNull\" resolve=\"NotNull\" />\n+ </node>\n+ <node concept=\"3uibUv\" id=\"1oe$moqg8go\" role=\"3clF45\">\n+ <ref role=\"3uigEE\" to=\"jks5:~INode\" resolve=\"INode\" />\n+ </node>\n+ <node concept=\"37vLTG\" id=\"1oe$moqgfom\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"role\" />\n+ <node concept=\"17QB3L\" id=\"1oe$moqgfon\" role=\"1tU5fm\" />\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqgfoo\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~Nullable\" resolve=\"Nullable\" />\n+ </node>\n+ </node>\n+ <node concept=\"37vLTG\" id=\"1oe$moqgfop\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"index\" />\n+ <node concept=\"10Oyi0\" id=\"1oe$moqgfoq\" role=\"1tU5fm\" />\n+ </node>\n+ <node concept=\"37vLTG\" id=\"1oe$moqgfor\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"concept\" />\n+ <node concept=\"3uibUv\" id=\"1oe$moqgfos\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"jks5:~IConceptReference\" resolve=\"IConceptReference\" />\n+ </node>\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqgfot\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~Nullable\" resolve=\"Nullable\" />\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"1oe$moqg8gy\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"1oe$moqgdIr\" role=\"3cqZAp\">\n+ <node concept=\"1rXfSq\" id=\"1oe$moqgdIs\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" node=\"28I3pJBX2AN\" resolve=\"wrapNode\" />\n+ <node concept=\"2OqwBi\" id=\"1oe$moqgdIt\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"1oe$moqgdIu\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"28I3pJBWL4h\" resolve=\"node\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"1oe$moqgdIv\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"jks5:~INode.addNewChild(java.lang.String,int,org.modelix.model.api.IConceptReference)\" resolve=\"addNewChild\" />\n+ <node concept=\"37vLTw\" id=\"1oe$moqgdIw\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqgfom\" resolve=\"role\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"1oe$moqgdIx\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqgfop\" resolve=\"index\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"1oe$moqgdIy\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqgfor\" resolve=\"concept\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqg8gz\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n+ </node>\n+ </node>\n<node concept=\"3clFb_\" id=\"28I3pJBWIR4\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"removeChild\" />\n<node concept=\"3Tm1VV\" id=\"28I3pJBWIR5\" role=\"1B3o_S\" />\n<ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n</node>\n</node>\n+ <node concept=\"3clFb_\" id=\"1oe$moqgSaK\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"getReferenceTargetRef\" />\n+ <node concept=\"3Tm1VV\" id=\"1oe$moqgSaL\" role=\"1B3o_S\" />\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqgSaN\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~Nullable\" resolve=\"Nullable\" />\n+ </node>\n+ <node concept=\"3uibUv\" id=\"1oe$moqgSaO\" role=\"3clF45\">\n+ <ref role=\"3uigEE\" to=\"jks5:~INodeReference\" resolve=\"INodeReference\" />\n+ </node>\n+ <node concept=\"37vLTG\" id=\"1oe$moqgSaP\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"role\" />\n+ <node concept=\"17QB3L\" id=\"1oe$moqgYLY\" role=\"1tU5fm\" />\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqgSaR\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~NotNull\" resolve=\"NotNull\" />\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"1oe$moqgSaT\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"1oe$moqh0Mm\" role=\"3cqZAp\">\n+ <node concept=\"1rXfSq\" id=\"1oe$moqh0Mn\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" node=\"1oe$moqhebB\" resolve=\"wrapNode\" />\n+ <node concept=\"2OqwBi\" id=\"1oe$moqh0Mo\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"1oe$moqh0Mp\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"28I3pJBWL4h\" resolve=\"node\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"1oe$moqh0Mq\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"jks5:~INode.getReferenceTargetRef(java.lang.String)\" resolve=\"getReferenceTargetRef\" />\n+ <node concept=\"37vLTw\" id=\"1oe$moqh0Mr\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqgSaP\" resolve=\"role\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqgSaU\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n+ </node>\n+ </node>\n<node concept=\"3clFb_\" id=\"28I3pJBWIRr\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"setReferenceTarget\" />\n<node concept=\"3Tm1VV\" id=\"28I3pJBWIRs\" role=\"1B3o_S\" />\n<ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n</node>\n</node>\n+ <node concept=\"3clFb_\" id=\"1oe$moqgxv3\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"setReferenceTarget\" />\n+ <node concept=\"3Tm1VV\" id=\"1oe$moqgxv4\" role=\"1B3o_S\" />\n+ <node concept=\"3cqZAl\" id=\"1oe$moqgxv6\" role=\"3clF45\" />\n+ <node concept=\"37vLTG\" id=\"1oe$moqgxv7\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"role\" />\n+ <node concept=\"17QB3L\" id=\"1oe$moqgDet\" role=\"1tU5fm\" />\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqgxv9\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~NotNull\" resolve=\"NotNull\" />\n+ </node>\n+ </node>\n+ <node concept=\"37vLTG\" id=\"1oe$moqgxva\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"target\" />\n+ <node concept=\"3uibUv\" id=\"1oe$moqgxvb\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"jks5:~INodeReference\" resolve=\"INodeReference\" />\n+ </node>\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqgxvc\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~Nullable\" resolve=\"Nullable\" />\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"1oe$moqgxve\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"1oe$moqgBtX\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"1oe$moqgBtY\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"1oe$moqgBtZ\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"28I3pJBWL4h\" resolve=\"node\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"1oe$moqgBu0\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"jks5:~INode.setReferenceTarget(java.lang.String,org.modelix.model.api.INodeReference)\" resolve=\"setReferenceTarget\" />\n+ <node concept=\"37vLTw\" id=\"1oe$moqgBu1\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqgxv7\" resolve=\"role\" />\n+ </node>\n+ <node concept=\"1rXfSq\" id=\"1oe$moqgBu2\" role=\"37wK5m\">\n+ <ref role=\"37wK5l\" node=\"1oe$moqhW$v\" resolve=\"unwrap\" />\n+ <node concept=\"37vLTw\" id=\"1oe$moqgBu3\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"1oe$moqgxva\" resolve=\"target\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2AHcQZ\" id=\"1oe$moqgxvf\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n+ </node>\n+ </node>\n<node concept=\"3clFb_\" id=\"28I3pJBWIRC\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"getPropertyValue\" />\n<node concept=\"3Tm1VV\" id=\"28I3pJBWIRD\" role=\"1B3o_S\" />\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Migrated VirtualRepository (org.modelix.ui.common) to modelix.core 1.4.1
426,496
02.12.2022 14:50:23
-3,600
316d2d74cc6049a19553616d676dae1fafef665f
Caret wasn't blinking
[ { "change_type": "MODIFY", "old_path": "ui-client/src/styles/sm.scss", "new_path": "ui-client/src/styles/sm.scss", "diff": "@@ -125,3 +125,10 @@ a:active {\npadding: 3px 6px;\n}\n}\n+\n+@keyframes blinker {\n+ from { opacity: 100%; }\n+ 49% { opacity: 100%; }\n+ 50% { opacity: 40%; }\n+ to { opacity: 40%; }\n+}\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Caret wasn't blinking
426,496
03.12.2022 11:28:22
-3,600
f7644f61e69490fce1469b40e573e11afb0a723d
fixed integration test RepositoryCanBeAddedAndRemembered
[ { "change_type": "MODIFY", "old_path": "mps/org.modelix.integrationtests/models/org.modelix.integrationtests.mps", "new_path": "mps/org.modelix.integrationtests/models/org.modelix.integrationtests.mps", "diff": "</node>\n</node>\n</node>\n+ <node concept=\"3clFbH\" id=\"2w1ObJSZMLc\" role=\"3cqZAp\" />\n+ <node concept=\"3SKdUt\" id=\"2w1ObJSSV3X\" role=\"3cqZAp\">\n+ <node concept=\"1PaTwC\" id=\"2w1ObJSSV3Y\" role=\"1aUNEU\">\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYXl\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"trigger\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYXn\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"creation\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYXq\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"of\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYXu\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"the\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYXz\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"info\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYXD\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repository\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYXK\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"if\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYXS\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"it\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYY1\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"doesn't\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2w1ObJSSYYb\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"exist\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbJ\" id=\"2w1ObJSZPSO\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"2w1ObJSZPSQ\" role=\"3clFbx\">\n+ <node concept=\"3clFbF\" id=\"2w1ObJSZOB6\" role=\"3cqZAp\">\n+ <node concept=\"2YIFZM\" id=\"2w1ObJSZOB7\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~Thread.sleep(long)\" resolve=\"sleep\" />\n+ <ref role=\"1Pybhc\" to=\"wyt6:~Thread\" resolve=\"Thread\" />\n+ <node concept=\"3cmrfG\" id=\"2w1ObJSZOB8\" role=\"37wK5m\">\n+ <property role=\"3cmrfH\" value=\"2000\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbC\" id=\"2w1ObJSZRae\" role=\"3clFbw\">\n+ <node concept=\"10Nm6u\" id=\"2w1ObJSZRQw\" role=\"3uHU7w\" />\n+ <node concept=\"2OqwBi\" id=\"2w1ObJSSK0t\" role=\"3uHU7B\">\n+ <node concept=\"37vLTw\" id=\"2w1ObJSSGZV\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"6kuATO4oz9a\" resolve=\"msc1\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"2w1ObJSSNS1\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"csg2:6aRQr1WVmiT\" resolve=\"getInfo\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbH\" id=\"2w1ObJSZLy8\" role=\"3cqZAp\" />\n<node concept=\"3vlDli\" id=\"6kuATO4pPHm\" role=\"3cqZAp\">\n<node concept=\"2OqwBi\" id=\"6kuATO4pROv\" role=\"3tpDZA\">\n<node concept=\"37vLTw\" id=\"6kuATO4vkaQ\" role=\"2Oq$k0\">\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
fixed integration test RepositoryCanBeAddedAndRemembered
426,496
16.01.2023 11:08:23
-3,600
94f8a7cfd3630a365d57af9dfcd53a6334fdac74
default authorization configuration
[ { "change_type": "MODIFY", "old_path": "gradle.properties", "new_path": "gradle.properties", "diff": "@@ -8,4 +8,4 @@ kotlinxSerializationVersion=1.4.1\nktorVersion=2.0.3\nkotlinLoggingVersion=2.1.21\nlogbackVersion=1.2.1\n-modelixCoreVersion=1.4.3\n+modelixCoreVersion=1.4.19-SNAPSHOT\n" }, { "change_type": "MODIFY", "old_path": "helm/modelix/keycloak-realm.json", "new_path": "helm/modelix/keycloak-realm.json", "diff": "\"failureFactor\": 30,\n\"roles\": {\n\"realm\": [\n+ {\n+ \"name\": \"modelix-admin\",\n+ \"description\": \"\",\n+ \"composite\": false,\n+ \"clientRole\": false,\n+ \"containerId\": \"modelix\",\n+ \"attributes\": {}\n+ },\n+ {\n+ \"name\": \"modelix-user\",\n+ \"description\": \"\",\n+ \"composite\": false,\n+ \"clientRole\": false,\n+ \"containerId\": \"modelix\",\n+ \"attributes\": {}\n+ },\n{\n\"id\": \"035b6ab5-0db1-4918-bdaa-cf214f92d7d1\",\n\"name\": \"default-roles-modelix\",\n\"composite\": true,\n\"composites\": {\n\"realm\": [\n+ \"modelix-user\",\n\"offline_access\",\n\"uma_authorization\"\n],\n\"client\": {\n\"modelix\": [\n- \"modelix-user\",\n\"uma_protection\"\n],\n\"account\": [\n\"security-admin-console\": [],\n\"admin-cli\": [],\n\"modelix\": [\n- {\n- \"id\": \"a7019cf7-76c3-4221-8769-e5858ab3e053\",\n- \"name\": \"modelix-user\",\n- \"composite\": false,\n- \"clientRole\": true,\n- \"containerId\": \"42312d86-3a77-42b7-8b99-ebd072931c71\",\n- \"attributes\": {}\n- },\n{\n\"id\": \"ab3524db-4db2-4ec2-bcf8-891e1256b19d\",\n\"name\": \"uma_protection\",\n\"disableableCredentialTypes\": [],\n\"requiredActions\": [],\n\"realmRoles\": [\n- \"default-roles-modelix\"\n+ \"default-roles-modelix\",\n+ \"modelix-admin\"\n],\n\"clientRoles\": {\n\"modelix\": [\n- \"modelix-user\",\n\"uma_protection\"\n]\n},\n],\n\"authorizationSettings\": {\n\"allowRemoteResourceManagement\": true,\n- \"policyEnforcementMode\": \"PERMISSIVE\",\n+ \"policyEnforcementMode\": \"ENFORCING\",\n\"resources\": [\n{\n- \"name\": \"model-server-entry/branch_uistate_master\",\n- \"ownerManagedAccess\": false,\n- \"attributes\": {},\n- \"_id\": \"d394cd1e-d760-4558-8270-123457918a43\",\n- \"uris\": []\n- },\n- {\n- \"name\": \"model-json-api\",\n- \"ownerManagedAccess\": false,\n- \"attributes\": {},\n- \"_id\": \"c7845a53-017e-4c40-9759-87525bcddfbe\",\n- \"uris\": []\n- },\n- {\n- \"name\": \"model-server-entry/branch_default_master\",\n+ \"name\": \"default/workspace-list\",\n+ \"type\": \"default\",\n\"ownerManagedAccess\": false,\n\"attributes\": {},\n- \"_id\": \"9f8d5921-3748-42a6-86db-9adcc6851918\",\n- \"uris\": []\n- },\n+ \"uris\": [],\n+ \"scopes\": [\n+ {\"name\": \"add\"},\n+ {\"name\": \"list\"},\n+ {\"name\": \"read\"},\n+ {\"name\": \"delete\"},\n+ {\"name\": \"write\"}\n+ ]\n+ }\n+ ],\n+ \"policies\": [\n{\n- \"name\": \"model-server-entry/branch_info_master\",\n- \"ownerManagedAccess\": false,\n- \"attributes\": {},\n- \"_id\": \"52d8ee0c-f69c-4a30-99de-779211cc32f7\",\n- \"uris\": []\n+ \"name\": \"grant modelix-user\",\n+ \"type\": \"role\",\n+ \"logic\": \"POSITIVE\",\n+ \"decisionStrategy\": \"UNANIMOUS\",\n+ \"config\": {\n+ \"roles\": \"[{\\\"id\\\":\\\"modelix-user\\\",\\\"required\\\":false}]\"\n+ }\n},\n{\n- \"name\": \"model-server-entry/server-id\",\n- \"ownerManagedAccess\": false,\n- \"attributes\": {},\n- \"_id\": \"c7b15ee6-e59f-45ae-89a7-39cd4b6311ea\",\n- \"uris\": []\n+ \"name\": \"grant modelix-admin\",\n+ \"type\": \"role\",\n+ \"logic\": \"POSITIVE\",\n+ \"decisionStrategy\": \"UNANIMOUS\",\n+ \"config\": {\n+ \"roles\": \"[{\\\"id\\\":\\\"modelix-admin\\\",\\\"required\\\":false}]\"\n+ }\n},\n{\n- \"name\": \"model-server-entry/clientId\",\n- \"ownerManagedAccess\": false,\n- \"attributes\": {},\n- \"_id\": \"a25df1df-c784-4d24-9d19-c3472251f700\",\n- \"uris\": []\n+ \"name\": \"modelix-user can read workspace-list\",\n+ \"type\": \"scope\",\n+ \"logic\": \"POSITIVE\",\n+ \"decisionStrategy\": \"AFFIRMATIVE\",\n+ \"config\": {\n+ \"resources\": \"[\\\"default/workspace-list\\\"]\",\n+ \"scopes\": \"[\\\"read\\\"]\",\n+ \"applyPolicies\": \"[\\\"grant modelix-user\\\"]\"\n+ }\n},\n{\n- \"name\": \"model-server-entry/workspaces\",\n- \"ownerManagedAccess\": false,\n- \"attributes\": {},\n- \"_id\": \"75ad27b9-19bd-4ded-9123-6db183fa8b61\",\n- \"uris\": []\n- },\n+ \"name\": \"modelix-admin can modify everything\",\n+ \"type\": \"scope\",\n+ \"logic\": \"POSITIVE\",\n+ \"decisionStrategy\": \"AFFIRMATIVE\",\n+ \"config\": {\n+ \"scopes\": \"[\\\"delete\\\",\\\"write\\\",\\\"read\\\"]\",\n+ \"applyPolicies\": \"[\\\"grant modelix-admin\\\"]\"\n+ }\n+ }\n+ ],\n+ \"scopes\": [\n{\n- \"name\": \"workspaces\",\n- \"ownerManagedAccess\": false,\n- \"attributes\": {},\n- \"_id\": \"5c2cf492-b9f4-4de3-998c-506094f5ee94\",\n- \"uris\": []\n+ \"name\": \"delete\"\n},\n{\n- \"name\": \"model-server\",\n- \"ownerManagedAccess\": false,\n- \"attributes\": {},\n- \"_id\": \"ea40e226-6390-4e08-8986-36cc59fff8d3\",\n- \"uris\": []\n+ \"name\": \"write\"\n},\n{\n- \"name\": \"Default Resource\",\n- \"type\": \"urn:modelix:resources:default\",\n- \"ownerManagedAccess\": false,\n- \"attributes\": {},\n- \"_id\": \"626562bd-a2ad-490b-b703-fdde9ad9c692\",\n- \"uris\": [\n- \"/*\"\n- ]\n+ \"name\": \"read\"\n}\n],\n- \"policies\": [],\n- \"scopes\": [],\n- \"decisionStrategy\": \"UNANIMOUS\"\n+ \"decisionStrategy\": \"AFFIRMATIVE\"\n}\n},\n{\n" }, { "change_type": "MODIFY", "old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "diff": "@@ -20,11 +20,13 @@ import io.ktor.http.content.*\nimport io.ktor.server.application.*\nimport io.ktor.server.auth.*\nimport io.ktor.server.html.*\n+import io.ktor.server.html.HtmlContent\nimport io.ktor.server.plugins.cors.routing.*\nimport io.ktor.server.request.*\nimport io.ktor.server.response.*\nimport io.ktor.server.routing.*\nimport kotlinx.html.*\n+import kotlinx.html.stream.createHTML\nimport kotlinx.serialization.decodeFromString\nimport kotlinx.serialization.encodeToString\nimport org.apache.commons.io.FileUtils\n@@ -38,6 +40,9 @@ import org.modelix.workspaces.WorkspaceHash\nimport org.zeroturnaround.zip.ZipUtil\nimport java.io.File\n+val WORKSPACE_LIST = KeycloakResourceType.DEFAULT_TYPE.createInstance(\"workspace-list\")\n+val WORKSPACE_UPLOAD = KeycloakResourceType(\"workspace-upload\", setOf(KeycloakScope.READ, KeycloakScope.DELETE))\n+\nfun Application.workspaceManagerModule() {\nval manager = WorkspaceManager()\n@@ -46,9 +51,9 @@ fun Application.workspaceManagerModule() {\ninstallAuthentication()\nrouting {\n- requiresPermission(\"workspaces\", \"read\") {\n+ requiresPermission(WORKSPACE_LIST, KeycloakScope.READ) {\nget(\"/\") {\n- call.respondHtml(HttpStatusCode.OK) {\n+ call.respondHtmlSafe(HttpStatusCode.OK) {\nhead {\ntitle(\"Workspaces\")\nstyle {\n@@ -70,7 +75,9 @@ fun Application.workspaceManagerModule() {\n+\" Solutions are synchronized with the model server and between all MPS instances.\"\n}\ntable {\n- manager.getWorkspaceIds().mapNotNull { manager.getWorkspaceForId(it) }.forEach { workspaceAndHash ->\n+ manager.getWorkspaceIds()\n+ .filter { KeycloakUtils.hasPermission(call.jwt()!!, it.workspaceIdAsResource(), KeycloakScope.READ) }\n+ .mapNotNull { manager.getWorkspaceForId(it) }.forEach { workspaceAndHash ->\nval (workspace, workspaceHash) = workspaceAndHash\nval workspaceId = workspace.id\ntr {\n@@ -115,6 +122,7 @@ fun Application.workspaceManagerModule() {\n}\n}\ntd {\n+ if (KeycloakUtils.hasPermission(call.jwt()!!, workspace.asResource(), KeycloakScope.DELETE)) {\npostForm(\"./remove-workspace\") {\nstyle = \"display: inline-block\"\nhiddenInput {\n@@ -128,6 +136,8 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n+ }\n+ if (KeycloakUtils.hasPermission(call.jwt()!!, WORKSPACE_LIST, KeycloakScope.WRITE)) {\ntr {\ntd {\ncolSpan = \"5\"\n@@ -145,40 +155,91 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n-\n- post(\"new\") {\n- val workspace = manager.newWorkspace()\n- call.respondRedirect(\"${workspace.id}/edit\")\n}\n- post(\"{workspaceId}/update\") {\n- call.requiresWrite()\n+ get(\"{workspaceId}/hash\") {\n+ val workspaceId = call.parameters[\"workspaceId\"]!!\n+ val workspaceAndHash = manager.getWorkspaceForId(workspaceId)\n+ if (workspaceAndHash == null) {\n+ call.respond(HttpStatusCode.NotFound, \"Workspace $workspaceId not found\")\n+ } else {\n+ call.respondText(workspaceAndHash.second.toString(), ContentType.Text.Plain, HttpStatusCode.OK)\n+ }\n+ }\n- val yamlText = call.receiveParameters()[\"content\"]\n- val id = call.parameters[\"workspaceId\"] ?: throw IllegalArgumentException(\"workspaceId missing\")\n- if (yamlText == null) {\n- call.respond(HttpStatusCode.BadRequest, \"Content missing\")\n- return@post\n+ route(\"{workspaceId}/git/{repoOrUploadIndex}/\") {\n+ intercept(ApplicationCallPipeline.Call) {\n+ val workspaceId = call.parameters[\"workspaceId\"]!!\n+ val repoOrUploadIndex = call.parameters[\"repoOrUploadIndex\"]!!\n+ var repoIndex: Int? = null\n+ var uploadId: String? = null\n+ if (repoOrUploadIndex.startsWith(\"u\")) {\n+ uploadId = repoOrUploadIndex.drop(1)\n+ } else {\n+ repoIndex = repoOrUploadIndex.toInt()\n}\n- val workspace: Workspace\n- try {\n- workspace = Yaml.default.decodeFromString<Workspace>(yamlText)\n- } catch (e: Exception) {\n- call.respond(HttpStatusCode.BadRequest, e.message ?: \"Parse error\")\n- return@post\n+ val workspaceAndHash = manager.getWorkspaceForId(workspaceId)\n+ if (workspaceAndHash == null) {\n+ call.respondText(\"Workspace $workspaceId not found\", ContentType.Text.Plain, HttpStatusCode.NotFound)\n+ return@intercept\n+ }\n+ val (workspace, workspaceHash) = workspaceAndHash\n+ val repoDir: File\n+ if (repoIndex != null) {\n+ val repos = workspace.gitRepositories\n+ if (!repos.indices.contains(repoIndex)) {\n+ call.respondText(\"Git repository with index $repoIndex doesn't exist\", ContentType.Text.Plain, HttpStatusCode.NotFound)\n+ return@intercept\n+ }\n+ val repo = repos[repoIndex]\n+ val repoManager = GitRepositoryManager(repo, manager.getWorkspaceDirectory(workspace))\n+ if (!repoManager.repoDirectory.exists()) {\n+ repoManager.updateRepo()\n+ }\n+ repoDir = repoManager.repoDirectory\n+ } else {\n+ val uploadFolder = manager.getUploadFolder(uploadId!!)\n+ if (!uploadFolder.exists()) {\n+ call.respondText(\"Upload $uploadId doesn't exist\", ContentType.Text.Plain, HttpStatusCode.NotFound)\n+ return@intercept\n+ }\n+ if (uploadFolder.resolve(\".git\").exists()) {\n+ repoDir = uploadFolder\n+ } else {\n+ val repoDirFromUpload = findGitRepo(uploadFolder)\n+ if (repoDirFromUpload == null) {\n+ call.respondText(\"No git repository found in upload $uploadId\", ContentType.Text.Plain, HttpStatusCode.NotFound)\n+ return@intercept\n+ }\n+ repoDir = repoDirFromUpload\n+ }\n+ }\n+ call.attributes.put(GIT_REPO_DIR_ATTRIBUTE_KEY, repoDir)\n+ call.attributes.put(MPS_INSTANCE_URL_ATTRIBUTE_KEY, \"../../../../workspace-${workspace.id}-$workspaceHash/\")\n+ }\n+ gitui()\n+ }\n+ }\n+\n+ requiresWrite(WORKSPACE_LIST) {\n+ post(\"new\") {\n+ val jwt = call.jwt()!!\n+ val workspace = manager.newWorkspace()\n+ KeycloakUtils.grantPermission(jwt, workspace.asResource(), workspace.asResource().type.scopes)\n+ call.respondRedirect(\"${workspace.id}/edit\")\n}\n- // just in case the user copy-pastes a workspace and forgets to change the ID\n- workspace.id = id\n- manager.update(workspace)\n- call.respondRedirect(\"./edit\")\n}\n- get(\"{workspaceId}/edit\") {\n+ requiresLogin {\n+\n+ route(\"{workspaceId}\") {\n+ get(\"edit\") {\nval id = call.parameters[\"workspaceId\"]\nif (id == null) {\ncall.respond(HttpStatusCode.BadRequest, \"Workspace ID is missing\")\nreturn@get\n}\n+ call.checkPermission(id.workspaceIdAsResource(), KeycloakScope.READ)\nval workspaceAndHash = manager.getWorkspaceForId(id)\nif (workspaceAndHash == null) {\ncall.respond(HttpStatusCode.NotFound, \"Workspace $id not found\")\n@@ -460,7 +521,29 @@ fun Application.workspaceManagerModule() {\n}\n}\n- post(\"{workspaceId}/add-maven-dependency\") {\n+ post(\"update\") {\n+ call.checkPermission(call.parameters[\"workspaceId\"]!!.workspaceIdAsResource(), KeycloakScope.WRITE)\n+ val yamlText = call.receiveParameters()[\"content\"]\n+ val id = call.parameters[\"workspaceId\"] ?: throw IllegalArgumentException(\"workspaceId missing\")\n+ if (yamlText == null) {\n+ call.respond(HttpStatusCode.BadRequest, \"Content missing\")\n+ return@post\n+ }\n+ val workspace: Workspace\n+ try {\n+ workspace = Yaml.default.decodeFromString<Workspace>(yamlText)\n+ } catch (e: Exception) {\n+ call.respond(HttpStatusCode.BadRequest, e.message ?: \"Parse error\")\n+ return@post\n+ }\n+ // just in case the user copy-pastes a workspace and forgets to change the ID\n+ workspace.id = id\n+ manager.update(workspace)\n+ call.respondRedirect(\"./edit\")\n+ }\n+\n+ post(\"add-maven-dependency\") {\n+ call.checkPermission(call.parameters[\"workspaceId\"]!!.workspaceIdAsResource(), KeycloakScope.WRITE)\nval id = call.parameters[\"workspaceId\"]\nif (id == null) {\ncall.respond(HttpStatusCode.BadRequest, \"Workspace ID is missing\")\n@@ -482,74 +565,10 @@ fun Application.workspaceManagerModule() {\n}\n}\n- get(\"{workspaceId}/hash\") {\n- val workspaceId = call.parameters[\"workspaceId\"]!!\n- val workspaceAndHash = manager.getWorkspaceForId(workspaceId)\n- if (workspaceAndHash == null) {\n- call.respond(HttpStatusCode.NotFound, \"Workspace $workspaceId not found\")\n- } else {\n- call.respondText(workspaceAndHash.second.toString(), ContentType.Text.Plain, HttpStatusCode.OK)\n- }\n- }\n-\n- route(\"{workspaceId}/git/{repoOrUploadIndex}/\") {\n- intercept(ApplicationCallPipeline.Call) {\n- val workspaceId = call.parameters[\"workspaceId\"]!!\n- val repoOrUploadIndex = call.parameters[\"repoOrUploadIndex\"]!!\n- var repoIndex: Int? = null\n- var uploadId: String? = null\n- if (repoOrUploadIndex.startsWith(\"u\")) {\n- uploadId = repoOrUploadIndex.drop(1)\n- } else {\n- repoIndex = repoOrUploadIndex.toInt()\n- }\n- val workspaceAndHash = manager.getWorkspaceForId(workspaceId)\n- if (workspaceAndHash == null) {\n- call.respondText(\"Workspace $workspaceId not found\", ContentType.Text.Plain, HttpStatusCode.NotFound)\n- return@intercept\n- }\n- val (workspace, workspaceHash) = workspaceAndHash\n- val repoDir: File\n- if (repoIndex != null) {\n- val repos = workspace.gitRepositories\n- if (!repos.indices.contains(repoIndex)) {\n- call.respondText(\"Git repository with index $repoIndex doesn't exist\", ContentType.Text.Plain, HttpStatusCode.NotFound)\n- return@intercept\n- }\n- val repo = repos[repoIndex]\n- val repoManager = GitRepositoryManager(repo, manager.getWorkspaceDirectory(workspace))\n- if (!repoManager.repoDirectory.exists()) {\n- repoManager.updateRepo()\n- }\n- repoDir = repoManager.repoDirectory\n- } else {\n- val uploadFolder = manager.getUploadFolder(uploadId!!)\n- if (!uploadFolder.exists()) {\n- call.respondText(\"Upload $uploadId doesn't exist\", ContentType.Text.Plain, HttpStatusCode.NotFound)\n- return@intercept\n- }\n- if (uploadFolder.resolve(\".git\").exists()) {\n- repoDir = uploadFolder\n- } else {\n- val repoDirFromUpload = findGitRepo(uploadFolder)\n- if (repoDirFromUpload == null) {\n- call.respondText(\"No git repository found in upload $uploadId\", ContentType.Text.Plain, HttpStatusCode.NotFound)\n- return@intercept\n- }\n- repoDir = repoDirFromUpload\n- }\n- }\n- call.attributes.put(GIT_REPO_DIR_ATTRIBUTE_KEY, repoDir)\n- call.attributes.put(MPS_INSTANCE_URL_ATTRIBUTE_KEY, \"../../../../workspace-${workspace.id}-$workspaceHash/\")\n- }\n- gitui()\n- }\n- }\n-\n- requiresPermission(\"workspaces\", \"write\") {\n- post(\"{workspaceId}/upload\") {\n- call.requiresWrite()\n+ post(\"upload\") {\n+ call.checkPermission(call.parameters[\"workspaceId\"]!!.workspaceIdAsResource(), KeycloakScope.WRITE)\nval workspaceId = call.parameters[\"workspaceId\"]!!\n+ call.checkPermission(workspaceId.workspaceIdAsResource(), KeycloakScope.WRITE)\nval workspaceAndHash = manager.getWorkspaceForId(workspaceId)\nif (workspaceAndHash == null) {\ncall.respondText(\"Workspace $workspaceId not found\", ContentType.Text.Plain, HttpStatusCode.NotFound)\n@@ -557,6 +576,7 @@ fun Application.workspaceManagerModule() {\n}\nval outputFolder = manager.newUploadFolder()\n+ KeycloakUtils.grantPermission(call.jwt()!!, WORKSPACE_UPLOAD.createInstance(outputFolder.name), WORKSPACE_UPLOAD.scopes)\ncall.receiveMultipart().forEachPart { part ->\nif (part is PartData.FileItem) {\n@@ -580,18 +600,19 @@ fun Application.workspaceManagerModule() {\ncall.respondRedirect(\"./edit\")\n}\n- post(\"{workspaceId}/use-upload\") {\n- call.requiresWrite()\n+ post(\"use-upload\") {\n+ call.checkPermission(call.parameters[\"workspaceId\"]!!.workspaceIdAsResource(), KeycloakScope.WRITE)\nval workspaceId = call.parameters[\"workspaceId\"]!!\nval uploadId = call.receiveParameters()[\"uploadId\"]!!\n+ call.checkPermission(WORKSPACE_UPLOAD.createInstance(uploadId), KeycloakScope.READ)\nval workspace = manager.getWorkspaceForId(workspaceId)?.first!!\nworkspace.uploads += uploadId\nmanager.update(workspace)\ncall.respondRedirect(\"./edit\")\n}\n- post(\"{workspaceId}/remove-upload\") {\n- call.requiresWrite()\n+ post(\"remove-upload\") {\n+ call.checkPermission(call.parameters[\"workspaceId\"]!!.workspaceIdAsResource(), KeycloakScope.WRITE)\nval workspaceId = call.parameters[\"workspaceId\"]!!\nval uploadId = call.receiveParameters()[\"uploadId\"]!!\nval workspace = manager.getWorkspaceForId(workspaceId)?.first!!\n@@ -600,9 +621,10 @@ fun Application.workspaceManagerModule() {\ncall.respondRedirect(\"./edit\")\n}\n- post(\"{workspaceId}/delete-upload\") {\n- call.requiresWrite()\n+ post(\"delete-upload\") {\n+ call.checkPermission(call.parameters[\"workspaceId\"]!!.workspaceIdAsResource(), KeycloakScope.WRITE)\nval uploadId = call.receiveParameters()[\"uploadId\"]!!\n+ call.checkPermission(WORKSPACE_UPLOAD.createInstance(uploadId), KeycloakScope.DELETE)\nval allWorkspaces = manager.getWorkspaceIds().mapNotNull { manager.getWorkspaceForId(it)?.first }\nfor (workspace in allWorkspaces.filter { it.uploads.contains(uploadId) }) {\nworkspace.uploads -= uploadId\n@@ -611,17 +633,15 @@ fun Application.workspaceManagerModule() {\nmanager.deleteUpload(uploadId)\ncall.respondRedirect(\"./edit\")\n}\n-\n- post(\"remove-workspace\") {\n- call.requiresWrite()\n- val workspaceId = call.receiveParameters()[\"workspaceId\"]!!\n- manager.removeWorkspace(workspaceId)\n- call.respondRedirect(\".\")\n- }\n}\n- get(\"/health\") {\n- call.respondText(\"healthy\", ContentType.Text.Plain, HttpStatusCode.OK)\n+ route(\"{workspaceHash}\") {\n+ intercept(ApplicationCallPipeline.Call) {\n+ val workspaceHash = WorkspaceHash(call.parameters[\"workspaceHash\"]!!)\n+ val workspace = manager.getWorkspaceForHash(workspaceHash)\n+ if (workspace != null) {\n+ call.checkPermission(workspace.asResource(), KeycloakScope.READ)\n+ }\n}\nget(\"{workspaceHash}/download-modules/queue\") {\n@@ -687,6 +707,20 @@ fun Application.workspaceManagerModule() {\n}\n}\n+ post(\"/remove-workspace\") {\n+ val workspaceId = call.receiveParameters()[\"workspaceId\"]!!\n+ call.checkPermission(workspaceId.workspaceIdAsResource(), KeycloakScope.DELETE)\n+ manager.removeWorkspace(workspaceId)\n+ call.respondRedirect(\".\")\n+ }\n+ }\n+\n+ get(\"/health\") {\n+ call.respondText(\"healthy\", ContentType.Text.Plain, HttpStatusCode.OK)\n+ }\n+\n+ }\n+\ninstall(CORS) {\nanyHost()\nallowHeader(HttpHeaders.ContentType)\n@@ -708,6 +742,16 @@ private fun findGitRepo(folder: File): File? {\nreturn null\n}\n-private fun ApplicationCall.requiresWrite() {\n- checkPermission(\"workspaces\", \"write\")\n+fun Workspace.asResource() = id.workspaceIdAsResource()\n+fun String.workspaceIdAsResource() = KeycloakResourceType.WORKSPACE.createInstance(this)\n+\n+/**\n+ * respondHtml fails to respond anything if an exception is thrown in the body and an error handler is installed\n+ * that tries to respond an error page.\n+ */\n+suspend fun ApplicationCall.respondHtmlSafe(status: HttpStatusCode = HttpStatusCode.OK, block: HTML.() -> Unit) {\n+ val htmlText = createHTML().html {\n+ block()\n+ }\n+ respondText(htmlText, ContentType.Text.Html, status)\n}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
default authorization configuration
426,505
24.01.2023 16:45:14
-3,600
41da1c234281dc3e26720ae483e4ad9430aa6739
instances-manager: enable simple SLF4J logging
[ { "change_type": "MODIFY", "old_path": "instances-manager/build.gradle", "new_path": "instances-manager/build.gradle", "diff": "@@ -61,6 +61,8 @@ dependencies {\nimplementation(\"io.ktor:ktor-server-cors:$ktorVersion\")\nimplementation(\"io.ktor:ktor-server-html-builder:$ktorVersion\")\nimplementation(\"io.github.microutils:kotlin-logging:$kotlinLoggingVersion\")\n+\n+ runtimeOnly(\"org.slf4j:slf4j-simple:2.0.6\")\n}\nassemble.dependsOn shadowJar\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
instances-manager: enable simple SLF4J logging
426,496
24.01.2023 17:00:05
-3,600
eb3a606c93be54e54cdc195b3ad2f5027890dcd2
removed stubs that are now part of model-api
[ { "change_type": "MODIFY", "old_path": "mps/org.modelix.build/models/org.modelix.build.mps", "new_path": "mps/org.modelix.build/models/org.modelix.build.mps", "diff": "</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"51AkiRkUhQ6\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"51AkiRkUhQ7\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"51AkiRkUhPX\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"51AkiRkUhPY\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"51AkiRkUhPZ\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"51AkiRkUhQ0\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"kotlinx-serialization-core-jvm.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"1SiIV0\" id=\"51AkiRkUhQh\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"51AkiRkUhQi\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"51AkiRkUhQ8\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"51AkiRkUhQ9\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"51AkiRkUhQa\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"51AkiRkUhQb\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"kotlinx-serialization-json-jvm.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n<node concept=\"1SiIV0\" id=\"51AkiRkUhQs\" role=\"3bR37C\">\n<node concept=\"1BurEX\" id=\"51AkiRkUhQt\" role=\"1SiIV1\">\n<node concept=\"398BVA\" id=\"51AkiRkUhQj\" role=\"1BurEY\">\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"4nxIG0bJc1_\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"4nxIG0bJc1A\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"4nxIG0bJc1s\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc1t\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.client\" />\n- <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc1u\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"4nxIG0bJc1v\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"slf4j-api.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n<node concept=\"1SiIV0\" id=\"3cfNRjMvkmj\" role=\"3bR37C\">\n<node concept=\"1BurEX\" id=\"3cfNRjMvkmk\" role=\"1SiIV1\">\n<node concept=\"398BVA\" id=\"3cfNRjMvkma\" role=\"1BurEY\">\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"7VLV6fKuWu2\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"7VLV6fKuWu3\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"7VLV6fKuWtT\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"7VLV6fKuWtU\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.server.mpsplugin\" />\n- <node concept=\"2Ry0Ak\" id=\"7VLV6fKuWtV\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"7VLV6fKuWtW\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"kotlinx-serialization-core-jvm.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"1SiIV0\" id=\"7VLV6fKuWud\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"7VLV6fKuWue\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"7VLV6fKuWu4\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"7VLV6fKuWu5\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.server.mpsplugin\" />\n- <node concept=\"2Ry0Ak\" id=\"7VLV6fKuWu6\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"7VLV6fKuWu7\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"kotlinx-serialization-json-jvm.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n<node concept=\"1SiIV0\" id=\"7VLV6fKuWuo\" role=\"3bR37C\">\n<node concept=\"1BurEX\" id=\"7VLV6fKuWup\" role=\"1SiIV1\">\n<node concept=\"398BVA\" id=\"7VLV6fKuWuf\" role=\"1BurEY\">\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"7VLV6fKuWzn\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"7VLV6fKuWzo\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"7VLV6fKuWze\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"7VLV6fKuWzf\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.model.server.mpsplugin\" />\n- <node concept=\"2Ry0Ak\" id=\"7VLV6fKuWzg\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"7VLV6fKuWzh\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"slf4j-api.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n<node concept=\"1BupzO\" id=\"7VLV6fKuWzw\" role=\"3bR31x\">\n<property role=\"3ZfqAx\" value=\"models\" />\n<property role=\"1Hdu6h\" value=\"true\" />\n<node concept=\"3LEDTy\" id=\"7BujJjYSJ9v\" role=\"3LEDUa\">\n<ref role=\"3LEDTV\" node=\"7gF2HTviNPn\" resolve=\"org.modelix.ui.sm\" />\n</node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RO\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KZG\" resolve=\"jetbrains.mps.baseLanguage.closures\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RP\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L0h\" resolve=\"jetbrains.mps.baseLanguage.collections\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RQ\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L4j\" resolve=\"jetbrains.mps.lang.actions\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RR\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L2F\" resolve=\"jetbrains.mps.baseLanguage.tuples\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RS\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L2l\" resolve=\"jetbrains.mps.baseLanguage.logging\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RT\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KYb\" resolve=\"jetbrains.mps.baseLanguage\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RU\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:2$QnGbtLXzL\" resolve=\"de.q60.mps.shadowmodels.gen.desugar\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RV\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L9O\" resolve=\"jetbrains.mps.lang.smodel\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RW\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:14x5$qAUbkb\" resolve=\"jetbrains.mps.lang.access\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RX\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:7c10t$7lQIA\" resolve=\"de.q60.mps.shadowmodels.gen.typesystem\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RY\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:4iIKqJTZ5HO\" resolve=\"de.q60.mps.shadowmodels.transformation\" />\n- </node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69RZ\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:4iIKqJTZ5Hg\" resolve=\"de.q60.mps.shadowmodels.gen.afterPF\" />\n+ <node concept=\"3LEDTy\" id=\"2j2Qp6EP64C\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KXW\" resolve=\"jetbrains.mps.lang.core\" />\n</node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69S0\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KZ0\" resolve=\"jetbrains.mps.baseLanguageInternal\" />\n+ <node concept=\"3LEDTy\" id=\"2j2Qp6EP64D\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L9c\" resolve=\"jetbrains.mps.lang.quotation\" />\n</node>\n- <node concept=\"3LEDTy\" id=\"1$oc9OB69S1\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"90a9:4iIKqJTZ5Hs\" resolve=\"de.q60.mps.polymorphicfunctions\" />\n+ <node concept=\"3LEDTy\" id=\"2j2Qp6EP64E\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KZc\" resolve=\"jetbrains.mps.baseLanguage.checkedDots\" />\n</node>\n</node>\n<node concept=\"1E1JtD\" id=\"7BujJjXYVmv\" role=\"2G$12L\">\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.model.client/org.modelix.model.client.msd", "new_path": "mps/org.modelix.model.client/org.modelix.model.client.msd", "diff": "<sourceRoot location=\"kotlinx-coroutines-core-jvm.jar\" />\n<sourceRoot location=\"kotlinx-coroutines-jdk8.jar\" />\n<sourceRoot location=\"kotlinx-coroutines-slf4j.jar\" />\n- <sourceRoot location=\"kotlinx-serialization-core-jvm.jar\" />\n- <sourceRoot location=\"kotlinx-serialization-json-jvm.jar\" />\n<sourceRoot location=\"ktor-client-cio-jvm.jar\" />\n<sourceRoot location=\"ktor-client-content-negotiation-jvm.jar\" />\n<sourceRoot location=\"ktor-client-core-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/kotlinx-coroutines-core-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/kotlinx-coroutines-jdk8.jar\" />\n<stubModelEntry path=\"${module}/lib/kotlinx-coroutines-slf4j.jar\" />\n- <stubModelEntry path=\"${module}/lib/kotlinx-serialization-core-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/kotlinx-serialization-json-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-client-auth-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-client-cio-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-client-content-negotiation-jvm.jar\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.model.server.mpsplugin/org.modelix.model.server.mpsplugin.msd", "new_path": "mps/org.modelix.model.server.mpsplugin/org.modelix.model.server.mpsplugin.msd", "diff": "<sourceRoot location=\"kotlin-reflect.jar\" />\n<sourceRoot location=\"kotlinx-coroutines-core-jvm.jar\" />\n<sourceRoot location=\"kotlinx-coroutines-jdk8.jar\" />\n- <sourceRoot location=\"kotlinx-serialization-core-jvm.jar\" />\n- <sourceRoot location=\"kotlinx-serialization-json-jvm.jar\" />\n<sourceRoot location=\"ktor-events-jvm.jar\" />\n<sourceRoot location=\"ktor-http-cio-jvm.jar\" />\n<sourceRoot location=\"ktor-http-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/kotlin-reflect.jar\" />\n<stubModelEntry path=\"${module}/lib/kotlinx-coroutines-core-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/kotlinx-coroutines-jdk8.jar\" />\n- <stubModelEntry path=\"${module}/lib/kotlinx-serialization-core-jvm.jar\" />\n- <stubModelEntry path=\"${module}/lib/kotlinx-serialization-json-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-events-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-http-cio-jvm.jar\" />\n<stubModelEntry path=\"${module}/lib/ktor-http-jvm.jar\" />\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
removed stubs that are now part of model-api
426,496
24.01.2023 18:10:12
-3,600
30d04a4cf79611520568ca785377a3d47b97f9b1
allow users to create a new workspace
[ { "change_type": "MODIFY", "old_path": "helm/modelix/keycloak-realm.json", "new_path": "helm/modelix/keycloak-realm.json", "diff": "\"policyEnforcementMode\": \"ENFORCING\",\n\"resources\": [\n{\n- \"name\": \"default/workspace-list\",\n- \"type\": \"default\",\n+ \"name\": \"list/workspace-list\",\n+ \"type\": \"list\",\n\"ownerManagedAccess\": false,\n\"attributes\": {},\n\"uris\": [],\n}\n},\n{\n- \"name\": \"modelix-user can read workspace-list\",\n+ \"name\": \"modelix-user can add to workspace-list\",\n\"type\": \"scope\",\n\"logic\": \"POSITIVE\",\n\"decisionStrategy\": \"AFFIRMATIVE\",\n\"config\": {\n- \"resources\": \"[\\\"default/workspace-list\\\"]\",\n- \"scopes\": \"[\\\"read\\\"]\",\n+ \"resources\": \"[\\\"list/workspace-list\\\"]\",\n+ \"scopes\": \"[\\\"read\\\", \\\"add\\\"]\",\n\"applyPolicies\": \"[\\\"grant modelix-user\\\"]\"\n}\n},\n" }, { "change_type": "MODIFY", "old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "diff": "@@ -40,7 +40,8 @@ import org.modelix.workspaces.WorkspaceHash\nimport org.zeroturnaround.zip.ZipUtil\nimport java.io.File\n-val WORKSPACE_LIST = KeycloakResourceType.DEFAULT_TYPE.createInstance(\"workspace-list\")\n+val WORKSPACE_LIST = KeycloakResourceType(\"list\", setOf(KeycloakScope.ADD, KeycloakScope.READ, KeycloakScope.WRITE))\n+ .createInstance(\"workspace-list\")\nval WORKSPACE_UPLOAD = KeycloakResourceType(\"workspace-upload\", setOf(KeycloakScope.READ, KeycloakScope.DELETE))\nfun Application.workspaceManagerModule() {\n@@ -137,7 +138,7 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n- if (KeycloakUtils.hasPermission(call.jwt()!!, WORKSPACE_LIST, KeycloakScope.WRITE)) {\n+ if (KeycloakUtils.hasPermission(call.jwt()!!, WORKSPACE_LIST, KeycloakScope.ADD)) {\ntr {\ntd {\ncolSpan = \"5\"\n@@ -221,7 +222,7 @@ fun Application.workspaceManagerModule() {\n}\n}\n- requiresWrite(WORKSPACE_LIST) {\n+ requiresPermission(WORKSPACE_LIST, KeycloakScope.ADD) {\npost(\"new\") {\nval jwt = call.jwt()!!\nval workspace = manager.newWorkspace()\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
allow users to create a new workspace
426,496
26.01.2023 12:32:05
-3,600
92d73b7d15f8259be7a5ef8df905344bc91091b9
grant access to the owner of a workspace (2)
[ { "change_type": "MODIFY", "old_path": "gradle.properties", "new_path": "gradle.properties", "diff": "@@ -8,4 +8,4 @@ kotlinxSerializationVersion=1.4.1\nktorVersion=2.0.3\nkotlinLoggingVersion=2.1.21\nlogbackVersion=1.2.1\n-modelixCoreVersion=1.5.5\n+modelixCoreVersion=1.5.6\n" }, { "change_type": "MODIFY", "old_path": "keycloak-extensions/src/main/java/org/modelix/keycloak/GrantOwnerPolicyProvider.java", "new_path": "keycloak-extensions/src/main/java/org/modelix/keycloak/GrantOwnerPolicyProvider.java", "diff": "@@ -5,7 +5,10 @@ import org.keycloak.authorization.model.Policy;\nimport org.keycloak.authorization.policy.evaluation.Evaluation;\nimport org.keycloak.authorization.policy.provider.PolicyProvider;\n+import java.util.HashSet;\n+import java.util.List;\nimport java.util.Objects;\n+import java.util.Set;\nimport java.util.function.BiFunction;\npublic class GrantOwnerPolicyProvider implements PolicyProvider {\n@@ -24,10 +27,14 @@ public class GrantOwnerPolicyProvider implements PolicyProvider {\npublic void evaluate(Evaluation evaluation) {\nAuthorizationProvider authorizationProvider = evaluation.getAuthorizationProvider();\n//GrantOwnerPolicyRepresentation policy = representationFunction.apply(evaluation.getPolicy(), authorizationProvider);\n+ Set<String> owners = new HashSet<>();\nString owner = evaluation.getPermission().getResource().getOwner();\n+ if (owner != null) owners.add(owner);\n+ List<String> createdBy = evaluation.getPermission().getResource().getAttribute(\"created-by\");\n+ if (createdBy != null) owners.addAll(createdBy);\nString user = evaluation.getContext().getIdentity().getId();\n- if (Objects.equals(owner, user)) {\n+ if (owners.contains(user)) {\nevaluation.grant();\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "keycloak-extensions/src/main/java/org/modelix/keycloak/GrantOwnerPolicyRepresentation.java", "new_path": "keycloak-extensions/src/main/java/org/modelix/keycloak/GrantOwnerPolicyRepresentation.java", "diff": "@@ -6,7 +6,7 @@ public class GrantOwnerPolicyRepresentation extends AbstractPolicyRepresentation\n@Override\npublic String getType() {\n- return \"grant owner\";\n+ return \"grant-owner\";\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "diff": "@@ -20,7 +20,6 @@ import io.ktor.http.content.*\nimport io.ktor.server.application.*\nimport io.ktor.server.auth.*\nimport io.ktor.server.html.*\n-import io.ktor.server.html.HtmlContent\nimport io.ktor.server.plugins.cors.routing.*\nimport io.ktor.server.request.*\nimport io.ktor.server.response.*\n@@ -35,15 +34,10 @@ import org.modelix.authorization.*\nimport org.modelix.gitui.GIT_REPO_DIR_ATTRIBUTE_KEY\nimport org.modelix.gitui.MPS_INSTANCE_URL_ATTRIBUTE_KEY\nimport org.modelix.gitui.gitui\n-import org.modelix.workspaces.Workspace\n-import org.modelix.workspaces.WorkspaceHash\n+import org.modelix.workspaces.*\nimport org.zeroturnaround.zip.ZipUtil\nimport java.io.File\n-val WORKSPACE_LIST = KeycloakResourceType(\"list\", setOf(KeycloakScope.ADD, KeycloakScope.READ, KeycloakScope.WRITE))\n- .createInstance(\"workspace-list\")\n-val WORKSPACE_UPLOAD = KeycloakResourceType(\"workspace-upload\", setOf(KeycloakScope.READ, KeycloakScope.DELETE))\n-\nfun Application.workspaceManagerModule() {\nval manager = WorkspaceManager()\n@@ -52,7 +46,7 @@ fun Application.workspaceManagerModule() {\ninstallAuthentication()\nrouting {\n- requiresPermission(WORKSPACE_LIST, KeycloakScope.READ) {\n+ requiresPermission(workspaceListResource, KeycloakScope.READ) {\nget(\"/\") {\ncall.respondHtmlSafe(HttpStatusCode.OK) {\nhead {\n@@ -151,7 +145,7 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n- if (KeycloakUtils.hasPermission(call.jwt()!!, WORKSPACE_LIST, KeycloakScope.ADD)) {\n+ if (KeycloakUtils.hasPermission(call.jwt()!!, workspaceListResource, KeycloakScope.ADD)) {\ntr {\ntd {\ncolSpan = \"5\"\n@@ -235,11 +229,10 @@ fun Application.workspaceManagerModule() {\n}\n}\n- requiresPermission(WORKSPACE_LIST, KeycloakScope.ADD) {\n+ requiresPermission(workspaceListResource, KeycloakScope.ADD) {\npost(\"new\") {\nval jwt = call.jwt()!!\nval workspace = manager.newWorkspace()\n- KeycloakUtils.grantPermission(jwt, workspace.asResource(), workspace.asResource().type.scopes)\ncall.respondRedirect(\"${workspace.id}/edit\")\n}\n}\n@@ -590,7 +583,6 @@ fun Application.workspaceManagerModule() {\n}\nval outputFolder = manager.newUploadFolder()\n- KeycloakUtils.grantPermission(call.jwt()!!, WORKSPACE_UPLOAD.createInstance(outputFolder.name), WORKSPACE_UPLOAD.scopes)\ncall.receiveMultipart().forEachPart { part ->\nif (part is PartData.FileItem) {\n@@ -618,7 +610,7 @@ fun Application.workspaceManagerModule() {\ncall.checkPermission(call.parameters[\"workspaceId\"]!!.workspaceIdAsResource(), KeycloakScope.WRITE)\nval workspaceId = call.parameters[\"workspaceId\"]!!\nval uploadId = call.receiveParameters()[\"uploadId\"]!!\n- call.checkPermission(WORKSPACE_UPLOAD.createInstance(uploadId), KeycloakScope.READ)\n+ call.checkPermission(workspaceUploadResourceType.createInstance(uploadId), KeycloakScope.READ)\nval workspace = manager.getWorkspaceForId(workspaceId)?.first!!\nworkspace.uploads += uploadId\nmanager.update(workspace)\n@@ -638,7 +630,7 @@ fun Application.workspaceManagerModule() {\npost(\"delete-upload\") {\ncall.checkPermission(call.parameters[\"workspaceId\"]!!.workspaceIdAsResource(), KeycloakScope.WRITE)\nval uploadId = call.receiveParameters()[\"uploadId\"]!!\n- call.checkPermission(WORKSPACE_UPLOAD.createInstance(uploadId), KeycloakScope.DELETE)\n+ call.checkPermission(workspaceUploadResourceType.createInstance(uploadId), KeycloakScope.DELETE)\nval allWorkspaces = manager.getWorkspaceIds().mapNotNull { manager.getWorkspaceForId(it)?.first }\nfor (workspace in allWorkspaces.filter { it.uploads.contains(uploadId) }) {\nworkspace.uploads -= uploadId\n@@ -757,7 +749,7 @@ private fun findGitRepo(folder: File): File? {\n}\nfun Workspace.asResource() = id.workspaceIdAsResource()\n-fun String.workspaceIdAsResource() = KeycloakResourceType.WORKSPACE.createInstance(this)\n+fun String.workspaceIdAsResource() = workspaceResourceType.createInstance(this)\n/**\n* respondHtml fails to respond anything if an exception is thrown in the body and an error handler is installed\n" }, { "change_type": "MODIFY", "old_path": "workspaces/src/main/kotlin/org/modelix/workspaces/WorkspacePersistence.kt", "new_path": "workspaces/src/main/kotlin/org/modelix/workspaces/WorkspacePersistence.kt", "diff": "@@ -16,11 +16,18 @@ package org.modelix.workspaces\nimport kotlinx.serialization.decodeFromString\nimport kotlinx.serialization.encodeToString\nimport kotlinx.serialization.json.Json\n+import org.modelix.authorization.KeycloakResourceType\n+import org.modelix.authorization.KeycloakScope\nimport org.modelix.authorization.serviceAccountTokenProvider\nimport org.modelix.model.client.RestWebModelClient\nimport org.modelix.model.persistent.HashUtil\nimport org.modelix.model.persistent.SerializationUtil\n+val workspaceResourceType = KeycloakResourceType(\"workspace\", KeycloakScope.READ_WRITE_DELETE_LIST, createByUser = true)\n+val workspaceListResource = KeycloakResourceType(\"list\", setOf(KeycloakScope.ADD, KeycloakScope.READ, KeycloakScope.WRITE))\n+ .createInstance(\"workspace-list\")\n+val workspaceUploadResourceType = KeycloakResourceType(\"workspace-upload\", setOf(KeycloakScope.READ, KeycloakScope.DELETE), createByUser = true)\n+\nclass WorkspacePersistence() {\nprivate val WORKSPACE_LIST_KEY = \"workspaces\"\nprivate val modelClient: RestWebModelClient = RestWebModelClient(getModelServerUrl(), authTokenProvider = serviceAccountTokenProvider)\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
grant access to the owner of a workspace (2)
426,496
26.01.2023 12:44:22
-3,600
a95e1885dc311c360763a4cfa56610209373da97
hide buttons on the edit page if the user has no WRITE permission
[ { "change_type": "MODIFY", "old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "diff": "@@ -254,6 +254,7 @@ fun Application.workspaceManagerModule() {\n}\nval (workspace, workspaceHash) = workspaceAndHash\nval yaml = Yaml.default.encodeToString(workspace)\n+ val canWrite = KeycloakUtils.hasPermission(call.jwt()!!, workspace.asResource(), KeycloakScope.WRITE)\nthis.call.respondHtml(HttpStatusCode.OK) {\nhead {\n@@ -309,6 +310,7 @@ fun Application.workspaceManagerModule() {\nstyle = \"width: 800px; height: 500px\"\ntext(yaml)\n}\n+ if (canWrite) {\nbr()\ninput {\ntype = InputType.submit\n@@ -316,6 +318,7 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n+ }\ndiv {\nstyle = \"display: inline-block\"\nul {\n@@ -417,10 +420,12 @@ fun Application.workspaceManagerModule() {\n}\ntable {\nfor (upload in allUploads.toSortedMap()) {\n+ val uploadResource = workspaceUploadResourceType.createInstance(upload.key)\ntr {\ntd { +upload.key }\ntd { +uploadContent(upload) }\ntd {\n+ if (canWrite) {\nif (workspace.uploads.contains(upload.key)) {\nform {\naction = \"./remove-upload\"\n@@ -451,7 +456,9 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n+ }\ntd {\n+ if (KeycloakUtils.hasPermission(call.jwt()!!, uploadResource, KeycloakScope.DELETE)) {\nform {\naction = \"./delete-upload\"\nmethod = FormMethod.post\n@@ -468,6 +475,8 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n+ }\n+ if (canWrite) {\nbr()\nbr()\ndiv { text(\"Upload new file or directory (max ~200 MB):\") }\n@@ -500,6 +509,8 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n+ }\n+ if (canWrite) {\nbr()\nbr()\ndiv {\n@@ -527,6 +538,7 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n+ }\npost(\"update\") {\ncall.checkPermission(call.parameters[\"workspaceId\"]!!.workspaceIdAsResource(), KeycloakScope.WRITE)\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
hide buttons on the edit page if the user has no WRITE permission
426,496
26.01.2023 14:00:19
-3,600
4caaa232c09f3dfb950448aac5a7a595dd9dc8af
allow all users to read all workspaces by default
[ { "change_type": "MODIFY", "old_path": "helm/modelix/keycloak-realm.json", "new_path": "helm/modelix/keycloak-realm.json", "diff": "\"applyPolicies\": \"[\\\"grant modelix-user\\\"]\"\n}\n},\n+ {\n+ \"name\": \"modelix-user can read all workspaces\",\n+ \"type\": \"scope\",\n+ \"logic\": \"POSITIVE\",\n+ \"decisionStrategy\": \"AFFIRMATIVE\",\n+ \"config\": {\n+ \"defaultResourceType\": \"workspace\",\n+ \"scopes\": \"[\\\"read\\\", \\\"list\\\"]\",\n+ \"applyPolicies\": \"[\\\"grant modelix-user\\\"]\"\n+ }\n+ },\n{\n\"name\": \"modelix-admin can modify everything\",\n\"type\": \"scope\",\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
allow all users to read all workspaces by default
426,496
03.02.2023 15:33:02
-3,600
5b9ea020085ebe80355db47c1ff5f2c27189b0d2
bundled MPS libraries were still downloaded from github packages
[ { "change_type": "MODIFY", "old_path": "Dockerfile-workspace-manager", "new_path": "Dockerfile-workspace-manager", "diff": "@@ -5,7 +5,6 @@ RUN apt install maven -y\nRUN apt install git -y\nRUN apt install ant -y\n-COPY bundled-maven-dependencies/settings.xml /root/.m2/settings.xml\nCOPY bundled-maven-dependencies/pom.xml /bundled-maven-dependencies/pom.xml\nWORKDIR /bundled-maven-dependencies\nRUN mvn dependency:go-offline\n" }, { "change_type": "MODIFY", "old_path": "build.gradle", "new_path": "build.gradle", "diff": "@@ -150,9 +150,3 @@ subprojects {\ndescription = \"Cloud storage and web UI for MPS\"\ndefaultTasks 'assemble'\n-\n-def mavenSettingsTemplateFile = new File(new File(project.rootDir, \"bundled-maven-dependencies\"), \"settings-template.xml\").absoluteFile\n-def mavenSettingsFile = new File(new File(project.rootDir, \"bundled-maven-dependencies\"), \"settings.xml\").absoluteFile\n-mavenSettingsFile.text = mavenSettingsTemplateFile.text\n- .replace(\"{{username}}\", githubCredentials[0])\n- .replace(\"{{password}}\", githubCredentials[1])\n" }, { "change_type": "MODIFY", "old_path": "bundled-maven-dependencies/pom.xml", "new_path": "bundled-maven-dependencies/pom.xml", "diff": "<repositories>\n<repository>\n- <id>github.mbeddr</id>\n- <name>mbeddr on github</name>\n- <url>https://maven.pkg.github.com/mbeddr/mbeddr.core</url>\n- </repository>\n- <repository>\n- <id>github.mps-extensions</id>\n- <name>MPS-extensions on github</name>\n- <url>https://maven.pkg.github.com/JetBrains/MPS-extensions</url>\n- </repository>\n- <repository>\n- <id>github.iets3os</id>\n- <name>IETS3 opensource on github</name>\n- <url>https://maven.pkg.github.com/IETS3/iets3.opensource</url>\n+ <id>itemis</id>\n+ <name>itemis nexus</name>\n+ <url>https://artifacts.itemis.cloud/repository/maven-mps/</url>\n</repository>\n</repositories>\n<dependency>\n<groupId>de.itemis.mps</groupId>\n<artifactId>extensions</artifactId>\n- <version>2020.3.2227.715a7cf</version>\n+ <version>2020.3.2521.a974ce9</version>\n<type>zip</type>\n</dependency>\n<dependency>\n<groupId>com.mbeddr</groupId>\n<artifactId>platform</artifactId>\n- <version>2020.3.23153.87edbd6</version>\n+ <version>2020.3.23626.2804ee7</version>\n<type>zip</type>\n</dependency>\n<dependency>\n<groupId>com.mbeddr</groupId>\n<artifactId>mbeddr</artifactId>\n- <version>2020.3.23153.87edbd6</version>\n+ <version>2020.3.23527.2804ee7</version>\n<type>zip</type>\n</dependency>\n<dependency>\n<groupId>org.iets3</groupId>\n<artifactId>opensource</artifactId>\n- <version>2020.3.5345.a0a13f6</version>\n+ <version>2020.3.5830.a5def84</version>\n<type>zip</type>\n</dependency>\n</dependencies>\n" }, { "change_type": "DELETE", "old_path": "bundled-maven-dependencies/settings-template.xml", "new_path": null, "diff": "-<settings xmlns=\"http://maven.apache.org/SETTINGS/1.1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n- xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd\">\n- <servers>\n- <server>\n- <id>github.mbeddr</id>\n- <username>{{username}}</username>\n- <password>{{password}}</password>\n- </server>\n- <server>\n- <id>github.mps-extensions</id>\n- <username>{{username}}</username>\n- <password>{{password}}</password>\n- </server>\n- <server>\n- <id>github.iets3os</id>\n- <username>{{username}}</username>\n- <password>{{password}}</password>\n- </server>\n- </servers>\n-</settings>\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
bundled MPS libraries were still downloaded from github packages
426,496
03.02.2023 16:24:40
-3,600
4a09a7160149196ae66c32f060450be2135757be
fixed Dockerfile-workspace-manager
[ { "change_type": "MODIFY", "old_path": "Dockerfile-workspace-manager", "new_path": "Dockerfile-workspace-manager", "diff": "@@ -14,7 +14,6 @@ RUN mvn dependency:go-offline\nWORKDIR /root/.m2\nRUN find -iname \"*.repositories\" -exec rm -f {} \\;\nRUN find -iname \"*.sha1\" -exec rm -f {} \\;\n-RUN rm /root/.m2/settings.xml\nWORKDIR /workspace-manager/\nEXPOSE 28104\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
fixed Dockerfile-workspace-manager
426,496
06.02.2023 16:16:03
-3,600
4730c42a943d68a44667b0a46eb6537ac850e746
removed git4idea workaround The git4idea stubs solution didn't have a java facet, but this is fixed by now.
[ { "change_type": "MODIFY", "old_path": "mps/.mps/modules.xml", "new_path": "mps/.mps/modules.xml", "diff": "<modulePath path=\"$PROJECT_DIR$/org.modelix.ui.state/org.modelix.ui.state.mpl\" folder=\"ui\" />\n<modulePath path=\"$PROJECT_DIR$/org.modelix.ui.svg/org.modelix.ui.svg.msd\" folder=\"ui.image\" />\n<modulePath path=\"$PROJECT_DIR$/org.modelix.ui.svg/org.modelix.ui.svg.msd\" folder=\"ui.svg\" />\n- <modulePath path=\"$PROJECT_DIR$/solutions/org.modelix.git4idea.withJavaFacet/org.modelix.git4idea.withJavaFacet.msd\" folder=\"ui.diff\" />\n<modulePath path=\"$PROJECT_DIR$/test.org.modelix.model.mpsplugin/test.org.modelix.model.mpsplugin.msd\" folder=\"model\" />\n<modulePath path=\"$PROJECT_DIR$/test.org.modelix.ui.common/test.org.modelix.ui.common.msd\" folder=\"ui\" />\n</projectModules>\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.build/models/org.modelix.build.mps", "new_path": "mps/org.modelix.build/models/org.modelix.build.mps", "diff": "</node>\n</node>\n</node>\n- <node concept=\"1E1JtA\" id=\"5feEXm65$R7\" role=\"2G$12L\">\n- <property role=\"BnDLt\" value=\"true\" />\n- <property role=\"TrG5h\" value=\"org.modelix.git4idea.withJavaFacet\" />\n- <property role=\"3LESm3\" value=\"2d5cd737-852a-4885-95f3-b6f65b8b740d\" />\n- <node concept=\"398BVA\" id=\"5feEXm65_ns\" role=\"3LF7KH\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm65ACJ\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"solutions\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm65BgA\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.git4idea.withJavaFacet\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm65BSt\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.git4idea.withJavaFacet.msd\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"1BupzO\" id=\"5feEXm65Csj\" role=\"3bR31x\">\n- <property role=\"3ZfqAx\" value=\"models\" />\n- <property role=\"1Hdu6h\" value=\"true\" />\n- <property role=\"1HemKv\" value=\"true\" />\n- <node concept=\"3LXTmp\" id=\"5feEXm65Csk\" role=\"1HemKq\">\n- <node concept=\"398BVA\" id=\"5feEXm65Csa\" role=\"3LXTmr\">\n- <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm65Csb\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"solutions\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm65Csc\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"org.modelix.git4idea.withJavaFacet\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm65Csd\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"models\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"3qWCbU\" id=\"5feEXm65Csl\" role=\"3LXTna\">\n- <property role=\"3qWCbO\" value=\"**/*.mps, **/*.mpsr, **/.model\" />\n- </node>\n- </node>\n- </node>\n- <node concept=\"1SiIV0\" id=\"5feEXm67DTU\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"5feEXm67DTV\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"5feEXm67DTz\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"7gF2HTviNPb\" resolve=\"mps.home\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm67DT$\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"plugins\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm67DT_\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"git4idea\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm67DTA\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm67DTB\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"git4idea-rt.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"1SiIV0\" id=\"5feEXm67DUj\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"5feEXm67DUk\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"5feEXm67DTW\" role=\"1BurEY\">\n- <ref role=\"398BVh\" node=\"7gF2HTviNPb\" resolve=\"mps.home\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm67DTX\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"plugins\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm67DTY\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"git4idea\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm67DTZ\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"5feEXm67DU0\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"git4idea.jar\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"1SiIV0\" id=\"b16MWbMELi\" role=\"3bR37C\">\n- <node concept=\"3bR9La\" id=\"b16MWbMELj\" role=\"1SiIV1\">\n- <ref role=\"3bR37D\" to=\"ffeo:1ia2VB5guYy\" resolve=\"MPS.IDEA\" />\n- </node>\n- </node>\n- </node>\n<node concept=\"1E1JtA\" id=\"27MnIrahxUD\" role=\"2G$12L\">\n<property role=\"BnDLt\" value=\"true\" />\n<property role=\"TrG5h\" value=\"org.modelix.ui.diff\" />\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"5feEXm65D8n\" role=\"3bR37C\">\n- <node concept=\"3bR9La\" id=\"5feEXm65D8o\" role=\"1SiIV1\">\n- <ref role=\"3bR37D\" node=\"5feEXm65$R7\" resolve=\"org.modelix.git4idea.withJavaFacet\" />\n- </node>\n- </node>\n<node concept=\"1SiIV0\" id=\"7jrnksKCsxX\" role=\"3bR37C\">\n<node concept=\"3bR9La\" id=\"7jrnksKCsxY\" role=\"1SiIV1\">\n<ref role=\"3bR37D\" to=\"ffeo:1H905DlDUSw\" resolve=\"MPS.OpenAPI\" />\n<ref role=\"3bR37D\" to=\"ffeo:1TaHNgiIbJb\" resolve=\"MPS.Platform\" />\n</node>\n</node>\n+ <node concept=\"1SiIV0\" id=\"5qbHjZpHGPe\" role=\"3bR37C\">\n+ <node concept=\"3bR9La\" id=\"5qbHjZpHGPf\" role=\"1SiIV1\">\n+ <ref role=\"3bR37D\" to=\"ffeo:4wxeloVufXp\" resolve=\"jetbrains.mps.git4idea.stubs\" />\n+ </node>\n+ </node>\n</node>\n<node concept=\"1E1JtD\" id=\"eACOy0gz1M\" role=\"2G$12L\">\n<property role=\"BnDLt\" value=\"true\" />\n<node concept=\"3LEDTy\" id=\"7BujJjYSJ9v\" role=\"3LEDUa\">\n<ref role=\"3LEDTV\" node=\"7gF2HTviNPn\" resolve=\"org.modelix.ui.sm\" />\n</node>\n- <node concept=\"3LEDTy\" id=\"2j2Qp6EP64C\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KXW\" resolve=\"jetbrains.mps.lang.core\" />\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5u\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KYb\" resolve=\"jetbrains.mps.baseLanguage\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5v\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"90a9:4iIKqJTZ5Hg\" resolve=\"de.q60.mps.shadowmodels.gen.afterPF\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5w\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KZG\" resolve=\"jetbrains.mps.baseLanguage.closures\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5x\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L2F\" resolve=\"jetbrains.mps.baseLanguage.tuples\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5y\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"90a9:7c10t$7lQIA\" resolve=\"de.q60.mps.shadowmodels.gen.typesystem\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5z\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:14x5$qAUbkb\" resolve=\"jetbrains.mps.lang.access\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5$\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"90a9:2$QnGbtLXzL\" resolve=\"de.q60.mps.shadowmodels.gen.desugar\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5_\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L2l\" resolve=\"jetbrains.mps.baseLanguage.logging\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5A\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L4j\" resolve=\"jetbrains.mps.lang.actions\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5B\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"90a9:4iIKqJTZ5Hs\" resolve=\"de.q60.mps.polymorphicfunctions\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5C\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"90a9:4iIKqJTZ5HO\" resolve=\"de.q60.mps.shadowmodels.transformation\" />\n+ </node>\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5D\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L9O\" resolve=\"jetbrains.mps.lang.smodel\" />\n</node>\n- <node concept=\"3LEDTy\" id=\"2j2Qp6EP64D\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L9c\" resolve=\"jetbrains.mps.lang.quotation\" />\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5E\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6L0h\" resolve=\"jetbrains.mps.baseLanguage.collections\" />\n</node>\n- <node concept=\"3LEDTy\" id=\"2j2Qp6EP64E\" role=\"3LEDUa\">\n- <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KZc\" resolve=\"jetbrains.mps.baseLanguage.checkedDots\" />\n+ <node concept=\"3LEDTy\" id=\"5qbHjZpHH5F\" role=\"3LEDUa\">\n+ <ref role=\"3LEDTV\" to=\"ffeo:7Kfy9QB6KZ0\" resolve=\"jetbrains.mps.baseLanguageInternal\" />\n</node>\n</node>\n<node concept=\"1E1JtD\" id=\"7BujJjXYVmv\" role=\"2G$12L\">\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.ui.diff/models/org.modelix.ui.diff.mps", "new_path": "mps/org.modelix.ui.diff/models/org.modelix.ui.diff.mps", "diff": "<import index=\"opgt\" ref=\"fc3c2aa8-0d4b-463f-a774-40d450aa04a0/java:javax.servlet(org.modelix.jetty/)\" />\n<import index=\"exr9\" ref=\"1ed103c3-3aa6-49b7-9c21-6765ee11f224/java:jetbrains.mps.nodeEditor(MPS.Editor/)\" />\n<import index=\"7g4e\" ref=\"498d89d2-c2e9-11e2-ad49-6cf049e62fe5/java:com.intellij.vcsUtil(MPS.IDEA/)\" />\n- <import index=\"5mlj\" ref=\"2d5cd737-852a-4885-95f3-b6f65b8b740d/java:git4idea.repo(org.modelix.git4idea.withJavaFacet/)\" />\n- <import index=\"hr4p\" ref=\"2d5cd737-852a-4885-95f3-b6f65b8b740d/java:git4idea(org.modelix.git4idea.withJavaFacet/)\" />\n- <import index=\"m8n3\" ref=\"2d5cd737-852a-4885-95f3-b6f65b8b740d/java:git4idea.history(org.modelix.git4idea.withJavaFacet/)\" />\n- <import index=\"oy9a\" ref=\"2d5cd737-852a-4885-95f3-b6f65b8b740d/java:git4idea.changes(org.modelix.git4idea.withJavaFacet/)\" />\n<import index=\"fvx8\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:sun.awt(JDK/)\" />\n<import index=\"l2n2\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.awt.peer(JDK/)\" />\n<import index=\"hyam\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.awt.event(JDK/)\" />\n<import index=\"z1c3\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.project(MPS.Core/)\" />\n<import index=\"3ju5\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.vfs(MPS.Core/)\" />\n<import index=\"z1c4\" ref=\"742f6602-5a2f-4313-aa6e-ae1cd4ffdc61/java:jetbrains.mps.project(MPS.Platform/)\" />\n+ <import index=\"mrnd\" ref=\"f57286e3-4e19-4d8d-8045-3900761f6530/java:git4idea.history.browser(jetbrains.mps.git4idea.stubs/)\" />\n+ <import index=\"oy9a\" ref=\"f57286e3-4e19-4d8d-8045-3900761f6530/java:git4idea.changes(jetbrains.mps.git4idea.stubs/)\" />\n+ <import index=\"5mlj\" ref=\"f57286e3-4e19-4d8d-8045-3900761f6530/java:git4idea.repo(jetbrains.mps.git4idea.stubs/)\" />\n+ <import index=\"hr4p\" ref=\"f57286e3-4e19-4d8d-8045-3900761f6530/java:git4idea(jetbrains.mps.git4idea.stubs/)\" />\n+ <import index=\"m8n3\" ref=\"f57286e3-4e19-4d8d-8045-3900761f6530/java:git4idea.history(jetbrains.mps.git4idea.stubs/)\" />\n<import index=\"fglx\" ref=\"498d89d2-c2e9-11e2-ad49-6cf049e62fe5/java:com.intellij.openapi.fileTypes(MPS.IDEA/)\" implicit=\"true\" />\n</imports>\n<registry>\n</node>\n</node>\n<node concept=\"2YIFZM\" id=\"b16MWbL_Pn\" role=\"33vP2m\">\n- <ref role=\"37wK5l\" to=\"m8n3:~GitHistoryUtils.history(com.intellij.openapi.project.Project,com.intellij.openapi.vfs.VirtualFile,java.lang.String...)\" resolve=\"history\" />\n<ref role=\"1Pybhc\" to=\"m8n3:~GitHistoryUtils\" resolve=\"GitHistoryUtils\" />\n+ <ref role=\"37wK5l\" to=\"m8n3:~GitHistoryUtils.history(com.intellij.openapi.project.Project,com.intellij.openapi.vfs.VirtualFile,java.lang.String...)\" resolve=\"history\" />\n<node concept=\"37vLTw\" id=\"b16MWbL_Po\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"4kPMkltJPHc\" resolve=\"project\" />\n</node>\n<node concept=\"3clFbS\" id=\"7jrnksK$g2t\" role=\"1zxBo7\">\n<node concept=\"3clFbF\" id=\"7jrnksK$ioO\" role=\"3cqZAp\">\n<node concept=\"2YIFZM\" id=\"7jrnksK$iHf\" role=\"3clFbG\">\n- <ref role=\"37wK5l\" to=\"oy9a:~GitChangeUtils.resolveReference(com.intellij.openapi.project.Project,com.intellij.openapi.vfs.VirtualFile,java.lang.String)\" resolve=\"resolveReference\" />\n<ref role=\"1Pybhc\" to=\"oy9a:~GitChangeUtils\" resolve=\"GitChangeUtils\" />\n+ <ref role=\"37wK5l\" to=\"oy9a:~GitChangeUtils.resolveReference(com.intellij.openapi.project.Project,com.intellij.openapi.vfs.VirtualFile,java.lang.String)\" resolve=\"resolveReference\" />\n<node concept=\"37vLTw\" id=\"7jrnksK$ja9\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"4kPMkltJPHc\" resolve=\"project\" />\n</node>\n</node>\n<node concept=\"3clFbF\" id=\"7jrnksK$rL0\" role=\"3cqZAp\">\n<node concept=\"2YIFZM\" id=\"7jrnksK$rL1\" role=\"3clFbG\">\n- <ref role=\"37wK5l\" to=\"oy9a:~GitChangeUtils.resolveReference(com.intellij.openapi.project.Project,com.intellij.openapi.vfs.VirtualFile,java.lang.String)\" resolve=\"resolveReference\" />\n<ref role=\"1Pybhc\" to=\"oy9a:~GitChangeUtils\" resolve=\"GitChangeUtils\" />\n+ <ref role=\"37wK5l\" to=\"oy9a:~GitChangeUtils.resolveReference(com.intellij.openapi.project.Project,com.intellij.openapi.vfs.VirtualFile,java.lang.String)\" resolve=\"resolveReference\" />\n<node concept=\"37vLTw\" id=\"7jrnksK$rL2\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"4kPMkltJPHc\" resolve=\"project\" />\n</node>\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.ui.diff/org.modelix.ui.diff.msd", "new_path": "mps/org.modelix.ui.diff/org.modelix.ui.diff.msd", "diff": "<dependency reexport=\"false\">6fd1293f-7f65-4ffd-99dc-4719eca7c171(jetbrains.mps.ide.vcs.platform)</dependency>\n<dependency reexport=\"false\">6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)</dependency>\n<dependency reexport=\"false\">fc3c2aa8-0d4b-463f-a774-40d450aa04a0(org.modelix.jetty)</dependency>\n- <dependency reexport=\"false\">2d5cd737-852a-4885-95f3-b6f65b8b740d(org.modelix.git4idea.withJavaFacet)</dependency>\n<dependency reexport=\"false\">8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)</dependency>\n<dependency reexport=\"false\">742f6602-5a2f-4313-aa6e-ae1cd4ffdc61(MPS.Platform)</dependency>\n+ <dependency reexport=\"false\">f57286e3-4e19-4d8d-8045-3900761f6530(jetbrains.mps.git4idea.stubs)</dependency>\n</dependencies>\n<languageVersions>\n<language slang=\"l:654422bf-e75f-44dc-936d-188890a746ce:de.slisson.mps.reflection\" version=\"0\" />\n<module reference=\"498d89d2-c2e9-11e2-ad49-6cf049e62fe5(MPS.IDEA)\" version=\"0\" />\n<module reference=\"8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)\" version=\"0\" />\n<module reference=\"742f6602-5a2f-4313-aa6e-ae1cd4ffdc61(MPS.Platform)\" version=\"0\" />\n+ <module reference=\"f57286e3-4e19-4d8d-8045-3900761f6530(jetbrains.mps.git4idea.stubs)\" version=\"0\" />\n<module reference=\"6fd1293f-7f65-4ffd-99dc-4719eca7c171(jetbrains.mps.ide.vcs.platform)\" version=\"0\" />\n<module reference=\"9e98f4e2-decf-4e97-bf80-9109e8b759aa(jetbrains.mps.lang.feedback.context)\" version=\"0\" />\n- <module reference=\"2d5cd737-852a-4885-95f3-b6f65b8b740d(org.modelix.git4idea.withJavaFacet)\" version=\"0\" />\n<module reference=\"fc3c2aa8-0d4b-463f-a774-40d450aa04a0(org.modelix.jetty)\" version=\"0\" />\n<module reference=\"25f5c7b1-6312-4074-a012-654b813b8083(org.modelix.ui.diff)\" version=\"0\" />\n</dependencyVersions>\n" }, { "change_type": "DELETE", "old_path": "mps/solutions/org.modelix.git4idea.withJavaFacet/org.modelix.git4idea.withJavaFacet.msd", "new_path": null, "diff": "-<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<solution name=\"org.modelix.git4idea.withJavaFacet\" uuid=\"2d5cd737-852a-4885-95f3-b6f65b8b740d\" moduleVersion=\"0\" pluginKind=\"PLUGIN_OTHER\" compileInMPS=\"true\">\n- <models>\n- <modelRoot contentPath=\"${module}\" type=\"default\">\n- <sourceRoot location=\"models\" />\n- </modelRoot>\n- <modelRoot contentPath=\"${mps_home}/plugins/git4idea/lib\" type=\"java_classes\">\n- <sourceRoot location=\"git4idea-rt.jar\" />\n- <sourceRoot location=\"git4idea.jar\" />\n- </modelRoot>\n- </models>\n- <facets>\n- <facet type=\"java\" languageLevel=\"JAVA_8\">\n- <classes generated=\"true\" path=\"${module}/classes_gen\" />\n- </facet>\n- <facet pluginId=\"Git4Idea\" type=\"ideaPlugin\" />\n- </facets>\n- <stubModelEntries>\n- <stubModelEntry path=\"${mps_home}/plugins/git4idea/lib/git4idea-rt.jar\" />\n- <stubModelEntry path=\"${mps_home}/plugins/git4idea/lib/git4idea.jar\" />\n- </stubModelEntries>\n- <sourcePath />\n- <dependencies>\n- <dependency reexport=\"false\">498d89d2-c2e9-11e2-ad49-6cf049e62fe5(MPS.IDEA)</dependency>\n- </dependencies>\n- <languageVersions>\n- <language slang=\"l:f3061a53-9226-4cc5-a443-f952ceaf5816:jetbrains.mps.baseLanguage\" version=\"11\" />\n- <language slang=\"l:f2801650-65d5-424e-bb1b-463a8781b786:jetbrains.mps.baseLanguage.javadoc\" version=\"2\" />\n- <language slang=\"l:ceab5195-25ea-4f22-9b92-103b95ca8c0c:jetbrains.mps.lang.core\" version=\"2\" />\n- <language slang=\"l:9ded098b-ad6a-4657-bfd9-48636cfe8bc3:jetbrains.mps.lang.traceable\" version=\"0\" />\n- </languageVersions>\n- <dependencyVersions>\n- <module reference=\"3f233e7f-b8a6-46d2-a57f-795d56775243(Annotations)\" version=\"0\" />\n- <module reference=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)\" version=\"0\" />\n- <module reference=\"498d89d2-c2e9-11e2-ad49-6cf049e62fe5(MPS.IDEA)\" version=\"0\" />\n- <module reference=\"2d5cd737-852a-4885-95f3-b6f65b8b740d(org.modelix.git4idea.withJavaFacet)\" version=\"0\" />\n- </dependencyVersions>\n-</solution>\n-\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
removed git4idea workaround The git4idea stubs solution didn't have a java facet, but this is fixed by now.
426,496
06.02.2023 16:52:55
-3,600
50c03484212886ef61328064b2a1192f162545ad
Unit test for diff image rendering
[ { "change_type": "MODIFY", "old_path": "mps/org.modelix.build/models/org.modelix.build.mps", "new_path": "mps/org.modelix.build/models/org.modelix.build.mps", "diff": "<property role=\"BnDLt\" value=\"true\" />\n<property role=\"TrG5h\" value=\"org.modelix.ui.diff\" />\n<property role=\"3LESm3\" value=\"25f5c7b1-6312-4074-a012-654b813b8083\" />\n+ <property role=\"aoJFB\" value=\"eYcmk9QOlj/sources_and_tests\" />\n<node concept=\"398BVA\" id=\"27MnIrahymz\" role=\"3LF7KH\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"modelix.modules\" />\n<node concept=\"2Ry0Ak\" id=\"27MnIrahyRF\" role=\"iGT6I\">\n<node concept=\"22LTRM\" id=\"6w3CrGw0IB8\" role=\"22LTRK\">\n<ref role=\"22LTRN\" node=\"6w3CrGw0I_A\" resolve=\"test.org.modelix.ui.common\" />\n</node>\n+ <node concept=\"22LTRM\" id=\"5qbHjZpNHt8\" role=\"22LTRK\">\n+ <ref role=\"22LTRN\" node=\"27MnIrahxUD\" resolve=\"org.modelix.ui.diff\" />\n+ </node>\n<node concept=\"24cAiW\" id=\"1yReInEzbz\" role=\"24cAkG\" />\n</node>\n</node>\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.ui.diff/models/org.modelix.ui.diff.mps", "new_path": "mps/org.modelix.ui.diff/models/org.modelix.ui.diff.mps", "diff": "<use id=\"654422bf-e75f-44dc-936d-188890a746ce\" name=\"de.slisson.mps.reflection\" version=\"0\" />\n<use id=\"63650c59-16c8-498a-99c8-005c7ee9515d\" name=\"jetbrains.mps.lang.access\" version=\"0\" />\n<use id=\"774bf8a0-62e5-41e1-af63-f4812e60e48b\" name=\"jetbrains.mps.baseLanguage.checkedDots\" version=\"0\" />\n+ <use id=\"5dc5fc0d-37ef-4782-8192-8b5ce1f69f80\" name=\"jetbrains.mps.baseLanguage.extensionMethods\" version=\"0\" />\n<devkit ref=\"fbc25dd2-5da4-483a-8b19-70928e1b62d7(jetbrains.mps.devkit.general-purpose)\" />\n</languages>\n<imports>\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbJ\" id=\"5qbHjZpM7e3\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"5qbHjZpM7e5\" role=\"3clFbx\">\n+ <node concept=\"3SKdUt\" id=\"5qbHjZpMiwt\" role=\"3cqZAp\">\n+ <node concept=\"1PaTwC\" id=\"5qbHjZpMiwu\" role=\"1aUNEU\">\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMiwv\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"Images\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnrB\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"are\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnrE\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"rendered\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnsy\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"on\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMntV\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"the\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnt1\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"EDT.\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnuQ\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"Waiting\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnvM\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"for\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnvV\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"the\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnw5\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"future\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnwE\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"will\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnxg\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"result\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnxR\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"in\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnyv\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"a\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnyI\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"deadlock\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMn$c\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"if\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMn$R\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"its\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMn_X\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"executed\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"5qbHjZpMnB4\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"async.\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3J1_TO\" id=\"5qbHjZpMc5t\" role=\"3cqZAp\">\n+ <node concept=\"3uVAMA\" id=\"5qbHjZpMc5u\" role=\"1zxBo5\">\n+ <node concept=\"XOnhg\" id=\"5qbHjZpMc5v\" role=\"1zc67B\">\n+ <property role=\"TrG5h\" value=\"ex\" />\n+ <node concept=\"nSUau\" id=\"5qbHjZpMc5w\" role=\"1tU5fm\">\n+ <node concept=\"3uibUv\" id=\"5qbHjZpMc5x\" role=\"nSUat\">\n+ <ref role=\"3uigEE\" to=\"wyt6:~Throwable\" resolve=\"Throwable\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"5qbHjZpMc5y\" role=\"1zc67A\">\n+ <node concept=\"3clFbF\" id=\"5qbHjZpMc5z\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5qbHjZpMc5$\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5qbHjZpMc5_\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"2XovqnGZF2f\" resolve=\"result\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5qbHjZpMc5A\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"ixe9:~FutureResult.setException(java.lang.Throwable)\" resolve=\"setException\" />\n+ <node concept=\"37vLTw\" id=\"5qbHjZpMc5B\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5qbHjZpMc5v\" resolve=\"ex\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"5qbHjZpMc5C\" role=\"1zxBo7\">\n+ <node concept=\"3clFbF\" id=\"5qbHjZpMc5D\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5qbHjZpMc5E\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5qbHjZpMc5F\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"2XovqnGZF2f\" resolve=\"result\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5qbHjZpMc5G\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"ixe9:~FutureResult.set(java.lang.Object)\" resolve=\"set\" />\n+ <node concept=\"2OqwBi\" id=\"5qbHjZpMc5H\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"5qbHjZpMc5I\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"2XovqnGZw5t\" resolve=\"c\" />\n+ </node>\n+ <node concept=\"1Bd96e\" id=\"5qbHjZpMc5J\" role=\"2OqNvi\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2YIFZM\" id=\"5qbHjZpMbZo\" role=\"3clFbw\">\n+ <ref role=\"37wK5l\" to=\"3a50:~ThreadUtils.isInEDT()\" resolve=\"isInEDT\" />\n+ <ref role=\"1Pybhc\" to=\"3a50:~ThreadUtils\" resolve=\"ThreadUtils\" />\n+ </node>\n+ <node concept=\"9aQIb\" id=\"5qbHjZpMdKX\" role=\"9aQIa\">\n+ <node concept=\"3clFbS\" id=\"5qbHjZpMdKY\" role=\"9aQI4\">\n<node concept=\"3clFbF\" id=\"2XovqnGZDhi\" role=\"3cqZAp\">\n<node concept=\"2OqwBi\" id=\"2XovqnGZDB8\" role=\"3clFbG\">\n<node concept=\"2YIFZM\" id=\"2XovqnGZDhS\" role=\"2Oq$k0\">\n</node>\n</node>\n</node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3cpWs6\" id=\"2XovqnGZJWD\" role=\"3cqZAp\">\n<node concept=\"37vLTw\" id=\"2XovqnGZK4L\" role=\"3cqZAk\">\n<ref role=\"3cqZAo\" node=\"2XovqnGZF2f\" resolve=\"result\" />\n<node concept=\"2OqwBi\" id=\"2XovqnGJbrk\" role=\"2GsD0m\">\n<node concept=\"2OqwBi\" id=\"2XovqnGES99\" role=\"2Oq$k0\">\n<node concept=\"1rXfSq\" id=\"2XovqnGEQgR\" role=\"2Oq$k0\">\n- <ref role=\"37wK5l\" node=\"27MnIra4oou\" resolve=\"futureGet\" />\n+ <ref role=\"37wK5l\" node=\"5qbHjZpKv8N\" resolve=\"futureGet\" />\n<node concept=\"37vLTw\" id=\"2XovqnGX$7n\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"2XovqnGVaFY\" resolve=\"images\" />\n</node>\n<node concept=\"3clFbS\" id=\"2XovqnGETRM\" role=\"1bW5cS\">\n<node concept=\"3clFbF\" id=\"2XovqnGEVzd\" role=\"3cqZAp\">\n<node concept=\"1rXfSq\" id=\"2XovqnGEVzc\" role=\"3clFbG\">\n- <ref role=\"37wK5l\" node=\"27MnIra4oou\" resolve=\"futureGet\" />\n+ <ref role=\"37wK5l\" node=\"5qbHjZpKv8N\" resolve=\"futureGet\" />\n<node concept=\"37vLTw\" id=\"2XovqnGEWHi\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"2XovqnGETRN\" resolve=\"it\" />\n</node>\n<node concept=\"3clFbS\" id=\"2XovqnGJjZL\" role=\"1bW5cS\">\n<node concept=\"3clFbF\" id=\"2XovqnGJjZM\" role=\"3cqZAp\">\n<node concept=\"1rXfSq\" id=\"2XovqnGJjZN\" role=\"3clFbG\">\n- <ref role=\"37wK5l\" node=\"27MnIra4oou\" resolve=\"futureGet\" />\n+ <ref role=\"37wK5l\" node=\"5qbHjZpKv8N\" resolve=\"futureGet\" />\n<node concept=\"37vLTw\" id=\"2XovqnGJjZO\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"2XovqnGJjZP\" resolve=\"it\" />\n</node>\n<node concept=\"2OqwBi\" id=\"2XovqnGJoEb\" role=\"2Oq$k0\">\n<node concept=\"2OqwBi\" id=\"2XovqnGFvfF\" role=\"2Oq$k0\">\n<node concept=\"1rXfSq\" id=\"2XovqnGFsiY\" role=\"2Oq$k0\">\n- <ref role=\"37wK5l\" node=\"27MnIra4oou\" resolve=\"futureGet\" />\n+ <ref role=\"37wK5l\" node=\"5qbHjZpKv8N\" resolve=\"futureGet\" />\n<node concept=\"37vLTw\" id=\"2XovqnGX_N5\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"2XovqnGVaFY\" resolve=\"images\" />\n</node>\n<node concept=\"3clFbS\" id=\"2XovqnGFwFm\" role=\"1bW5cS\">\n<node concept=\"3clFbF\" id=\"2XovqnGFx_8\" role=\"3cqZAp\">\n<node concept=\"1rXfSq\" id=\"2XovqnGFx_7\" role=\"3clFbG\">\n- <ref role=\"37wK5l\" node=\"27MnIra4oou\" resolve=\"futureGet\" />\n+ <ref role=\"37wK5l\" node=\"5qbHjZpKv8N\" resolve=\"futureGet\" />\n<node concept=\"37vLTw\" id=\"2XovqnGFyXz\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"2XovqnGFwFn\" resolve=\"it\" />\n</node>\n<node concept=\"3clFbS\" id=\"2XovqnGJr4y\" role=\"1bW5cS\">\n<node concept=\"3clFbF\" id=\"2XovqnGJsqh\" role=\"3cqZAp\">\n<node concept=\"1rXfSq\" id=\"2XovqnGJsqg\" role=\"3clFbG\">\n- <ref role=\"37wK5l\" node=\"27MnIra4oou\" resolve=\"futureGet\" />\n+ <ref role=\"37wK5l\" node=\"5qbHjZpKv8N\" resolve=\"futureGet\" />\n<node concept=\"37vLTw\" id=\"2XovqnGJv42\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"2XovqnGJr4z\" resolve=\"it\" />\n</node>\n</node>\n</node>\n<node concept=\"2tJIrI\" id=\"27MnIra3HRd\" role=\"jymVt\" />\n- <node concept=\"3clFb_\" id=\"27MnIra4oou\" role=\"jymVt\">\n+ <node concept=\"2YIFZL\" id=\"5qbHjZpKv8N\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"futureGet\" />\n- <node concept=\"37vLTG\" id=\"27MnIra4pvq\" role=\"3clF46\">\n- <property role=\"TrG5h\" value=\"future\" />\n- <node concept=\"3uibUv\" id=\"27MnIra4q2u\" role=\"1tU5fm\">\n- <ref role=\"3uigEE\" to=\"5zyv:~Future\" resolve=\"Future\" />\n- <node concept=\"16syzq\" id=\"27MnIra4qIo\" role=\"11_B2D\">\n- <ref role=\"16sUi3\" node=\"27MnIra4q3g\" resolve=\"T\" />\n- </node>\n- </node>\n- </node>\n- <node concept=\"16syzq\" id=\"27MnIra4qQO\" role=\"3clF45\">\n- <ref role=\"16sUi3\" node=\"27MnIra4q3g\" resolve=\"T\" />\n- </node>\n- <node concept=\"3Tm1VV\" id=\"27MnIra4oox\" role=\"1B3o_S\" />\n<node concept=\"3clFbS\" id=\"27MnIra4ooy\" role=\"3clF47\">\n<node concept=\"3J1_TO\" id=\"27MnIra4utx\" role=\"3cqZAp\">\n<node concept=\"3clFbS\" id=\"27MnIra4uty\" role=\"1zxBo7\">\n</node>\n</node>\n</node>\n+ <node concept=\"37vLTG\" id=\"27MnIra4pvq\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"future\" />\n+ <node concept=\"3uibUv\" id=\"27MnIra4q2u\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"5zyv:~Future\" resolve=\"Future\" />\n+ <node concept=\"16syzq\" id=\"27MnIra4qIo\" role=\"11_B2D\">\n+ <ref role=\"16sUi3\" node=\"27MnIra4q3g\" resolve=\"T\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"16syzq\" id=\"27MnIra4qQO\" role=\"3clF45\">\n+ <ref role=\"16sUi3\" node=\"27MnIra4q3g\" resolve=\"T\" />\n+ </node>\n<node concept=\"16euLQ\" id=\"27MnIra4q3g\" role=\"16eVyc\">\n<property role=\"TrG5h\" value=\"T\" />\n</node>\n+ <node concept=\"3Tm1VV\" id=\"27MnIra4oox\" role=\"1B3o_S\" />\n</node>\n<node concept=\"3Tm1VV\" id=\"27MnIra3H8U\" role=\"1B3o_S\" />\n<node concept=\"3uibUv\" id=\"27MnIra3HfJ\" role=\"1zkMxy\">\n" }, { "change_type": "ADD", "old_path": null, "new_path": "mps/org.modelix.ui.diff/models/[email protected]", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<model ref=\"r:af27d5f7-cdc0-46a0-9e1c-a19e86f516d6(test.org.modelix.ui.diff@tests)\">\n+ <persistence version=\"9\" />\n+ <languages>\n+ <use id=\"8585453e-6bfb-4d80-98de-b16074f1d86c\" name=\"jetbrains.mps.lang.test\" version=\"5\" />\n+ <use id=\"f61473f9-130f-42f6-b98d-6c438812c2f6\" name=\"jetbrains.mps.baseLanguage.unitTest\" version=\"1\" />\n+ <devkit ref=\"fbc25dd2-5da4-483a-8b19-70928e1b62d7(jetbrains.mps.devkit.general-purpose)\" />\n+ </languages>\n+ <imports>\n+ <import index=\"lvkz\" ref=\"r:ab9ceea2-f32a-4ea6-be78-3e6c2d4ef84b(org.modelix.ui.diff)\" />\n+ <import index=\"5zyv\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.util.concurrent(JDK/)\" />\n+ </imports>\n+ <registry>\n+ <language id=\"8585453e-6bfb-4d80-98de-b16074f1d86c\" name=\"jetbrains.mps.lang.test\">\n+ <concept id=\"5097124989038916362\" name=\"jetbrains.mps.lang.test.structure.TestInfo\" flags=\"ng\" index=\"2XOHcx\">\n+ <property id=\"5097124989038916363\" name=\"projectPath\" index=\"2XOHcw\" />\n+ </concept>\n+ <concept id=\"1216913645126\" name=\"jetbrains.mps.lang.test.structure.NodesTestCase\" flags=\"lg\" index=\"1lH9Xt\">\n+ <child id=\"1217501895093\" name=\"testMethods\" index=\"1SL9yI\" />\n+ </concept>\n+ <concept id=\"1225978065297\" name=\"jetbrains.mps.lang.test.structure.SimpleNodeTest\" flags=\"ng\" index=\"1LZb2c\" />\n+ </language>\n+ <language id=\"f3061a53-9226-4cc5-a443-f952ceaf5816\" name=\"jetbrains.mps.baseLanguage\">\n+ <concept id=\"4836112446988635817\" name=\"jetbrains.mps.baseLanguage.structure.UndefinedType\" flags=\"in\" index=\"2jxLKc\" />\n+ <concept id=\"1202948039474\" name=\"jetbrains.mps.baseLanguage.structure.InstanceMethodCallOperation\" flags=\"nn\" index=\"liA8E\" />\n+ <concept id=\"1197027756228\" name=\"jetbrains.mps.baseLanguage.structure.DotExpression\" flags=\"nn\" index=\"2OqwBi\">\n+ <child id=\"1197027771414\" name=\"operand\" index=\"2Oq$k0\" />\n+ <child id=\"1197027833540\" name=\"operation\" index=\"2OqNvi\" />\n+ </concept>\n+ <concept id=\"1145552977093\" name=\"jetbrains.mps.baseLanguage.structure.GenericNewExpression\" flags=\"nn\" index=\"2ShNRf\">\n+ <child id=\"1145553007750\" name=\"creator\" index=\"2ShVmc\" />\n+ </concept>\n+ <concept id=\"1070475926800\" name=\"jetbrains.mps.baseLanguage.structure.StringLiteral\" flags=\"nn\" index=\"Xl_RD\">\n+ <property id=\"1070475926801\" name=\"value\" index=\"Xl_RC\" />\n+ </concept>\n+ <concept id=\"1081236700937\" name=\"jetbrains.mps.baseLanguage.structure.StaticMethodCall\" flags=\"nn\" index=\"2YIFZM\">\n+ <reference id=\"1144433194310\" name=\"classConcept\" index=\"1Pybhc\" />\n+ </concept>\n+ <concept id=\"1068431474542\" name=\"jetbrains.mps.baseLanguage.structure.VariableDeclaration\" flags=\"ng\" index=\"33uBYm\">\n+ <child id=\"1068431790190\" name=\"initializer\" index=\"33vP2m\" />\n+ </concept>\n+ <concept id=\"1068498886296\" name=\"jetbrains.mps.baseLanguage.structure.VariableReference\" flags=\"nn\" index=\"37vLTw\">\n+ <reference id=\"1068581517664\" name=\"variableDeclaration\" index=\"3cqZAo\" />\n+ </concept>\n+ <concept id=\"4972933694980447171\" name=\"jetbrains.mps.baseLanguage.structure.BaseVariableDeclaration\" flags=\"ng\" index=\"19Szcq\">\n+ <child id=\"5680397130376446158\" name=\"type\" index=\"1tU5fm\" />\n+ </concept>\n+ <concept id=\"1068580123132\" name=\"jetbrains.mps.baseLanguage.structure.BaseMethodDeclaration\" flags=\"ng\" index=\"3clF44\">\n+ <child id=\"1068580123133\" name=\"returnType\" index=\"3clF45\" />\n+ <child id=\"1068580123135\" name=\"body\" index=\"3clF47\" />\n+ </concept>\n+ <concept id=\"1068580123155\" name=\"jetbrains.mps.baseLanguage.structure.ExpressionStatement\" flags=\"nn\" index=\"3clFbF\">\n+ <child id=\"1068580123156\" name=\"expression\" index=\"3clFbG\" />\n+ </concept>\n+ <concept id=\"1068580123157\" name=\"jetbrains.mps.baseLanguage.structure.Statement\" flags=\"nn\" index=\"3clFbH\" />\n+ <concept id=\"1068580123136\" name=\"jetbrains.mps.baseLanguage.structure.StatementList\" flags=\"sn\" stub=\"5293379017992965193\" index=\"3clFbS\">\n+ <child id=\"1068581517665\" name=\"statement\" index=\"3cqZAp\" />\n+ </concept>\n+ <concept id=\"1068580320020\" name=\"jetbrains.mps.baseLanguage.structure.IntegerConstant\" flags=\"nn\" index=\"3cmrfG\">\n+ <property id=\"1068580320021\" name=\"value\" index=\"3cmrfH\" />\n+ </concept>\n+ <concept id=\"1068581242864\" name=\"jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement\" flags=\"nn\" index=\"3cpWs8\">\n+ <child id=\"1068581242865\" name=\"localVariableDeclaration\" index=\"3cpWs9\" />\n+ </concept>\n+ <concept id=\"1068581242863\" name=\"jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration\" flags=\"nr\" index=\"3cpWsn\" />\n+ <concept id=\"1068581517677\" name=\"jetbrains.mps.baseLanguage.structure.VoidType\" flags=\"in\" index=\"3cqZAl\" />\n+ <concept id=\"1204053956946\" name=\"jetbrains.mps.baseLanguage.structure.IMethodCall\" flags=\"ng\" index=\"1ndlxa\">\n+ <reference id=\"1068499141037\" name=\"baseMethodDeclaration\" index=\"37wK5l\" />\n+ <child id=\"1068499141038\" name=\"actualArgument\" index=\"37wK5m\" />\n+ </concept>\n+ <concept id=\"1212685548494\" name=\"jetbrains.mps.baseLanguage.structure.ClassCreator\" flags=\"nn\" index=\"1pGfFk\" />\n+ <concept id=\"1107535904670\" name=\"jetbrains.mps.baseLanguage.structure.ClassifierType\" flags=\"in\" index=\"3uibUv\">\n+ <reference id=\"1107535924139\" name=\"classifier\" index=\"3uigEE\" />\n+ <child id=\"1109201940907\" name=\"parameter\" index=\"11_B2D\" />\n+ </concept>\n+ </language>\n+ <language id=\"fd392034-7849-419d-9071-12563d152375\" name=\"jetbrains.mps.baseLanguage.closures\">\n+ <concept id=\"1199569711397\" name=\"jetbrains.mps.baseLanguage.closures.structure.ClosureLiteral\" flags=\"nn\" index=\"1bVj0M\">\n+ <child id=\"1199569906740\" name=\"parameter\" index=\"1bW2Oz\" />\n+ <child id=\"1199569916463\" name=\"body\" index=\"1bW5cS\" />\n+ </concept>\n+ </language>\n+ <language id=\"f61473f9-130f-42f6-b98d-6c438812c2f6\" name=\"jetbrains.mps.baseLanguage.unitTest\">\n+ <concept id=\"8427750732757990717\" name=\"jetbrains.mps.baseLanguage.unitTest.structure.BinaryAssert\" flags=\"nn\" index=\"3tpDYu\">\n+ <child id=\"8427750732757990725\" name=\"actual\" index=\"3tpDZA\" />\n+ <child id=\"8427750732757990724\" name=\"expected\" index=\"3tpDZB\" />\n+ </concept>\n+ <concept id=\"1171978097730\" name=\"jetbrains.mps.baseLanguage.unitTest.structure.AssertEquals\" flags=\"nn\" index=\"3vlDli\" />\n+ </language>\n+ <language id=\"ceab5195-25ea-4f22-9b92-103b95ca8c0c\" name=\"jetbrains.mps.lang.core\">\n+ <concept id=\"1169194658468\" name=\"jetbrains.mps.lang.core.structure.INamedConcept\" flags=\"ng\" index=\"TrEIO\">\n+ <property id=\"1169194664001\" name=\"name\" index=\"TrG5h\" />\n+ </concept>\n+ </language>\n+ <language id=\"83888646-71ce-4f1c-9c53-c54016f6ad4f\" name=\"jetbrains.mps.baseLanguage.collections\">\n+ <concept id=\"1204796164442\" name=\"jetbrains.mps.baseLanguage.collections.structure.InternalSequenceOperation\" flags=\"nn\" index=\"23sCx2\">\n+ <child id=\"1204796294226\" name=\"closure\" index=\"23t8la\" />\n+ </concept>\n+ <concept id=\"1151688443754\" name=\"jetbrains.mps.baseLanguage.collections.structure.ListType\" flags=\"in\" index=\"_YKpA\">\n+ <child id=\"1151688676805\" name=\"elementType\" index=\"_ZDj9\" />\n+ </concept>\n+ <concept id=\"1151702311717\" name=\"jetbrains.mps.baseLanguage.collections.structure.ToListOperation\" flags=\"nn\" index=\"ANE8D\" />\n+ <concept id=\"1203518072036\" name=\"jetbrains.mps.baseLanguage.collections.structure.SmartClosureParameterDeclaration\" flags=\"ig\" index=\"Rh6nW\" />\n+ <concept id=\"1162935959151\" name=\"jetbrains.mps.baseLanguage.collections.structure.GetSizeOperation\" flags=\"nn\" index=\"34oBXx\" />\n+ <concept id=\"1201792049884\" name=\"jetbrains.mps.baseLanguage.collections.structure.TranslateOperation\" flags=\"nn\" index=\"3goQfb\" />\n+ <concept id=\"1202128969694\" name=\"jetbrains.mps.baseLanguage.collections.structure.SelectOperation\" flags=\"nn\" index=\"3$u5V9\" />\n+ </language>\n+ </registry>\n+ <node concept=\"1lH9Xt\" id=\"5qbHjZpIBlo\">\n+ <property role=\"TrG5h\" value=\"HeadlessDiffImageTest\" />\n+ <node concept=\"1LZb2c\" id=\"5qbHjZpIBmJ\" role=\"1SL9yI\">\n+ <property role=\"TrG5h\" value=\"createDiffImage\" />\n+ <node concept=\"3cqZAl\" id=\"5qbHjZpIBmK\" role=\"3clF45\" />\n+ <node concept=\"3clFbS\" id=\"5qbHjZpIBmO\" role=\"3clF47\">\n+ <node concept=\"3cpWs8\" id=\"5qbHjZpJx0E\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"5qbHjZpJx0F\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"result\" />\n+ <node concept=\"3uibUv\" id=\"5qbHjZpIBEH\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"5zyv:~Future\" resolve=\"Future\" />\n+ <node concept=\"_YKpA\" id=\"5qbHjZpIBFc\" role=\"11_B2D\">\n+ <node concept=\"3uibUv\" id=\"5qbHjZpIBFd\" role=\"_ZDj9\">\n+ <ref role=\"3uigEE\" to=\"5zyv:~Future\" resolve=\"Future\" />\n+ <node concept=\"_YKpA\" id=\"5qbHjZpIBFe\" role=\"11_B2D\">\n+ <node concept=\"3uibUv\" id=\"5qbHjZpIBFf\" role=\"_ZDj9\">\n+ <ref role=\"3uigEE\" to=\"5zyv:~Future\" resolve=\"Future\" />\n+ <node concept=\"3uibUv\" id=\"5qbHjZpIBFg\" role=\"11_B2D\">\n+ <ref role=\"3uigEE\" to=\"lvkz:27MnIr9Ypso\" resolve=\"DiffImage\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"5qbHjZpJx0G\" role=\"33vP2m\">\n+ <node concept=\"liA8E\" id=\"5qbHjZpJx0I\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"lvkz:2XovqnGUhMw\" resolve=\"diffRevisions\" />\n+ <node concept=\"Xl_RD\" id=\"5qbHjZpJzC$\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\"4a09a7160149196ae66c32f060450be2135757be\" />\n+ </node>\n+ <node concept=\"Xl_RD\" id=\"5qbHjZpJzRy\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\"b75eaea117b970e75ae2c57cb291e5e2c7ad00d0\" />\n+ </node>\n+ </node>\n+ <node concept=\"2ShNRf\" id=\"5qbHjZpKLrc\" role=\"2Oq$k0\">\n+ <node concept=\"1pGfFk\" id=\"5qbHjZpKLrd\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"lvkz:4kPMkltJUzr\" resolve=\"DiffImages\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbH\" id=\"5qbHjZpKzqh\" role=\"3cqZAp\" />\n+ <node concept=\"3cpWs8\" id=\"5qbHjZpKF2b\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"5qbHjZpKF2c\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"images\" />\n+ <node concept=\"_YKpA\" id=\"5qbHjZpKIKt\" role=\"1tU5fm\">\n+ <node concept=\"3uibUv\" id=\"5qbHjZpKIKv\" role=\"_ZDj9\">\n+ <ref role=\"3uigEE\" to=\"lvkz:27MnIr9Ypso\" resolve=\"DiffImage\" />\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"5qbHjZpKGnF\" role=\"33vP2m\">\n+ <node concept=\"2OqwBi\" id=\"5qbHjZpKF2d\" role=\"2Oq$k0\">\n+ <node concept=\"2OqwBi\" id=\"5qbHjZpKF2e\" role=\"2Oq$k0\">\n+ <node concept=\"2YIFZM\" id=\"5qbHjZpKF2f\" role=\"2Oq$k0\">\n+ <ref role=\"37wK5l\" to=\"lvkz:5qbHjZpKv8N\" resolve=\"futureGet\" />\n+ <ref role=\"1Pybhc\" to=\"lvkz:27MnIra3H8T\" resolve=\"DiffServlet\" />\n+ <node concept=\"37vLTw\" id=\"5qbHjZpKF2g\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5qbHjZpJx0F\" resolve=\"result\" />\n+ </node>\n+ </node>\n+ <node concept=\"3goQfb\" id=\"5qbHjZpKF2h\" role=\"2OqNvi\">\n+ <node concept=\"1bVj0M\" id=\"5qbHjZpKF2i\" role=\"23t8la\">\n+ <node concept=\"3clFbS\" id=\"5qbHjZpKF2j\" role=\"1bW5cS\">\n+ <node concept=\"3clFbF\" id=\"5qbHjZpKF2k\" role=\"3cqZAp\">\n+ <node concept=\"2YIFZM\" id=\"5qbHjZpKF2l\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" to=\"lvkz:5qbHjZpKv8N\" resolve=\"futureGet\" />\n+ <ref role=\"1Pybhc\" to=\"lvkz:27MnIra3H8T\" resolve=\"DiffServlet\" />\n+ <node concept=\"37vLTw\" id=\"5qbHjZpKF2m\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5qbHjZpKF2n\" resolve=\"it\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"Rh6nW\" id=\"5qbHjZpKF2n\" role=\"1bW2Oz\">\n+ <property role=\"TrG5h\" value=\"it\" />\n+ <node concept=\"2jxLKc\" id=\"5qbHjZpKF2o\" role=\"1tU5fm\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3$u5V9\" id=\"5qbHjZpKF2p\" role=\"2OqNvi\">\n+ <node concept=\"1bVj0M\" id=\"5qbHjZpKF2q\" role=\"23t8la\">\n+ <node concept=\"3clFbS\" id=\"5qbHjZpKF2r\" role=\"1bW5cS\">\n+ <node concept=\"3clFbF\" id=\"5qbHjZpKF2s\" role=\"3cqZAp\">\n+ <node concept=\"2YIFZM\" id=\"5qbHjZpKF2t\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" to=\"lvkz:5qbHjZpKv8N\" resolve=\"futureGet\" />\n+ <ref role=\"1Pybhc\" to=\"lvkz:27MnIra3H8T\" resolve=\"DiffServlet\" />\n+ <node concept=\"37vLTw\" id=\"5qbHjZpKF2u\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5qbHjZpKF2v\" resolve=\"it\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"Rh6nW\" id=\"5qbHjZpKF2v\" role=\"1bW2Oz\">\n+ <property role=\"TrG5h\" value=\"it\" />\n+ <node concept=\"2jxLKc\" id=\"5qbHjZpKF2w\" role=\"1tU5fm\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"ANE8D\" id=\"5qbHjZpKIrg\" role=\"2OqNvi\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbH\" id=\"5qbHjZpKMRw\" role=\"3cqZAp\" />\n+ <node concept=\"3vlDli\" id=\"5qbHjZpKNhT\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5qbHjZpKOXp\" role=\"3tpDZA\">\n+ <node concept=\"37vLTw\" id=\"5qbHjZpKO0$\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5qbHjZpKF2c\" resolve=\"images\" />\n+ </node>\n+ <node concept=\"34oBXx\" id=\"5qbHjZpKQcb\" role=\"2OqNvi\" />\n+ </node>\n+ <node concept=\"3cmrfG\" id=\"5qbHjZpNfjG\" role=\"3tpDZB\">\n+ <property role=\"3cmrfH\" value=\"3\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2XOHcx\" id=\"5qbHjZpLzBr\">\n+ <property role=\"2XOHcw\" value=\"${modelix.home}\" />\n+ </node>\n+</model>\n+\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.ui.diff/org.modelix.ui.diff.msd", "new_path": "mps/org.modelix.ui.diff/org.modelix.ui.diff.msd", "diff": "<language slang=\"l:443f4c36-fcf5-4eb6-9500-8d06ed259e3e:jetbrains.mps.baseLanguage.classifiers\" version=\"0\" />\n<language slang=\"l:fd392034-7849-419d-9071-12563d152375:jetbrains.mps.baseLanguage.closures\" version=\"0\" />\n<language slang=\"l:83888646-71ce-4f1c-9c53-c54016f6ad4f:jetbrains.mps.baseLanguage.collections\" version=\"1\" />\n+ <language slang=\"l:5dc5fc0d-37ef-4782-8192-8b5ce1f69f80:jetbrains.mps.baseLanguage.extensionMethods\" version=\"0\" />\n<language slang=\"l:f2801650-65d5-424e-bb1b-463a8781b786:jetbrains.mps.baseLanguage.javadoc\" version=\"2\" />\n<language slang=\"l:760a0a8c-eabb-4521-8bfd-65db761a9ba3:jetbrains.mps.baseLanguage.logging\" version=\"0\" />\n<language slang=\"l:a247e09e-2435-45ba-b8d2-07e93feba96a:jetbrains.mps.baseLanguage.tuples\" version=\"0\" />\n+ <language slang=\"l:f61473f9-130f-42f6-b98d-6c438812c2f6:jetbrains.mps.baseLanguage.unitTest\" version=\"1\" />\n<language slang=\"l:63650c59-16c8-498a-99c8-005c7ee9515d:jetbrains.mps.lang.access\" version=\"0\" />\n<language slang=\"l:fe9d76d7-5809-45c9-ae28-a40915b4d6ff:jetbrains.mps.lang.checkedName\" version=\"1\" />\n<language slang=\"l:ceab5195-25ea-4f22-9b92-103b95ca8c0c:jetbrains.mps.lang.core\" version=\"2\" />\n<language slang=\"l:ef7bf5ac-d06c-4342-b11d-e42104eb9343:jetbrains.mps.lang.plugin.standalone\" version=\"0\" />\n<language slang=\"l:3a13115c-633c-4c5c-bbcc-75c4219e9555:jetbrains.mps.lang.quotation\" version=\"5\" />\n<language slang=\"l:7866978e-a0f0-4cc7-81bc-4d213d9375e1:jetbrains.mps.lang.smodel\" version=\"17\" />\n+ <language slang=\"l:8585453e-6bfb-4d80-98de-b16074f1d86c:jetbrains.mps.lang.test\" version=\"5\" />\n<language slang=\"l:c7fb639f-be78-4307-89b0-b5959c3fa8c8:jetbrains.mps.lang.text\" version=\"0\" />\n<language slang=\"l:9ded098b-ad6a-4657-bfd9-48636cfe8bc3:jetbrains.mps.lang.traceable\" version=\"0\" />\n</languageVersions>\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Unit test for diff image rendering
426,496
06.02.2023 17:12:05
-3,600
f96168a451de762f920a4e0cb7f99547471614a6
make the build fail if there are failing MPS tests
[ { "change_type": "MODIFY", "old_path": ".idea/gradle.xml", "new_path": ".idea/gradle.xml", "diff": "<option name=\"modules\">\n<set>\n<option value=\"$PROJECT_DIR$\" />\n- <option value=\"$PROJECT_DIR$/buildSrc\" />\n<option value=\"$PROJECT_DIR$/gitui\" />\n<option value=\"$PROJECT_DIR$/gradle-plugin\" />\n<option value=\"$PROJECT_DIR$/graphql-server\" />\n<option value=\"$PROJECT_DIR$/headless-mps\" />\n<option value=\"$PROJECT_DIR$/instances-manager\" />\n+ <option value=\"$PROJECT_DIR$/keycloak-extensions\" />\n<option value=\"$PROJECT_DIR$/manual-tests\" />\n<option value=\"$PROJECT_DIR$/mps\" />\n<option value=\"$PROJECT_DIR$/ui-client\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/org.modelix.build/models/org.modelix.build.mps", "new_path": "mps/org.modelix.build/models/org.modelix.build.mps", "diff": "<concept id=\"4560297596904469362\" name=\"jetbrains.mps.build.mps.tests.structure.BuildMps_TestModule\" flags=\"nn\" index=\"22LTRM\">\n<reference id=\"4560297596904469363\" name=\"module\" index=\"22LTRN\" />\n</concept>\n- <concept id=\"6593674873639474400\" name=\"jetbrains.mps.build.mps.tests.structure.BuildMps_TestModules_Options\" flags=\"ng\" index=\"24cAiW\" />\n+ <concept id=\"6593674873639474400\" name=\"jetbrains.mps.build.mps.tests.structure.BuildMps_TestModules_Options\" flags=\"ng\" index=\"24cAiW\">\n+ <child id=\"6593674873639478221\" name=\"haltonfailure\" index=\"24c_eh\" />\n+ </concept>\n<concept id=\"4005526075820600484\" name=\"jetbrains.mps.build.mps.tests.structure.BuildModuleTestsPlugin\" flags=\"ng\" index=\"1gjT0q\" />\n</language>\n<language id=\"798100da-4f0a-421a-b991-71f8c50ce5d2\" name=\"jetbrains.mps.build\">\n</node>\n</node>\n</node>\n+ <node concept=\"398rNT\" id=\"2_VYLT0eqku\" role=\"1l3spd\">\n+ <property role=\"TrG5h\" value=\"mps.macro.modelix.home\" />\n+ <node concept=\"398BVA\" id=\"2_VYLT0eqkO\" role=\"398pKh\">\n+ <ref role=\"398BVh\" node=\"1yReInD20Y\" resolve=\"modelix.home\" />\n+ </node>\n+ </node>\n<node concept=\"55IIr\" id=\"1yReInD20W\" role=\"auvoZ\" />\n<node concept=\"1l3spV\" id=\"1yReInD20X\" role=\"1l3spN\">\n<node concept=\"L2wRC\" id=\"6w3CrGw0IBg\" role=\"39821P\">\n<node concept=\"22LTRM\" id=\"5qbHjZpNHt8\" role=\"22LTRK\">\n<ref role=\"22LTRN\" node=\"27MnIrahxUD\" resolve=\"org.modelix.ui.diff\" />\n</node>\n- <node concept=\"24cAiW\" id=\"1yReInEzbz\" role=\"24cAkG\" />\n+ <node concept=\"24cAiW\" id=\"1yReInEzbz\" role=\"24cAkG\">\n+ <node concept=\"NbPM2\" id=\"5qbHjZpP3MW\" role=\"24c_eh\">\n+ <node concept=\"3Mxwew\" id=\"5qbHjZpP3MV\" role=\"3MwsjC\">\n+ <property role=\"3MwjfP\" value=\"true\" />\n+ </node>\n+ </node>\n+ </node>\n</node>\n</node>\n<node concept=\"1l3spW\" id=\"2p2ql82Ml$V\">\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
make the build fail if there are failing MPS tests
426,496
06.02.2023 19:44:31
-3,600
1ce03fb520bbe67a640f13ec54c2e4b957fbcd3c
git repository wasn't found during test execution
[ { "change_type": "MODIFY", "old_path": "mps/org.modelix.ui.diff/models/[email protected]", "new_path": "mps/org.modelix.ui.diff/models/[email protected]", "diff": "<imports>\n<import index=\"lvkz\" ref=\"r:ab9ceea2-f32a-4ea6-be78-3e6c2d4ef84b(org.modelix.ui.diff)\" />\n<import index=\"5zyv\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.util.concurrent(JDK/)\" />\n+ <import index=\"alof\" ref=\"742f6602-5a2f-4313-aa6e-ae1cd4ffdc61/java:jetbrains.mps.ide.project(MPS.Platform/)\" />\n</imports>\n<registry>\n<language id=\"8585453e-6bfb-4d80-98de-b16074f1d86c\" name=\"jetbrains.mps.lang.test\">\n<concept id=\"5097124989038916362\" name=\"jetbrains.mps.lang.test.structure.TestInfo\" flags=\"ng\" index=\"2XOHcx\">\n<property id=\"5097124989038916363\" name=\"projectPath\" index=\"2XOHcw\" />\n</concept>\n+ <concept id=\"1225467090849\" name=\"jetbrains.mps.lang.test.structure.ProjectExpression\" flags=\"nn\" index=\"1jxXqW\" />\n<concept id=\"1216913645126\" name=\"jetbrains.mps.lang.test.structure.NodesTestCase\" flags=\"lg\" index=\"1lH9Xt\">\n<child id=\"1217501895093\" name=\"testMethods\" index=\"1SL9yI\" />\n</concept>\n</node>\n<node concept=\"2ShNRf\" id=\"5qbHjZpKLrc\" role=\"2Oq$k0\">\n<node concept=\"1pGfFk\" id=\"5qbHjZpKLrd\" role=\"2ShVmc\">\n- <ref role=\"37wK5l\" to=\"lvkz:4kPMkltJUzr\" resolve=\"DiffImages\" />\n+ <ref role=\"37wK5l\" to=\"lvkz:4kPMkltJSq1\" resolve=\"DiffImages\" />\n+ <node concept=\"2YIFZM\" id=\"2_VYLT0fb$9\" role=\"37wK5m\">\n+ <ref role=\"37wK5l\" to=\"alof:~ProjectHelper.toIdeaProject(jetbrains.mps.project.Project)\" resolve=\"toIdeaProject\" />\n+ <ref role=\"1Pybhc\" to=\"alof:~ProjectHelper\" resolve=\"ProjectHelper\" />\n+ <node concept=\"1jxXqW\" id=\"2_VYLT0fbVQ\" role=\"37wK5m\" />\n+ </node>\n</node>\n</node>\n</node>\n</node>\n</node>\n<node concept=\"2XOHcx\" id=\"5qbHjZpLzBr\">\n- <property role=\"2XOHcw\" value=\"${modelix.home}\" />\n+ <property role=\"2XOHcw\" value=\"${modelix.home}/mps\" />\n</node>\n</model>\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
git repository wasn't found during test execution
426,496
07.02.2023 10:30:47
-3,600
0acc168c3b19b97a6aadd0c62360d99b2a1f2c61
more heap space for MPS test execution
[ { "change_type": "MODIFY", "old_path": "mps/org.modelix.build/models/org.modelix.build.mps", "new_path": "mps/org.modelix.build/models/org.modelix.build.mps", "diff": "</concept>\n<concept id=\"6593674873639474400\" name=\"jetbrains.mps.build.mps.tests.structure.BuildMps_TestModules_Options\" flags=\"ng\" index=\"24cAiW\">\n<child id=\"6593674873639478221\" name=\"haltonfailure\" index=\"24c_eh\" />\n+ <child id=\"3609768169816292377\" name=\"jvmArgs\" index=\"1psgkv\" />\n</concept>\n<concept id=\"4005526075820600484\" name=\"jetbrains.mps.build.mps.tests.structure.BuildModuleTestsPlugin\" flags=\"ng\" index=\"1gjT0q\" />\n</language>\n<property role=\"3MwjfP\" value=\"true\" />\n</node>\n</node>\n+ <node concept=\"NbPM2\" id=\"2_VYLT0rwsA\" role=\"1psgkv\">\n+ <node concept=\"3Mxwew\" id=\"2_VYLT0rws_\" role=\"3MwsjC\">\n+ <property role=\"3MwjfP\" value=\"-Xss2048k -Xmx2024m\" />\n+ </node>\n+ </node>\n</node>\n</node>\n</node>\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
more heap space for MPS test execution
426,496
07.02.2023 10:50:11
-3,600
56d9acc63c9d07e2f7460760592c854c646b828e
upload test reports on github actions
[ { "change_type": "MODIFY", "old_path": ".github/workflows/overallbuild.yml", "new_path": ".github/workflows/overallbuild.yml", "diff": "@@ -31,3 +31,12 @@ jobs:\nenv:\nGITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\nrun: ./gradlew build\n+ - name: Archive test report\n+ uses: actions/upload-artifact@v3\n+ if: always()\n+ with:\n+ name: test-report\n+ path: |\n+ */build/test-results\n+ */build/reports\n+ build/test.org.modelix/TEST-jetbrains.mps.testbench.junit.suites.AntModuleTestSuite0-all.xml\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
upload test reports on github actions
426,496
07.02.2023 11:37:32
-3,600
6788f2cbfead2892335d21c2d21adb20826175b1
attempt to fix X11 error
[ { "change_type": "MODIFY", "old_path": ".github/workflows/overallbuild.yml", "new_path": ".github/workflows/overallbuild.yml", "diff": "@@ -30,7 +30,10 @@ jobs:\n- name: Assemble\nenv:\nGITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n- run: ./gradlew build\n+ run: |\n+ export DISPLAY=:99\n+ sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &\n+ ./gradlew build\n- name: Archive test report\nuses: actions/upload-artifact@v3\nif: always()\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
attempt to fix X11 error
426,496
07.02.2023 11:53:54
-3,600
6acd1a82a48f3a5f53e8ad764824737cc76215b2
git revision used in the test are missing after the history rewrite
[ { "change_type": "MODIFY", "old_path": "mps/org.modelix.ui.diff/models/[email protected]", "new_path": "mps/org.modelix.ui.diff/models/[email protected]", "diff": "<node concept=\"liA8E\" id=\"5qbHjZpJx0I\" role=\"2OqNvi\">\n<ref role=\"37wK5l\" to=\"lvkz:2XovqnGUhMw\" resolve=\"diffRevisions\" />\n<node concept=\"Xl_RD\" id=\"5qbHjZpJzC$\" role=\"37wK5m\">\n- <property role=\"Xl_RC\" value=\"4a09a7160149196ae66c32f060450be2135757be\" />\n+ <property role=\"Xl_RC\" value=\"59ddbd914f9d5a1961b14ac736f5c46055486bba\" />\n</node>\n<node concept=\"Xl_RD\" id=\"5qbHjZpJzRy\" role=\"37wK5m\">\n- <property role=\"Xl_RC\" value=\"b75eaea117b970e75ae2c57cb291e5e2c7ad00d0\" />\n+ <property role=\"Xl_RC\" value=\"f1661a26a89a9b5dd277b10f0c3a282388c4e750\" />\n</node>\n</node>\n<node concept=\"2ShNRf\" id=\"5qbHjZpKLrc\" role=\"2Oq$k0\">\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
git revision used in the test are missing after the history rewrite
426,496
07.02.2023 16:37:29
-3,600
c2d772d51ba038f3e598e9793d50b0c35838ccd7
removed patch for error markers in headless mode MPS is now executed in projector where it is not in headless mode. It works without this patch.
[ { "change_type": "MODIFY", "old_path": "Dockerfile-mps", "new_path": "Dockerfile-mps", "diff": "@@ -68,15 +68,5 @@ RUN set -eux; \\\nWORKDIR /usr/modelix-ui\nCOPY artifacts/mps/ /usr/modelix-ui/mps/\n-# Enable error markers in headless mode\n-RUN apt update && apt install -y zip\n-RUN mkdir -p /tmp/mps-workbench\n-RUN unzip /usr/modelix-ui/mps/lib/mps-workbench.jar -d /tmp/mps-workbench/\n-RUN sed -i '/jetbrains.mps.nodeEditor.EmptyHighlighter/d' /tmp/mps-workbench/META-INF/MPSEditor.xml\n-RUN rm /usr/modelix-ui/mps/lib/mps-workbench.jar\n-WORKDIR /tmp/mps-workbench/\n-RUN zip -r /usr/modelix-ui/mps/lib/mps-workbench.jar ./*\n-RUN rm -rf /tmp/mps-workbench/\n-\nCOPY install-plugins.sh /\nRUN chmod +x /install-plugins.sh\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
removed patch for error markers in headless mode MPS is now executed in projector where it is not in headless mode. It works without this patch.
426,496
07.02.2023 16:57:32
-3,600
9452090633dc96cc1cb9963003d3518b12908c23
deleted unused modelix/modelix-ui docker image There isn't even a kubernetes config for it anymore. The UI plugin now runs inside projector.
[ { "change_type": "DELETE", "old_path": "Dockerfile-ui", "new_path": null, "diff": "-FROM modelix/modelix-base\n-WORKDIR /usr/modelix-ui\n-EXPOSE 33333\n-\n-#RUN mkdir -p /opt/cprof && \\\n-# wget -q -O- https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz \\\n-# | tar xzv -C /opt/cprof\n-\n-# Uses by run-ui-server to determine how much of the available memory of the container is used for the JVMs heap.\n-# 85% is the default but for projects with lots of plugins loaded into MPS memory required for classloading is large.\n-# If lots of memory is allocated for classes the 85% ratio can be to much and the JVM exceeds the memory limit of the\n-# container. Containers build on top of the modelix container can simply override the ENV and increase the value.\n-ENV HEAP_RATIO=85\n-\n-COPY build/org.modelix/build/artifacts/org.modelix/plugins/org.modelix.ui.server /mps-plugins/org.modelix.ui.server\n-RUN /install-plugins.sh\n-\n-COPY run-ui-server.sh /usr/modelix-ui\n-COPY ui-server/build/libs/* /usr/modelix-ui/\n-COPY ui-server/build/dependencies/ /usr/modelix-ui/dependencies/\n-CMD [\"./run-ui-server.sh\"]\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "docker-build-all.sh", "new_path": "docker-build-all.sh", "diff": "@@ -5,7 +5,6 @@ set -e\n./docker-build-db.sh\n./docker-build-mps.sh\n./docker-build-base.sh\n-./docker-build-ui.sh\n./docker-build-projector-base.sh\n./docker-build-projector.sh\n./docker-build-proxy.sh\n" }, { "change_type": "DELETE", "old_path": "docker-build-ui.sh", "new_path": null, "diff": "-#!/bin/sh\n-\n-TAG=$( ./modelix-version.sh )\n-\n-docker build --no-cache -f Dockerfile-ui -t modelix/modelix-ui .\n-\n-docker tag modelix/modelix-ui:latest \"modelix/modelix-ui:${TAG}\"\n-sed -i.bak -E \"s/(image:.*:).*/\\1${TAG}/\" kubernetes_deprecated/common/ui-deployment.yaml\n-rm kubernetes_deprecated/common/ui-deployment.yaml.bak\n" }, { "change_type": "MODIFY", "old_path": "docker-ci.sh", "new_path": "docker-ci.sh", "diff": "@@ -17,7 +17,6 @@ docker login -u \"$DOCKER_HUB_USER\" -p \"$DOCKER_HUB_KEY\"\n./docker-build-db.sh\n./docker-build-mps.sh\n./docker-build-base.sh\n-./docker-build-ui.sh\n./docker-build-projector-base.sh\n./docker-build-projector.sh\n./docker-build-proxy.sh\n@@ -32,7 +31,7 @@ TAGS=\"$MODELIX_VERSION mps-$mpsVersion\"\nif [ \"$mpsVersion\" != \"$mpsMajorVersion\" ]; then\nTAGS=\"$TAGS mps-$mpsMajorVersion\"\nfi\n-IMAGE_NAMES=\"modelix-db modelix-mps modelix-base modelix-ui modelix-projector modelix-proxy modelix-uiproxy modelix-instances-manager modelix-workspace-manager modelix-workspace-client keycloak\"\n+IMAGE_NAMES=\"modelix-db modelix-mps modelix-base modelix-projector modelix-proxy modelix-uiproxy modelix-instances-manager modelix-workspace-manager modelix-workspace-client keycloak\"\nfor TAG in $TAGS ; do\necho \"Pushing Tag $TAG\"\n" }, { "change_type": "DELETE", "old_path": "run-ui-server.sh", "new_path": null, "diff": "-#!/bin/sh\n-\n-java -DMODEL_URI=$MODEL_URI \\\n- -DREPOSITORY_ID=$REPOSITORY_ID \\\n- -Dmodelix.executionMode=CLUSTER \\\n- -classpath \"./*:./mps/lib/*:./dependencies/*\" \\\n- -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5071 \\\n- -XX:MaxRAMPercentage=\"$HEAP_RATIO\"\\\n- org.modelix.ui.server.Main\n-\n-# -agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=ui\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
deleted unused modelix/modelix-ui docker image There isn't even a kubernetes config for it anymore. The UI plugin now runs inside projector.
426,496
07.02.2023 17:04:49
-3,600
fa9a9684c88fafd9f861e0d0792e0e56b2c73721
deleted unused modelix/modelix-uiproxy docker image This allowed to view diffs of MPS models for github pull request. It's not maintained anymore and there is no kubernetes config for it.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -74,7 +74,6 @@ An MPS instances with a lot of languages and plugins can require ~8 GB of memory\n| [samples](samples) | Projects that show you how to build your own kubernetes cluster running MPS with custom languages. |\n| [ssl](ssl) | SSL support inside the kubernetes cluster |\n| [ui-client](ui-client) | A typescript project that implements the browser part of the editor. This is generic and doesn't contain anything language specific. All language specific parts are implements on the server side in MPS. |\n-| [ui-proxy](ui-proxy) | Starts MPS instaces on demand with cloned github repositories. Also supports showing diffs for pull requests. |\n| [ui-server](ui-server) | A small Java project that configures and starts MPS in headless mode. |\n| [.dockerignore](.dockerignore) | |\n| [.gitignore](.gitignore) | |\n" }, { "change_type": "MODIFY", "old_path": "docker-build-all.sh", "new_path": "docker-build-all.sh", "diff": "@@ -8,7 +8,6 @@ set -e\n./docker-build-projector-base.sh\n./docker-build-projector.sh\n./docker-build-proxy.sh\n-./docker-build-uiproxy.sh\n./docker-build-instances-manager.sh\n./docker-build-workspace-manager.sh\n./docker-build-workspace-client.sh\n" }, { "change_type": "DELETE", "old_path": "docker-build-uiproxy.sh", "new_path": null, "diff": "-#!/bin/sh\n-\n-TAG=$( ./modelix-version.sh )\n-\n-cd ui-proxy\n-docker build --no-cache -t modelix/modelix-uiproxy .\n-\n-cd ..\n-docker tag modelix/modelix-uiproxy:latest \"modelix/modelix-uiproxy:${TAG}\"\n-sed -i.bak -E \"s/(image:.*:).*/\\1${TAG}/\" kubernetes_deprecated/common/uiproxy-deployment.yaml\n-rm kubernetes_deprecated/common/uiproxy-deployment.yaml.bak\n" }, { "change_type": "MODIFY", "old_path": "docker-ci.sh", "new_path": "docker-ci.sh", "diff": "@@ -20,7 +20,6 @@ docker login -u \"$DOCKER_HUB_USER\" -p \"$DOCKER_HUB_KEY\"\n./docker-build-projector-base.sh\n./docker-build-projector.sh\n./docker-build-proxy.sh\n-./docker-build-uiproxy.sh\n./docker-build-instances-manager.sh\n./docker-build-workspace-manager.sh\n./docker-build-workspace-client.sh\n@@ -31,7 +30,7 @@ TAGS=\"$MODELIX_VERSION mps-$mpsVersion\"\nif [ \"$mpsVersion\" != \"$mpsMajorVersion\" ]; then\nTAGS=\"$TAGS mps-$mpsMajorVersion\"\nfi\n-IMAGE_NAMES=\"modelix-db modelix-mps modelix-base modelix-projector modelix-proxy modelix-uiproxy modelix-instances-manager modelix-workspace-manager modelix-workspace-client keycloak\"\n+IMAGE_NAMES=\"modelix-db modelix-mps modelix-base modelix-projector modelix-proxy modelix-instances-manager modelix-workspace-manager modelix-workspace-client keycloak\"\nfor TAG in $TAGS ; do\necho \"Pushing Tag $TAG\"\n" }, { "change_type": "MODIFY", "old_path": "instances-manager/Dockerfile", "new_path": "instances-manager/Dockerfile", "diff": "FROM openjdk:11\n-WORKDIR /usr/ui-proxy\n+WORKDIR /instances-manager/\nEXPOSE 33332\nCOPY build/libs/instances-manager-latest-all.jar /instances-manager/\nCMD [\"java\", \"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005\", \"-XX:MaxRAMPercentage=85\", \"-cp\", \"/instances-manager/instances-manager-latest-all.jar\", \"org.modelix.instancesmanager.Main\"]\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "settings.gradle", "new_path": "settings.gradle", "diff": "@@ -3,7 +3,6 @@ rootProject.name = 'modelix'\ninclude 'ui-client'\ninclude 'mps'\ninclude 'ui-server'\n-include 'ui-proxy'\ninclude 'instances-manager'\ninclude 'keycloak-extensions'\ninclude 'gradle-plugin'\n" }, { "change_type": "DELETE", "old_path": "ui-proxy/Dockerfile", "new_path": null, "diff": "-FROM openjdk:11\n-WORKDIR /usr/ui-proxy\n-EXPOSE 33332\n-COPY build/libs/* /usr/ui-proxy/\n-COPY build/dependencies/* /usr/ui-proxy/\n-CMD [\"java\",\"-XX:MaxRAMPercentage=85\", \"-cp\", \"/usr/ui-proxy/*\", \"org.modelix.uiproxy.Main\"]\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "ui-proxy/build.gradle", "new_path": null, "diff": "-plugins {\n- id 'java'\n-}\n-\n-group 'org.modelix'\n-version modelixVersion\n-\n-description = \"modelix UI proxy\"\n-\n-compileJava {\n- sourceCompatibility = '11'\n- targetCompatibility = '11'\n-}\n-\n-defaultTasks 'build'\n-\n-repositories {\n- mavenCentral()\n-}\n-\n-dependencies {\n- testCompile group: 'junit', name: 'junit', version: '4.12'\n- compile 'io.kubernetes:client-java:8.0.2'\n- compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.2.7'\n- compile group: 'commons-codec', name: 'commons-codec', version: '1.14'\n- compile group: 'commons-io', name: 'commons-io', version: '2.6'\n- compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'\n-\n- ext.jettyVersion = '9.4.30.v20200611'\n- compile group: 'org.eclipse.jetty', name: 'jetty-server', version: jettyVersion\n- compile group: 'org.eclipse.jetty', name: 'jetty-proxy', version: jettyVersion\n- compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: jettyVersion\n- compile group: 'org.eclipse.jetty.websocket', name: 'websocket-servlet', version: jettyVersion\n- compile group: 'org.eclipse.jetty.websocket', name: 'websocket-client', version: jettyVersion\n- compile group: 'org.eclipse.jetty.websocket', name: 'websocket-server', version: jettyVersion\n-\n- compile group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '6.1.0.202203080745-r'\n- compile group: 'org.kohsuke', name: 'github-api', version: '1.115'\n-}\n-\n-task copyRuntimeLibs(type: Copy) {\n- into \"$buildDir/dependencies\"\n- from configurations.runtime\n-}\n-\n-assemble.dependsOn copyRuntimeLibs\n-\n-jar {\n- manifest {\n- attributes(\"modelix-Version\": modelixVersion)\n- attributes(\"MPS-MajorVersion\": mpsMajorVersion)\n- attributes(\"MPS-MinorVersion\": mpsMinorVersion)\n- attributes(\"MPS-Version\": mpsVersion)\n- }\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "ui-proxy/src/main/java/org/modelix/uiproxy/DeploymentManagingHandler.java", "new_path": null, "diff": "-package org.modelix.uiproxy;\n-\n-import io.kubernetes.client.custom.Quantity;\n-import io.kubernetes.client.openapi.ApiException;\n-import io.kubernetes.client.openapi.Configuration;\n-import io.kubernetes.client.openapi.apis.AppsV1Api;\n-import io.kubernetes.client.openapi.apis.CoreV1Api;\n-import io.kubernetes.client.openapi.models.V1Deployment;\n-import io.kubernetes.client.openapi.models.V1DeploymentBuilder;\n-import io.kubernetes.client.openapi.models.V1DeploymentList;\n-import io.kubernetes.client.openapi.models.V1EnvVar;\n-import io.kubernetes.client.openapi.models.V1Pod;\n-import io.kubernetes.client.openapi.models.V1PodList;\n-import io.kubernetes.client.openapi.models.V1Service;\n-import io.kubernetes.client.openapi.models.V1ServiceBuilder;\n-import io.kubernetes.client.openapi.models.V1ServiceList;\n-import io.kubernetes.client.util.ClientBuilder;\n-import io.kubernetes.client.util.Yaml;\n-import org.apache.commons.collections4.map.HashedMap;\n-import org.apache.commons.lang.StringEscapeUtils;\n-import org.eclipse.jetty.server.Request;\n-import org.eclipse.jetty.server.handler.AbstractHandler;\n-import org.eclipse.jgit.api.Git;\n-import org.eclipse.jgit.api.errors.GitAPIException;\n-import org.eclipse.jgit.lib.Ref;\n-import org.kohsuke.github.GHIssueState;\n-import org.kohsuke.github.GHPullRequest;\n-import org.kohsuke.github.GHRepository;\n-import org.kohsuke.github.GitHub;\n-import org.kohsuke.github.GitHubBuilder;\n-import org.slf4j.Logger;\n-import org.slf4j.LoggerFactory;\n-\n-import javax.servlet.ServletException;\n-import javax.servlet.http.HttpServletRequest;\n-import javax.servlet.http.HttpServletResponse;\n-import java.io.IOException;\n-import java.util.Arrays;\n-import java.util.Collection;\n-import java.util.Collections;\n-import java.util.List;\n-import java.util.Map;\n-import java.util.function.Supplier;\n-\n-public class DeploymentManagingHandler extends AbstractHandler {\n- private static final Logger LOG = LoggerFactory.getLogger(DeploymentManagingHandler.class);\n- public static final String KUBERNETES_NAMESPACE = \"default\";\n-\n- private String dockerImageTag = \"latest\";\n- private Map<String, Long> deploymentTimeouts = Collections.synchronizedMap(new HashedMap<>());\n- private Thread cleanupThread = new Thread() {\n- @Override\n- public void run() {\n- while (true) {\n- try {\n- cleanupDeployments();\n- } catch (Exception ex) {\n- LOG.error(\"\", ex);\n- }\n- try {\n- Thread.sleep(10_000);\n- } catch (InterruptedException e) {\n- return;\n- }\n- }\n- }\n- };\n-\n- public DeploymentManagingHandler() {\n- try {\n- Configuration.setDefaultApiClient(ClientBuilder.cluster().build());\n- } catch (IOException e) {\n- throw new RuntimeException(e);\n- }\n- cleanupThread.start();\n- }\n-\n- public void setModelixVersion(String version) {\n- if (version == null || version.length() == 0) return;\n- this.dockerImageTag = version;\n- }\n-\n- @Override\n- public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {\n- try {\n- RedirectedURL redirectedURL = RedirectedURL.redirect(request);\n- if (redirectedURL == null) return;\n-\n- if (redirectedURL.getRemainingPath() == null) {\n- if (request.getRequestURI().endsWith(\"/\")) {\n- response.setStatus(HttpServletResponse.SC_NOT_FOUND);\n- } else {\n- response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);\n- response.addHeader(\"Location\", request.getRequestURI() + \"/\");\n- }\n- baseRequest.setHandled(true);\n- return;\n- }\n-\n- if (\"/\".equals(redirectedURL.getRemainingPath()) && redirectedURL.getCommitId() == null) {\n- Collection<Ref> refs = null;\n- try {\n- refs = Git.lsRemoteRepository()\n- .setRemote(redirectedURL.getRepositoryUrl())\n- .setTags(true)\n- .setHeads(true)\n- .call();\n- } catch (GitAPIException e) {\n- throw new RuntimeException(e);\n- }\n-\n- response.getWriter()\n- .append(\"<html>\")\n- .append(\"<head>\")\n- .append(\"</head>\")\n- .append(\"<body>\")\n- .append(\"<h1>Tags and Branches</h1>\");\n-\n- for (Ref ref : refs) {\n- response.getWriter()\n- .append(\"<div><a href=\\\"commit/\")\n- .append(ref.getObjectId().getName())\n- .append(\"/\\\">\")\n- .append(ref.getName())\n- .append(\"</a></div>\");\n- }\n-\n- response.getWriter().append(\"<h1>Pull Requests</h1>\");\n- try {\n- GitHub github = new GitHubBuilder().build();\n- GHRepository ghRepo = github.getRepository(redirectedURL.getGithubRepositoryName());\n- List<GHPullRequest> pullRequests = ghRepo.getPullRequests(GHIssueState.ALL);\n- for (GHPullRequest pullRequest : pullRequests) {\n- boolean sameRepo = pullRequest.getHead().getRepository().getFullName().equals(\n- pullRequest.getBase().getRepository().getFullName());\n- response.getWriter()\n- .append(\"<div>\");\n- response.getWriter()\n- .append(\"#\")\n- .append(Integer.toString(pullRequest.getNumber()))\n- .append(\" - \")\n- .append(StringEscapeUtils.escapeHtml(pullRequest.getTitle()));\n- if (sameRepo) {\n- response.getWriter()\n- .append(\" (<a href=\\\"\")\n- .append(\"commit/\")\n- .append(pullRequest.getHead().getSha())\n- .append(\"/\")\n- .append(\"\\\">Open Version</a>)\")\n- .append(\"\")\n- .append(\" (<a href=\\\"\")\n- .append(\"diff/\")\n- .append(pullRequest.getBase().getSha())\n- .append(\"/\")\n- .append(pullRequest.getHead().getSha())\n- .append(\"/\")\n- .append(\"\\\">Show Diff</a>)\");\n- }\n- response.getWriter()\n- .append(\"</div>\");\n- }\n- } catch (Exception ex) {\n- response.getWriter().append(\"<div>\").append(ex.getMessage()).append(\"</div\");\n- }\n-\n- response.getWriter()\n- .append(\"</body>\")\n- .append(\"</html>\");\n- baseRequest.setHandled(true);\n- response.setContentType(\"text/html\");\n- response.setStatus(HttpServletResponse.SC_OK);\n- return;\n- }\n-\n- deploymentTimeouts.put(redirectedURL.getDeploymentName(), System.currentTimeMillis() + 600_000);\n- boolean deploymentCreated = createDeployment(redirectedURL, () -> {\n- Collection<Ref> refs = null;\n- try {\n- refs = Git.lsRemoteRepository()\n- .setRemote(redirectedURL.getRepositoryUrl())\n- .setTags(false)\n- .setHeads(true)\n- .call();\n- } catch (GitAPIException e) {\n- LOG.error(\"\", e);\n- return false;\n- }\n- for (Ref ref : refs) {\n- System.out.println(\"Ref: \" + ref.getName() + \" -> \" + ref.getObjectId().getName());\n- if (\"refs/heads/master\".equals(ref.getName())) {\n- System.out.println(\"commit ID: \" + ref.getObjectId().getName());\n- return true;\n- }\n- }\n- return false;\n- });\n- if (!deploymentCreated) throw new RuntimeException(\"Not git repository found at \" + redirectedURL.getRepositoryUrl());\n-\n- V1Deployment deployment = getDeployment(redirectedURL.getDeploymentName());\n- if (deployment == null) throw new RuntimeException(\"Failed to create deployment\");\n-\n- Integer readyReplicas = deployment.getStatus() != null ? deployment.getStatus().getReadyReplicas() : null;\n- if (readyReplicas == null || readyReplicas == 0) {\n- baseRequest.setHandled(true);\n- response.setContentType(\"text/html\");\n- response.setStatus(HttpServletResponse.SC_OK);\n- String podLogs = getPodLogs(redirectedURL.getDeploymentName());\n-\n- response.getWriter()\n- .append(\"<html>\")\n- .append(\"<head>\")\n- .append(\"<meta http-equiv=\\\"refresh\\\" content=\\\"5\\\">\")\n- .append(\"</head>\")\n- .append(\"<body>\")\n- .append(\"<div>Starting MPS ...</div>\");\n-\n- if (podLogs != null) {\n- response.getWriter().append(\"<br/><hr/><br/><pre>\");\n- StringEscapeUtils.escapeHtml(response.getWriter(), podLogs);\n- response.getWriter().append(\"</pre>\");\n- }\n-\n- response.getWriter()\n- .append(\"</body>\")\n- .append(\"</html>\");\n- }\n-\n- cleanupDeployments();\n- } catch (Exception ex) {\n- throw new RuntimeException(ex);\n- }\n- }\n-\n- private final Object cleanupLock = new Object();\n- private void cleanupDeployments() {\n- // TODO doesn't work with multiple instances of UI proxy\n- synchronized (cleanupLock) {\n- try {\n- AppsV1Api appsApi = new AppsV1Api();\n- CoreV1Api coreApi = new CoreV1Api();\n- V1DeploymentList deployments = null;\n- deployments = appsApi.listNamespacedDeployment(KUBERNETES_NAMESPACE, null, null, null, null, null, null, null, null, null);\n- for (V1Deployment deployment : deployments.getItems()) {\n- String name = deployment.getMetadata().getName();\n- if (!name.startsWith(RedirectedURL.DEPLOYMENT_PREFIX)) continue;\n- Long timeout = deploymentTimeouts.get(name);\n- if (timeout != null && timeout > System.currentTimeMillis()) continue;\n- deploymentTimeouts.remove(name);\n- appsApi.deleteNamespacedDeployment(name, KUBERNETES_NAMESPACE, null, null, null, null, null, null);\n- coreApi.deleteNamespacedService(name, KUBERNETES_NAMESPACE, null, null, null, null, null, null);\n- }\n- } catch (ApiException e) {\n- LOG.error(\"Deployment cleanup failed\", e);\n- }\n- }\n- }\n-\n- private boolean isDeploymentReady(String name) throws ApiException {\n- V1Deployment deployment = getDeployment(name);\n- if (deployment == null) return false;\n- return deployment.getStatus().getReadyReplicas() > 0;\n- }\n-\n- private V1Deployment getDeployment(String name) throws ApiException {\n- AppsV1Api appsApi = new AppsV1Api();\n- V1DeploymentList deployments = appsApi.listNamespacedDeployment(KUBERNETES_NAMESPACE, null, null, null, null, null, null, null, null, null);\n- for (V1Deployment deployment : deployments.getItems()) {\n- if (name.equals(deployment.getMetadata().getName())) return deployment;\n- }\n- return null;\n- }\n-\n- private String getPodLogs(String deploymentName) {\n- try {\n- CoreV1Api coreApi = new CoreV1Api();\n- V1PodList pods = coreApi.listNamespacedPod(KUBERNETES_NAMESPACE, null, null, null, null, null, null, null, null, null);\n- for (V1Pod pod : pods.getItems()) {\n- if (!pod.getMetadata().getName().startsWith(deploymentName)) continue;\n- return coreApi.readNamespacedPodLog(\n- pod.getMetadata().getName(),\n- KUBERNETES_NAMESPACE,\n- pod.getSpec().getContainers().get(0).getName(),\n- null, null, \"true\", null, null, 10_000, null);\n- }\n- } catch (Exception e) {\n- LOG.error(\"\", e);\n- return null;\n- }\n-\n- return null;\n- }\n-\n- private boolean createDeployment(RedirectedURL gitRepoUrl, Supplier<Boolean> urlValidator) throws IOException, ApiException {\n- String name = gitRepoUrl.getDeploymentName();\n-\n- AppsV1Api appsApi = new AppsV1Api();\n-\n- V1DeploymentList deployments = appsApi.listNamespacedDeployment(KUBERNETES_NAMESPACE, null, null, null, null, null, null, null, 5, false);\n- boolean deploymentExists = deployments.getItems().stream().anyMatch(d -> name.equals(d.getMetadata().getName()));\n- if (!deploymentExists) {\n- long numExisting = deployments.getItems().stream().filter(d -> d.getMetadata().getName().startsWith(RedirectedURL.DEPLOYMENT_PREFIX)).count();\n- if (numExisting > 10) throw new RuntimeException(\"Too many existing deployments\");\n-\n- if (!urlValidator.get()) {\n- return false;\n- }\n-\n- V1Deployment deployment = new V1DeploymentBuilder()\n- .withNewMetadata()\n- .withName(name)\n- .addToLabels(\"app\", name)\n- .endMetadata()\n- .withNewSpec()\n- .withNewSelector()\n- .addToMatchLabels(\"app\", name)\n- .endSelector()\n- .withNewTemplate()\n- .withNewMetadata()\n- .addToLabels(\"app\", name)\n- .endMetadata()\n- .withNewSpec()\n- .addNewContainer()\n- .withName(\"ui\")\n- .withImage(\"modelix/modelix-ui:\" + dockerImageTag)\n- .withImagePullPolicy(\"IfNotPresent\")\n- .addNewEnv()\n- .withName(\"GIT_REPO_URI\")\n- .withValue(gitRepoUrl.getRepositoryUrl())\n- .endEnv()\n- .addNewEnv()\n- .withName(\"GIT_COMMIT_ID\")\n- .withValue(gitRepoUrl.getCommitId())\n- .endEnv()\n- .removeMatchingFromEnv(e -> e.getValue() == null)\n- .addNewPort()\n- .withContainerPort(33333)\n- .endPort()\n- .addNewVolumeMount()\n- .withName(\"modelsecret\")\n- .withMountPath(\"/secrets/modelsecret\")\n- .withReadOnly(true)\n- .endVolumeMount()\n- .withNewResources()\n- .addToRequests(\"memory\", new Quantity(\"1.5Gi\"))\n- .addToRequests(\"cpu\", new Quantity(\"0.5\"))\n- .addToLimits(\"memory\", new Quantity(\"2.5Gi\"))\n- .addToLimits(\"cpu\", new Quantity(\"2\"))\n- .endResources()\n- .withNewReadinessProbe()\n- .withNewHttpGet()\n- .withNewPath(\"/health/check\")\n- .withNewPort(33333)\n- .endHttpGet()\n- .withInitialDelaySeconds(10)\n- .withPeriodSeconds(5)\n- .withTimeoutSeconds(3)\n- .endReadinessProbe()\n- .withNewLivenessProbe()\n- .withNewHttpGet()\n- .withNewPath(\"/health/check\")\n- .withNewPort(33333)\n- .endHttpGet()\n- .withInitialDelaySeconds(120)\n- .withPeriodSeconds(20)\n- .withTimeoutSeconds(10)\n- .endLivenessProbe()\n- .endContainer()\n- .addNewToleration()\n- .withKey(\"github-only\")\n- .withNewOperator(\"Exists\")\n- .endToleration()\n- .withNewRestartPolicy(\"Always\")\n- .addNewVolume()\n- .withName(\"modelsecret\")\n- .withNewSecret()\n- .withNewSecretName(\"modelsecret\")\n- .endSecret()\n- .endVolume()\n- .endSpec()\n- .endTemplate()\n- .endSpec()\n- .build();\n- System.out.println(\"Creating deployment: \");\n- System.out.println(Yaml.dump(deployment));\n- appsApi.createNamespacedDeployment(KUBERNETES_NAMESPACE, deployment, null, null, null);\n- }\n-\n- CoreV1Api coreApi = new CoreV1Api();\n- V1ServiceList services = coreApi.listNamespacedService(KUBERNETES_NAMESPACE, null, null, null, null, null, null, null, 5, false);\n- boolean serviceExists = services.getItems().stream().anyMatch(s -> name.equals(s.getMetadata().getName()));\n- if (!serviceExists) {\n- V1Service service = new V1ServiceBuilder()\n- .withNewMetadata()\n- .addToLabels(\"app\", name)\n- .withName(name)\n- .endMetadata()\n- .withNewSpec()\n- .withNewType(\"NodePort\")\n- .addNewPort()\n- .withName(\"33333\")\n- .withPort(33333)\n- .withNewTargetPort(33333)\n- .endPort()\n- .addToSelector(\"app\", name)\n- .endSpec()\n- .build();\n- System.out.println(\"Creating service: \");\n- System.out.println(Yaml.dump(service));\n-\n- coreApi.createNamespacedService(KUBERNETES_NAMESPACE, service, null, null, null);\n- }\n-\n- return true;\n- }\n-}\n" }, { "change_type": "DELETE", "old_path": "ui-proxy/src/main/java/org/modelix/uiproxy/Main.java", "new_path": null, "diff": "-package org.modelix.uiproxy;\n-\n-import io.kubernetes.client.openapi.ApiException;\n-import org.eclipse.jetty.proxy.ProxyServlet;\n-import org.eclipse.jetty.server.Request;\n-import org.eclipse.jetty.server.Server;\n-import org.eclipse.jetty.server.handler.DefaultHandler;\n-import org.eclipse.jetty.server.handler.HandlerList;\n-import org.eclipse.jetty.server.handler.HandlerWrapper;\n-import org.eclipse.jetty.servlet.ServletContextHandler;\n-import org.eclipse.jetty.servlet.ServletHolder;\n-import org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest;\n-import org.eclipse.jetty.websocket.servlet.WebSocketServlet;\n-import org.slf4j.Logger;\n-import org.slf4j.LoggerFactory;\n-\n-import javax.servlet.ServletException;\n-import javax.servlet.http.HttpServletRequest;\n-import javax.servlet.http.HttpServletResponse;\n-import java.io.IOException;\n-import java.net.URI;\n-import java.net.URISyntaxException;\n-import java.net.URL;\n-import java.util.Enumeration;\n-import java.util.jar.Manifest;\n-\n-public class Main {\n- private static final Logger LOG = LoggerFactory.getLogger(Main.class);\n-\n- public static void main(String[] args) {\n- try {\n- startServer();\n- } catch (ApiException ex) {\n- LOG.error(\"\", ex);\n- LOG.error(\"code: \" + ex.getCode());\n- LOG.error(\"body: \" + ex.getResponseBody());\n- } catch (Exception ex) {\n- LOG.error(\"\", ex);\n- }\n- }\n-\n- private static void startServer() throws Exception {\n- Server server = new Server(33332);\n- HandlerList handlerList = new HandlerList();\n- server.setHandler(handlerList);\n-\n- Manifest manifest = readManifest();\n- String modelixVersion = manifest.getMainAttributes().getValue(\"modelix-Version\");\n-\n- DeploymentManagingHandler deploymentManagingHandler = new DeploymentManagingHandler();\n- deploymentManagingHandler.setModelixVersion(modelixVersion);\n- handlerList.addHandler(deploymentManagingHandler);\n-\n- WebSocketServlet webSocketServlet = new WebSocketProxyServlet() {\n- @Override\n- protected URI redirect(ServletUpgradeRequest request) {\n- String path = request.getRequestURI().getPath();\n- RedirectedURL redirectedURL = RedirectedURL.redirect(request.getHttpServletRequest());\n- if (redirectedURL == null) return null;\n- try {\n- return new URI(redirectedURL.getRedirectedUrl(true));\n- } catch (URISyntaxException e) {\n- throw new RuntimeException(e);\n- }\n- }\n- };\n- HandlerWrapper webSocketHandlerCondition = new HandlerWrapper() {\n- @Override\n- public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {\n- if (RedirectedURL.redirect(request) == null) return;\n- if (!baseRequest.getRequestURI().contains(\"/ws/\")) return;\n- super.handle(target, baseRequest, request, response);\n- }\n- };\n- ServletContextHandler webSocketHandler = new ServletContextHandler();\n- webSocketHandler.addServlet(new ServletHolder(webSocketServlet), \"/*\");\n- webSocketHandlerCondition.setHandler(webSocketHandler);\n- handlerList.addHandler(webSocketHandlerCondition);\n-\n-\n- ProxyServlet proxyServlet = new ProxyServlet() {\n- @Override\n- protected String rewriteTarget(HttpServletRequest clientRequest) {\n- RedirectedURL redirectedURL = RedirectedURL.redirect(clientRequest);\n- if (redirectedURL == null) return null;\n- return redirectedURL.getRedirectedUrl(false);\n- }\n- };\n- proxyServlet.setTimeout(60_000);\n-\n- ServletContextHandler proxyHandler = new ServletContextHandler();\n- proxyHandler.addServlet(new ServletHolder(proxyServlet), \"/*\");\n- handlerList.addHandler(proxyHandler);\n-\n- handlerList.addHandler(new DefaultHandler());\n- server.start();\n-\n- Runtime.getRuntime().addShutdownHook(new Thread() {\n- @Override\n- public void run() {\n- try {\n- server.stop();\n- } catch (Exception ex) {\n- System.out.println(ex.getMessage());\n- ex.printStackTrace();\n- }\n- }\n- });\n- }\n-\n- private static Manifest readManifest() {\n- Enumeration<URL> resources = null;\n- try {\n- resources = Main.class.getClassLoader().getResources(\"META-INF/MANIFEST.MF\");\n- while (resources.hasMoreElements()) {\n- try {\n- Manifest manifest = new Manifest(resources.nextElement().openStream());\n- if (manifest.getMainAttributes().getValue(\"modelix-Version\") != null) {\n- return manifest;\n- }\n- } catch (IOException ex) {\n- throw new RuntimeException(\"Failed to read MANIFEST.MF\", ex);\n- }\n- }\n- } catch (IOException ex) {\n- throw new RuntimeException(\"Failed to read MANIFEST.MF\", ex);\n- }\n- throw new RuntimeException(\"No MANIFEST.MF found containing 'modelix-Version'\");\n- }\n-}\n" }, { "change_type": "DELETE", "old_path": "ui-proxy/src/main/java/org/modelix/uiproxy/RedirectedURL.java", "new_path": null, "diff": "-package org.modelix.uiproxy;\n-\n-import org.apache.commons.codec.digest.DigestUtils;\n-\n-import javax.servlet.http.HttpServletRequest;\n-import java.util.Arrays;\n-import java.util.List;\n-import java.util.Optional;\n-import java.util.stream.Collectors;\n-\n-public class RedirectedURL {\n- public static final String DEPLOYMENT_PREFIX = \"ui-git-\";\n-\n- public static RedirectedURL redirect(HttpServletRequest req) {\n- List<String> parts = Arrays.asList(req.getRequestURI().split(\"/\", -1));\n- if (parts.size() > 0 && parts.get(0).length() == 0) parts = parts.subList(1, parts.size());\n-\n- if (parts.size() < 3) return null;\n- if (!parts.get(0).equals(\"github\")) return null;\n-\n- String repositoryUrl = \"https://github.com/\" + parts.get(1) + \"/\" + parts.get(2) + \".git\";\n- String githubRepositoryName = parts.get(1) + \"/\" + parts.get(2);\n- parts = parts.subList(3, parts.size());\n-\n- String commitId = null;\n- if (parts.size() >= 2 && parts.get(0).equals(\"commit\")) {\n- commitId = parts.get(1);\n- parts = parts.subList(2, parts.size());\n- }\n-\n- String remainingPath = parts.stream().reduce((a, b) -> a + \"/\" + b).orElse(null);\n- if (remainingPath != null) remainingPath = \"/\" + remainingPath;\n- if (remainingPath != null && req.getQueryString() != null && req.getQueryString().length() > 0) {\n- remainingPath += \"?\" + req.getQueryString();\n- }\n- return new RedirectedURL(\n- remainingPath,\n- repositoryUrl,\n- commitId,\n- githubRepositoryName\n- );\n- }\n-\n- private String remainingPath;\n- private String repositoryUrl;\n- private String commitId;\n- private String githubRepositoryName;\n-\n- public RedirectedURL(String remainingPath, String repositoryUrl, String commitId, String githubRepositoryName) {\n- this.remainingPath = remainingPath;\n- this.repositoryUrl = repositoryUrl;\n- this.commitId = commitId;\n- this.githubRepositoryName = githubRepositoryName;\n- }\n-\n- public String getRemainingPath() {\n- return remainingPath;\n- }\n-\n- public String getRepositoryUrl() {\n- return repositoryUrl;\n- }\n-\n- public String getCommitId() {\n- return commitId;\n- }\n-\n- public String getGithubRepositoryName() {\n- return githubRepositoryName;\n- }\n-\n- public String getDeploymentName() {\n- return DEPLOYMENT_PREFIX + DigestUtils.sha1Hex(getRepositoryUrl() + \"@\" + commitId);\n- }\n-\n- public String getRedirectedUrl(boolean websocket) {\n- return (websocket ? \"ws\" : \"http\") + \"://\" + getDeploymentName() + \":33333\" + getRemainingPath();\n- }\n-}\n" }, { "change_type": "DELETE", "old_path": "ui-proxy/src/main/java/org/modelix/uiproxy/WebSocketProxyServlet.java", "new_path": null, "diff": "-package org.modelix.uiproxy;\n-\n-import org.eclipse.jetty.websocket.api.Session;\n-import org.eclipse.jetty.websocket.api.WebSocketAdapter;\n-import org.eclipse.jetty.websocket.api.WebSocketConnectionListener;\n-import org.eclipse.jetty.websocket.api.WebSocketListener;\n-import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;\n-import org.eclipse.jetty.websocket.client.WebSocketClient;\n-import org.eclipse.jetty.websocket.servlet.*;\n-import org.slf4j.Logger;\n-import org.slf4j.LoggerFactory;\n-\n-import java.io.IOException;\n-import java.net.URI;\n-import java.net.URISyntaxException;\n-import java.nio.ByteBuffer;\n-import java.util.concurrent.Future;\n-\n-public abstract class WebSocketProxyServlet extends WebSocketServlet {\n- private static final Logger LOG = LoggerFactory.getLogger(WebSocketProxyServlet.class);\n-\n- protected abstract URI redirect(ServletUpgradeRequest request);\n-\n- @Override\n- public void configure(WebSocketServletFactory factory) {\n- factory.getPolicy().setMaxTextMessageSize(20 * 1024 * 1024);\n- factory.setCreator(new WebSocketCreator() {\n- @Override\n- public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp) {\n- URI redirectURL = redirect(req);\n- if (redirectURL == null) return null;\n- return new WebSocketListener() {\n- private WebSocketClient client = new WebSocketClient();\n- private Session sessionA;\n- private Session sessionB;\n-\n- @Override\n- public void onWebSocketConnect(final Session session) {\n- sessionA = session;\n- try {\n- client.start();\n- client.getPolicy().setMaxTextMessageSize(20 * 1024 * 1024);\n- URI redirectURL = redirect(req);\n- client.connect(new WebSocketListener() {\n- @Override\n- public void onWebSocketBinary(byte[] payload, int offset, int len) {\n-\n- }\n-\n- @Override\n- public void onWebSocketText(String message) {\n- try {\n- sessionA.getRemote().sendString(message);\n- } catch (IOException e) {\n- throw new RuntimeException(e);\n- }\n- }\n-\n- @Override\n- public void onWebSocketClose(int statusCode, String reason) {\n- sessionA.close(statusCode, reason);\n- }\n-\n- @Override\n- public void onWebSocketConnect(Session session) {\n- sessionB = session;\n- }\n-\n- @Override\n- public void onWebSocketError(Throwable cause) {\n- LOG.error(\"\", cause);\n- }\n- }, redirectURL, new ClientUpgradeRequest()).get();\n- } catch (Exception e) {\n- throw new RuntimeException(e);\n- }\n- }\n-\n- @Override\n- public void onWebSocketText(String message) {\n- try {\n- sessionB.getRemote().sendString(message);\n- } catch (IOException e) {\n- throw new RuntimeException(e);\n- }\n- }\n-\n- @Override\n- public void onWebSocketBinary(byte[] payload, int offset, int len) {\n- try {\n- sessionB.getRemote().sendBytes(ByteBuffer.wrap(payload, offset, len));\n- } catch (IOException e) {\n- throw new RuntimeException(e);\n- }\n- }\n-\n- @Override\n- public void onWebSocketClose(int statusCode, String reason) {\n- sessionB.close(statusCode, reason);\n- try {\n- client.stop();\n- } catch (Exception e) {\n- LOG.error(\"\", e);\n- }\n- }\n-\n- @Override\n- public void onWebSocketError(Throwable cause) {\n- LOG.error(\"\", cause);\n- }\n- };\n- }\n- });\n- }\n-}\n" }, { "change_type": "DELETE", "old_path": "ui-proxy/src/main/resources/logback.xml", "new_path": null, "diff": "-<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n-<configuration debug=\"true\">\n- <appender name=\"console\" class=\"ch.qos.logback.core.ConsoleAppender\">\n- <encoder>\n- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>\n- </encoder>\n- </appender>\n-\n- <logger name=\"org.modelix\" level=\"DEBUG\">\n- <appender-ref ref=\"console\"/>\n- </logger>\n-\n- <root level=\"INFO\">\n- <appender-ref ref=\"console\" />\n- </root>\n-</configuration>\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
deleted unused modelix/modelix-uiproxy docker image This allowed to view diffs of MPS models for github pull request. It's not maintained anymore and there is no kubernetes config for it.
426,496
08.02.2023 11:09:02
-3,600
f5a00c7061a344a39637fd473666d220ddc21107
fixed workspace paths
[ { "change_type": "MODIFY", "old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt", "diff": "@@ -662,7 +662,7 @@ fun Application.workspaceManagerModule() {\n}\n}\n- get(\"{workspaceHash}/download-modules/queue\") {\n+ get(\"download-modules/queue\") {\nval workspaceHash = WorkspaceHash(call.parameters[\"workspaceHash\"]!!)\nval job = manager.buildWorkspaceDownloadFileAsync(workspaceHash)\nval respondStatus: suspend (String, String)->Unit = { text, refresh ->\n@@ -697,19 +697,19 @@ fun Application.workspaceManagerModule() {\n}\n}\n- get(\"{workspaceHash}/status\") {\n+ get(\"status\") {\nval workspaceHash = WorkspaceHash(call.parameters[\"workspaceHash\"]!!)\nval job = manager.buildWorkspaceDownloadFileAsync(workspaceHash)\ncall.respondText(job.status.toString(), ContentType.Text.Plain, HttpStatusCode.OK)\n}\n- get(\"{workspaceHash}/output\") {\n+ get(\"output\") {\nval workspaceHash = WorkspaceHash(call.parameters[\"workspaceHash\"]!!)\nval job = manager.buildWorkspaceDownloadFileAsync(workspaceHash)\ncall.respondText(job.output.joinToString(\"\\n\"), ContentType.Text.Plain, HttpStatusCode.OK)\n}\n- get(\"{workspaceHash}/download-modules/workspace.zip\") {\n+ get(\"download-modules/workspace.zip\") {\nval workspaceHash = WorkspaceHash(call.parameters[\"workspaceHash\"]!!)\nval workspace = manager.getWorkspaceForHash(workspaceHash)\nif (workspace == null) {\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
fixed workspace paths
426,496
08.02.2023 15:26:51
-3,600
3aa7e33f153b8c89d0e30b7af0ce10e8d8d5d0d0
MPS didn't start in projector because of the settings migration dialog The renaming of the settings folder didn't work. MPS versions other than 2020.3 didn't start, because MPS asked to import settings from a previous version.
[ { "change_type": "MODIFY", "old_path": "Dockerfile-projector", "new_path": "Dockerfile-projector", "diff": "@@ -8,9 +8,7 @@ COPY build/org.modelix/build/artifacts/org.modelix/plugins/ /mps-plugins/modelix\nRUN /install-plugins.sh /projector/ide/plugins/\nCOPY projector-user-home /home/projector-user\n# rename config directory to match the correct MPS version\n-RUN MPS_VERSION=$(grep \"mpsBootstrapCore.version=\" /projector/ide/build.properties|cut -d'=' -f2) \\\n- cd /home/projector-user/.config/JetBrains/ \\\n- mv \"*\" \"MPS${MPS_VERSION}\"\n+RUN mv \"/home/projector-user/.config/JetBrains/MPSxxxx.x\" \"/home/projector-user/.config/JetBrains/MPS$(grep \"mpsBootstrapCore.version=\" /projector/ide/build.properties|cut -d'=' -f2)\"\nCOPY log.xml /projector/ide/bin/log.xml\nRUN chown -R projector-user:projector-user /home/projector-user\n" }, { "change_type": "RENAME", "old_path": "projector-user-home/.config/JetBrains/MPS2020.3/disabled_plugins.txt", "new_path": "projector-user-home/.config/JetBrains/MPSxxxx.x/disabled_plugins.txt", "diff": "" }, { "change_type": "RENAME", "old_path": "projector-user-home/.config/JetBrains/MPS2020.3/idea.properties", "new_path": "projector-user-home/.config/JetBrains/MPSxxxx.x/idea.properties", "diff": "" }, { "change_type": "RENAME", "old_path": "projector-user-home/.config/JetBrains/MPS2020.3/options/AdditionalLibrariesManager.xml", "new_path": "projector-user-home/.config/JetBrains/MPSxxxx.x/options/AdditionalLibrariesManager.xml", "diff": "" }, { "change_type": "RENAME", "old_path": "projector-user-home/.config/JetBrains/MPS2020.3/options/ide.general.xml", "new_path": "projector-user-home/.config/JetBrains/MPSxxxx.x/options/ide.general.xml", "diff": "" }, { "change_type": "RENAME", "old_path": "projector-user-home/.config/JetBrains/MPS2020.3/options/notifications.xml", "new_path": "projector-user-home/.config/JetBrains/MPSxxxx.x/options/notifications.xml", "diff": "" }, { "change_type": "RENAME", "old_path": "projector-user-home/.config/JetBrains/MPS2020.3/options/path.macros.xml", "new_path": "projector-user-home/.config/JetBrains/MPSxxxx.x/options/path.macros.xml", "diff": "" }, { "change_type": "RENAME", "old_path": "projector-user-home/.config/JetBrains/MPS2020.3/options/recentProjects.xml", "new_path": "projector-user-home/.config/JetBrains/MPSxxxx.x/options/recentProjects.xml", "diff": "" } ]
Kotlin
Apache License 2.0
modelix/modelix
MPS didn't start in projector because of the settings migration dialog The renaming of the settings folder didn't work. MPS versions other than 2020.3 didn't start, because MPS asked to import settings from a previous version.
426,496
08.02.2023 15:28:43
-3,600
169de7bc373c305b67689099b4ee9b808123f441
The workspace-client failed to download the workspace The request didn't include the Authorization header so the access was denied by the workspace-manager.
[ { "change_type": "MODIFY", "old_path": "workspace-client/src/main/kotlin/org/modelix/workspace/client/Main.kt", "new_path": "workspace-client/src/main/kotlin/org/modelix/workspace/client/Main.kt", "diff": "package org.modelix.workspace.client\nimport io.ktor.client.*\n-import io.ktor.client.call.*\nimport io.ktor.client.engine.cio.*\n+import io.ktor.client.plugins.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.http.*\n-import io.ktor.util.*\nimport io.ktor.util.cio.*\nimport io.ktor.utils.io.*\n-import io.ktor.utils.io.jvm.javaio.*\n-import io.ktor.utils.io.jvm.javaio.copyTo\nimport kotlinx.coroutines.delay\nimport kotlinx.coroutines.runBlocking\nimport org.modelix.workspace.manager.WorkspaceBuildStatus\nimport org.zeroturnaround.zip.ZipUtil\nimport java.io.File\n-import kotlin.math.sign\nfun main(args: Array<String>) {\nprintln(\"env: ${System.getenv()}\")\n@@ -43,7 +39,12 @@ fun main(args: Array<String>) {\nvar serverUrl = propertyOrEnv(\"modelix.workspace.server\", \"http://workspace-manager:28104/\")\nif (!serverUrl.endsWith(\"/\")) serverUrl += \"/\"\n- val httpClient = HttpClient(CIO)\n+ val httpClient = HttpClient(CIO) {\n+ defaultRequest {\n+ bearerAuth(System.getenv(\"INITIAL_JWT_TOKEN\"))\n+ }\n+\n+ }\nval outputFile = File(\"workspace.zip\").absoluteFile\nrunBlocking {\nvar printedLines = 0\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
The workspace-client failed to download the workspace The request didn't include the Authorization header so the access was denied by the workspace-manager.
426,496
08.02.2023 15:29:44
-3,600
da049be3add5fee05f25cbd2273099ad376da832
keycloak was evicted by kubernetes because the ephemeral-storage size wasn't set
[ { "change_type": "MODIFY", "old_path": "helm/modelix/templates/common/keycloak-deployment.yaml", "new_path": "helm/modelix/templates/common/keycloak-deployment.yaml", "diff": "@@ -86,9 +86,11 @@ spec:\nrequests:\nmemory: \"500Mi\"\ncpu: \"0.1\"\n+ ephemeral-storage: 500M\nlimits:\nmemory: \"500Mi\"\ncpu: \"1.0\"\n+ ephemeral-storage: 1G\nvolumeMounts:\n- name: keycloak-volume\nmountPath: /opt/keycloak/data/import\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
keycloak was evicted by kubernetes because the ephemeral-storage size wasn't set
234,912
06.02.2017 15:06:01
-10,800
bc252bf216fcb3ff9143d8a6e7ffcce9a40a33db
Fixed click warnings, updated spec
[ { "change_type": "MODIFY", "old_path": "features/fail_fast_two_schema_errors.yml", "new_path": "features/fail_fast_two_schema_errors.yml", "diff": "@@ -5,6 +5,6 @@ fail_fast_two_schema_errors:\nsource: data/fail_fast_two_schema_errors.csv\nschema: data/test_schema.json\nreport:\n- - [1, 4, 2, 'required-constraint']\n- [1, 4, 3, 'required-constraint']\n- [1, 4, 1, 'non-castable-value']\n+ - [1, 5, 1, 'required-constraint']\n" }, { "change_type": "MODIFY", "old_path": "goodtables/checks/body/non_castable_value.py", "new_path": "goodtables/checks/body/non_castable_value.py", "diff": "@@ -23,6 +23,7 @@ def non_castable_value(errors, columns, row_number, state=None):\n# Add error\nmessage = spec['errors']['non-castable-value']['message']\nmessage = message.format(\n+ value=column['value'],\nrow_number=row_number,\ncolumn_number=column['number'],\nfield_type=column['field'].type,\n" }, { "change_type": "MODIFY", "old_path": "goodtables/cli.py", "new_path": "goodtables/cli.py", "diff": "@@ -8,6 +8,7 @@ import click\nimport json as json_module\nfrom pprint import pformat\nfrom .inspector import Inspector\n+click.disable_unicode_literals_warning = True\n# Module API\n" }, { "change_type": "MODIFY", "old_path": "goodtables/spec.json", "new_path": "goodtables/spec.json", "diff": "{\n- \"version\": \"1.0.0-alpha1\",\n+ \"version\": \"1.0.0-alpha2\",\n\"errors\": {\n\"type\": \"schema\",\n\"context\": \"body\",\n\"weight\": 9,\n- \"message\": \"Row {row_number} has non castable value in column {column_number} (type: {field_type}, format: {field_format})\",\n+ \"message\": \"Row {row_number} has non castable value {value} in column {column_number} (type: {field_type}, format: {field_format})\",\n\"description\": \"\"\n},\n\"unique-constraint\": {\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fixed click warnings, updated spec (#166)
234,912
03.03.2017 17:46:12
-10,800
1d35ef736afcad125b2d6a815a47b20db28a50e0
Disallow shorthand syntax for tables/datapackages presets
[ { "change_type": "MODIFY", "old_path": "examples/datapackages.py", "new_path": "examples/datapackages.py", "diff": "@@ -3,7 +3,7 @@ from goodtables import Inspector\ninspector = Inspector()\nreport = inspector.inspect([\n- 'data/datapackages/valid/datapackage.json',\n+ {'source': 'data/datapackages/valid/datapackage.json'},\n{'source': 'data/datapackages/invalid/datapackage.json'},\n], preset='datapackages')\npprint(report)\n" }, { "change_type": "MODIFY", "old_path": "examples/tables.py", "new_path": "examples/tables.py", "diff": "@@ -3,7 +3,7 @@ from goodtables import Inspector\ninspector = Inspector()\nreport = inspector.inspect([\n- 'data/invalid.csv',\n{'source': 'data/valid.csv', 'schema': {'fields': [{'name': 'id'}, {'name': 'name'}]}},\n+ {'source': 'data/invalid.csv'},\n], preset='tables')\npprint(report)\n" }, { "change_type": "MODIFY", "old_path": "features/datapackages.yml", "new_path": "features/datapackages.yml", "diff": "datapackages:\nsource:\n- - data/datapackages/valid/datapackage.json\n+ - source: data/datapackages/valid/datapackage.json\n- source: data/datapackages/invalid/datapackage.json\npreset: datapackages\nreport:\n" }, { "change_type": "MODIFY", "old_path": "goodtables/presets/datapackages.py", "new_path": "goodtables/presets/datapackages.py", "diff": "@@ -4,7 +4,6 @@ from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n-import six\nfrom copy import deepcopy\nfrom .datapackage import datapackage as datapackage_preset\nfrom ..register import preset\n@@ -20,9 +19,6 @@ def datapackages(items):\n# Add errors, tables\nitems = deepcopy(items)\nfor item in items:\n- if isinstance(item, six.string_types):\n- item_errors, item_tables = datapackage_preset(item)\n- else:\nsource = item.pop('source')\nitem_errors, item_tables = datapackage_preset(source, **item)\nerrors.extend(item_errors)\n" }, { "change_type": "MODIFY", "old_path": "goodtables/presets/tables.py", "new_path": "goodtables/presets/tables.py", "diff": "@@ -4,7 +4,6 @@ from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n-import six\nfrom copy import deepcopy\nfrom .table import table as table_preset\nfrom ..register import preset\n@@ -20,9 +19,6 @@ def tables(items):\n# Add errors, tables\nitems = deepcopy(items)\nfor item in items:\n- if isinstance(item, six.string_types):\n- item_errors, item_tables = table_preset(item)\n- else:\nsource = item.pop('source')\nitem_errors, item_tables = table_preset(source, **item)\nerrors.extend(item_errors)\n" }, { "change_type": "MODIFY", "old_path": "tests/presets/test_datapackages.py", "new_path": "tests/presets/test_datapackages.py", "diff": "@@ -11,7 +11,7 @@ from goodtables import presets\ndef test_datapackages():\nerrors, tables = presets.datapackages([\n- 'data/datapackages/valid/datapackage.json',\n+ {'source': 'data/datapackages/valid/datapackage.json'},\n{'source': 'data/datapackages/invalid/datapackage.json'},\n])\nassert len(errors) == 0\n" }, { "change_type": "MODIFY", "old_path": "tests/presets/test_tables.py", "new_path": "tests/presets/test_tables.py", "diff": "@@ -11,7 +11,7 @@ from goodtables import presets\ndef test_tables():\nerrors, tables = presets.tables([\n- 'data/valid.csv',\n+ {'source': 'data/valid.csv'},\n{'source': 'data/invalid.csv'},\n])\nassert len(errors) == 0\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Disallow shorthand syntax for tables/datapackages presets (#179)
234,912
03.03.2017 21:01:34
-10,800
99a7742a75398436cfd57c2c14ff387101db3aa4
Renamed config to settings in tests
[ { "change_type": "MODIFY", "old_path": "features/fail_fast_two_schema_errors.yml", "new_path": "features/fail_fast_two_schema_errors.yml", "diff": "fail_fast_two_schema_errors:\n- config:\n+ settings:\nchecks: schema\nerror_limit: 3\nsource: data/fail_fast_two_schema_errors.csv\n" }, { "change_type": "MODIFY", "old_path": "features/fail_fast_two_structure_errors.yml", "new_path": "features/fail_fast_two_structure_errors.yml", "diff": "fail_fast_two_structure_errors:\n- config:\n+ settings:\nchecks: structure\nerror_limit: 3\nsource: data/fail_fast_two_structure_errors.csv\n" }, { "change_type": "MODIFY", "old_path": "features/jungle.yml", "new_path": "features/jungle.yml", "diff": "gla-250-report-2013-14-P07:\n- config:\n+ settings:\nerror_limit: 1\nsource: data/jungle/gla-250-report-2013-14-P07.csv\nreport:\n@@ -7,7 +7,7 @@ gla-250-report-2013-14-P07:\ngla-250-report-2014-15-P07:\n- config:\n+ settings:\nerror_limit: 1\nsource: data/jungle/gla-250-report-2014-15-P07.csv\nreport:\n@@ -15,7 +15,7 @@ gla-250-report-2014-15-P07:\ngla-250-report-2014-15-P08:\n- config:\n+ settings:\nerror_limit: 1\nsource: data/jungle/gla-250-report-2014-15-P08.csv\nreport:\n@@ -23,7 +23,7 @@ gla-250-report-2014-15-P08:\nmultilingual:\n- config:\n+ settings:\nerror_limit: 1\nsource: data/jungle/multilingual.xlsx\nreport: []\n" }, { "change_type": "MODIFY", "old_path": "features/row_limit_schema.yml", "new_path": "features/row_limit_schema.yml", "diff": "row_limit_schema:\n- config:\n+ settings:\nchecks: schema\nrow_limit: 3\nsource: data/row_limit_schema.csv\n" }, { "change_type": "MODIFY", "old_path": "features/row_limit_structure.yml", "new_path": "features/row_limit_structure.yml", "diff": "row_limit_structure:\n- config:\n+ settings:\nchecks: structure\nrow_limit: 3\nsource: data/row_limit_structure.csv\n" }, { "change_type": "MODIFY", "old_path": "features/unique_field.yml", "new_path": "features/unique_field.yml", "diff": "unique_field:\n- config:\n+ settings:\nchecks: schema\nsource: data/unique_field.csv\nschema: data/unique_field.json\n" }, { "change_type": "MODIFY", "old_path": "tests/test_features.py", "new_path": "tests/test_features.py", "diff": "@@ -8,7 +8,7 @@ from goodtables import Inspector\ndef test_features(log, name, feature):\n- inspector = Inspector(**feature.pop('config', {}))\n+ inspector = Inspector(**feature.pop('settings', {}))\nexpect = list(map(lambda item: tuple(item), feature.pop('report')))\nactual = log(inspector.inspect(**feature))\nassert actual == expect\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Renamed config to settings in tests (#183)
234,912
16.06.2017 12:11:12
-10,800
7595666513b22861df01d41315bb0cfb6729a285
Fixed invalid json error for table preset
[ { "change_type": "MODIFY", "old_path": "goodtables/presets/table.py", "new_path": "goodtables/presets/table.py", "diff": "@@ -39,6 +39,10 @@ def table(source, schema=None, **options):\nwarnings.append(\n'Table schema \"%s\" has a validation error \"%s\"' %\n(schema, str(error).splitlines()[0]))\n+ except Exception as error:\n+ warnings.append(\n+ 'Table Schema \"%s\" has a loading error \"%s\"' %\n+ (schema, error))\n# Add table\nif not warnings:\n" }, { "change_type": "MODIFY", "old_path": "tests/presets/test_table.py", "new_path": "tests/presets/test_table.py", "diff": "@@ -20,3 +20,10 @@ def test_preset_table_but_got_datapackage_issue_187():\nassert len(warnings) == 1\nassert len(tables) == 0\nassert 'Use \"datapackage\" preset' in warnings[0]\n+\n+\n+def test_preset_table_invalid_json_issue_196():\n+ warnings, tables = presets.table('valid.csv', schema='data/invalid_json.json')\n+ assert len(warnings) == 1\n+ assert len(tables) == 0\n+ assert 'has a loading error' in warnings[0]\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fixed invalid json error for table preset (#197)
234,912
20.09.2017 19:36:09
-10,800
9a73f4c0e9c6d4bc51a088e21c2d3f1b08dcef14
Improved validation error messages Improved validation error messages
[ { "change_type": "MODIFY", "old_path": "goodtables/inspector.py", "new_path": "goodtables/inspector.py", "diff": "@@ -302,7 +302,7 @@ def _compose_error_from_exception(exception):\ndef _compose_error_from_schema_error(error):\ncode = 'schema-error'\n- message = 'Table Schema error: %s' % error.message\n+ message = 'Table Schema error: %s' % error\nreturn {\n'row': None,\n'code': code,\n" }, { "change_type": "MODIFY", "old_path": "goodtables/presets/datapackage.py", "new_path": "goodtables/presets/datapackage.py", "diff": "@@ -43,7 +43,7 @@ def datapackage(source, **options):\nfor error in package.errors:\nwarnings.append(\n'Data Package \"%s\" has a validation error \"%s\"' %\n- (source, error.message))\n+ (source, error))\nreturn warnings, tables\n" }, { "change_type": "MODIFY", "old_path": "setup.py", "new_path": "setup.py", "diff": "@@ -27,8 +27,8 @@ INSTALL_REQUIRES = [\n'simpleeval>=0.9,<2.0',\n'statistics>=1.0,<2.0',\n'tabulator>=1.3,<2.0',\n- 'tableschema>=1.0,<2.0',\n- 'datapackage>=1.0,<2.0',\n+ 'tableschema>=1.0.3,<2.0',\n+ 'datapackage>=1.0.4,<2.0',\n]\nINSTALL_FORMAT_ODS_REQUIRES = [\n'ezodf>=0.3,<2.0',\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Improved validation error messages (#220) Improved validation error messages
234,902
05.10.2017 10:17:35
14,400
440ae72e11c3785ac81a4c8b3e1c24af26a5a43f
Fix off-by-one errors in extra_header check Comparison misses the edge case where the extra column has data in it Resulting assignment does not account for the fact that the column numbers are 1-indexed while python lists are 0-indexed.
[ { "change_type": "MODIFY", "old_path": "goodtables/checks/extra_header.py", "new_path": "goodtables/checks/extra_header.py", "diff": "@@ -31,8 +31,8 @@ class ExtraHeader(object):\ncolumn_sample = []\nfor row in sample:\nvalue = None\n- if len(row) > cell['number']:\n- value = row[cell['number']]\n+ if len(row) >= cell['number']:\n+ value = row[cell['number'] - 1]\ncolumn_sample.append(value)\nschema = Schema()\nschema.infer(column_sample, headers=[cell['header']])\n" }, { "change_type": "MODIFY", "old_path": "tests/checks/test_extra_header.py", "new_path": "tests/checks/test_extra_header.py", "diff": "@@ -44,6 +44,28 @@ def test_check_extra_header_infer(log):\nassert cells[1]['field'].name == 'name2'\n+def test_check_extra_header_infer_with_data(log):\n+ errors = []\n+ cells = [\n+ {'number': 1,\n+ 'header': 'name1',\n+ 'field': Field({'name': 'name1'})},\n+ {'number': 2,\n+ 'header': 'name2'},\n+ ]\n+ sample = [\n+ ['123', 'abc'],\n+ ['456', 'def'],\n+ ['789', 'ghi'],\n+ ]\n+ extra_header = ExtraHeader(infer_fields=True)\n+ extra_header.check_headers(errors, cells, sample=sample)\n+ assert log(errors) == []\n+ assert len(cells) == 2\n+ assert cells[1]['field'].name == 'name2'\n+ assert cells[1]['field'].type == 'string'\n+\n+\ndef test_check_extra_header_problem(log):\nerrors = []\ncells = [\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fix off-by-one errors in extra_header check (#223) Comparison misses the edge case where the extra column has data in it Resulting assignment does not account for the fact that the column numbers are 1-indexed while python lists are 0-indexed.
234,912
05.10.2017 18:19:03
-10,800
bf0ac009a64efd316a216c7fe6eaa16dd7862948
Added support for pathlib.Path
[ { "change_type": "MODIFY", "old_path": "goodtables/validate.py", "new_path": "goodtables/validate.py", "diff": "@@ -28,6 +28,15 @@ def validate(source, **options):\nsettings['custom_checks'] = options.pop('custom_checks', None)\nsettings = {key: value for key, value in settings.items() if value is not None}\n+ # Support for pathlib.Path\n+ if hasattr(source, 'joinpath'):\n+ source = str(source)\n+ if isinstance(source, list):\n+ if source and isinstance(source[0], dict) and 'source' in source[0]:\n+ for index, item in enumerate(source):\n+ if hasattr(item['source'], 'joinpath'):\n+ source[index]['source'] = str(item['source'])\n+\n# Extract/infer preset\npreset = options.pop('preset', None)\nif preset is None:\n" }, { "change_type": "MODIFY", "old_path": "tests/test_validate.py", "new_path": "tests/test_validate.py", "diff": "@@ -4,8 +4,10 @@ from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n+import sys\nimport json\nimport pytest\n+from importlib import import_module\nfrom goodtables import validate\n@@ -123,6 +125,24 @@ def test_validate_datapackage_dialect_header_false(log):\nassert log(report) == []\n+# Source as pathlib.Path\n+\[email protected](sys.version_info < (3, 4), reason='not supported')\n+def test_source_pathlib_path_table():\n+ pathlib = import_module('pathlib')\n+ report = validate(pathlib.Path('data/valid.csv'))\n+ assert report['table-count'] == 1\n+ assert report['valid']\n+\n+\[email protected](sys.version_info < (3, 4), reason='not supported')\n+def test_source_pathlib_path_datapackage():\n+ pathlib = import_module('pathlib')\n+ report = validate(pathlib.Path('data/datapackages/valid/datapackage.json'))\n+ assert report['table-count'] == 2\n+ assert report['valid']\n+\n+\n# Issues\ndef test_composite_primary_key_unique_issue_215(log):\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Added support for pathlib.Path (#224)
234,918
12.04.2018 11:21:57
-10,800
cc8df70e9de9e2e85864511811025dc712af7819
Fix Markdown description on PyPI * Rebase on MD long_description * v2.0.2 * Revert "v2.0.2" This reverts commit
[ { "change_type": "MODIFY", "old_path": ".travis.yml", "new_path": ".travis.yml", "diff": "sudo:\n- required\n-\n-dist:\n- trusty\n-\n-addons:\n- apt:\n- packages:\n- - pandoc\n+ false\nlanguage:\npython\n@@ -35,11 +27,6 @@ script:\nafter_success:\n- coveralls\n-before_deploy:\n- - pandoc --version\n- - pandoc -f markdown_github -t rst -o README.rst README.md\n- - mv README.rst README.md\n-\ndeploy:\nprovider: pypi\nuser: roll\n" }, { "change_type": "MODIFY", "old_path": "setup.py", "new_path": "setup.py", "diff": "@@ -62,6 +62,7 @@ setup(\n},\nzip_safe=False,\nlong_description=README,\n+ long_description_content_type='text/markdown',\ndescription='Goodtables is a framework to inspect tabular data.',\nauthor='Open Knowledge International',\nauthor_email='[email protected]',\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fix Markdown description on PyPI (#266) * Rebase on MD long_description * v2.0.2 * Revert "v2.0.2" This reverts commit 23e74fbbb2dc539fd830fc877853dc5de040c044.
234,898
29.08.2018 20:08:32
-43,200
4a8608033da5559d06183fc8432650aa84d0b4e1
Correct typo in blacklisted values example
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -160,7 +160,7 @@ Let's check that the `name` column doesn't contain rows with `bug` or `bad`:\nfrom goodtables import validate\nreport = validate('data.csv', checks=[\n- {'blacklisted-value': {'column': 'id', 'blacklist': ['bug', 'bad']}},\n+ {'blacklisted-value': {'column': 'name', 'blacklist': ['bug', 'bad']}},\n])\n# error on row 3 with code \"blacklisted-value\"\n# error on row 4 with code \"blacklisted-value\"\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Correct typo in blacklisted values example (#275)
234,919
03.06.2019 14:23:19
-7,200
4814dba9d13728c5770808b88ceb5fba991f02a7
Allow headers containing None values to appear in report
[ { "change_type": "MODIFY", "old_path": "goodtables/inspector.py", "new_path": "goodtables/inspector.py", "diff": "@@ -261,7 +261,7 @@ class Inspector(object):\nstop = datetime.datetime.now()\n# Compose report\n- headers = headers if None not in headers else None\n+ headers = headers if any(elt is not None for elt in headers) else None\nif self.__error_limit != float('inf'):\nerrors = errors[:self.__error_limit]\nerrors = sorted(errors)\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Allow headers containing None values to appear in report (#295)
234,919
03.06.2019 14:27:59
-7,200
13ff658adeabb68679df671908ab3fd9176b434e
Avoid AttributeError in pattern-constraint filter
[ { "change_type": "MODIFY", "old_path": "goodtables/checks/pattern_constraint.py", "new_path": "goodtables/checks/pattern_constraint.py", "diff": "@@ -16,6 +16,7 @@ def pattern_constraint(cells):\nfor error in errors:\n# No reason to run other checks in this cell\n+ if hasattr(error, 'cell'):\ncells.remove(error.cell)\nreturn errors\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Avoid AttributeError in pattern-constraint filter (#296)
234,910
30.10.2019 04:14:56
21,600
17ad677d778db867dbdff59022cb1fdfb0e6a329
Return file not found error if local file does not exist
[ { "change_type": "MODIFY", "old_path": "goodtables/inspector.py", "new_path": "goodtables/inspector.py", "diff": "@@ -4,6 +4,12 @@ from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n+import os\n+try:\n+ from urllib.parse import urlparse\n+except ImportError:\n+ from urlparse import urlparse\n+\nimport six\nimport datetime\nimport operator\n@@ -174,6 +180,9 @@ class Inspector(object):\nif schema is None:\nchecks = _filter_checks(checks, type='schema', inverse=True)\nexcept Exception as exception:\n+ if _local_file_not_found(source):\n+ message = \"No such file or directory: '%s'\" % source\n+ exception = tabulator.exceptions.SourceError(message)\nfatal_error = True\nerror = _compose_error_from_exception(exception)\nerrors.append(error)\n@@ -309,6 +318,11 @@ def _filter_checks(checks, type=None, context=None, inverse=False):\nreturn result\n+def _local_file_not_found(source):\n+ return urlparse(source).scheme == '' \\\n+ and not os.path.isfile(source)\n+\n+\ndef _compose_error_from_exception(exception):\ncode = 'source-error'\nmessage = str(exception)\n" }, { "change_type": "MODIFY", "old_path": "tests/test_inspector.py", "new_path": "tests/test_inspector.py", "diff": "@@ -122,6 +122,13 @@ def test_inspector_catch_all_iter_exceptions(log):\n]\n+def test_inspector_missing_local_file_raises_source_error_issue_315(log):\n+ inspector = Inspector()\n+ report = inspector.inspect([{'source': 'invalid'}])\n+ assert log(report) == [\n+ (1, None, None, 'source-error'),\n+ ]\n+\n# Warnings\ndef test_inspector_warnings_no():\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Return file not found error if local file does not exist (#315)
234,909
09.03.2020 07:59:11
14,400
4c606d428ecff5c860d1d8fec72f38207746d496
Unique constraint: fix cache usage and improve an error message
[ { "change_type": "MODIFY", "old_path": "goodtables/checks/unique_constraint.py", "new_path": "goodtables/checks/unique_constraint.py", "diff": "@@ -4,12 +4,15 @@ from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n+from collections import defaultdict\n+\nfrom ..registry import check\nfrom ..error import Error\n# Module API\n+\n@check('unique-constraint')\nclass UniqueConstraint(object):\n@@ -37,9 +40,19 @@ class UniqueConstraint(object):\nall_values_are_none = (set(column_values) == {None})\nif not all_values_are_none:\n- if column_values in cache['data']:\n+ if len(cache[column_values]) > 0:\n+ if len(cache[column_values]) <= 5:\nmessage_substitutions = {\n- 'row_numbers': ', '.join(map(str, cache['refs'] + [row_number])),\n+ \"row_numbers\": \", \".join(\n+ map(str, cache[column_values] + [row_number])\n+ ),\n+ }\n+ else:\n+ message_substitutions = {\n+ \"row_numbers\": \"{rows} and {count} others\".format(\n+ rows=\", \".join(map(str, cache[column_values][:3] + [row_number])),\n+ count=len(cache[column_values]) - 4\n+ )\n}\n# FIXME: The unique constraint can be related to multiple\n@@ -51,8 +64,7 @@ class UniqueConstraint(object):\nmessage_substitutions=message_substitutions\n)\nerrors.append(error)\n- cache['data'].add(column_values)\n- cache['refs'].append(row_number)\n+ cache[column_values].append(row_number)\nreturn errors\n@@ -71,16 +83,10 @@ def _create_unique_fields_cache(cells):\nif field.descriptor.get('primaryKey'):\nprimary_key_column_numbers.append(column_number)\nif field.constraints.get('unique'):\n- cache[tuple([column_number])] = {\n- 'data': set(),\n- 'refs': [],\n- }\n+ cache[tuple([column_number])] = defaultdict(list)\n# Primary key\nif primary_key_column_numbers:\n- cache[tuple(primary_key_column_numbers)] = {\n- 'data': set(),\n- 'refs': [],\n- }\n+ cache[tuple(primary_key_column_numbers)] = defaultdict(list)\nreturn cache\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Unique constraint: fix cache usage and improve an error message (#334) Co-authored-by: roll <[email protected]>
234,889
16.03.2020 08:32:23
-3,600
64758803d156c71d3ffcd66c72685540a2f56e0d
Fixed bug where check.position argument validation was breaking the actual check registration in place. position variable was being ovewriten as list but the following lines were expecting the original string format <before|after>:<check_name>
[ { "change_type": "MODIFY", "old_path": "goodtables/registry.py", "new_path": "goodtables/registry.py", "diff": "@@ -99,9 +99,9 @@ class Registry(object):\n# Validate position\nif position:\ntry:\n- position = position.split(':', 1)\n- assert position[0] in ['before', 'after']\n- assert self.__checks.get(position[1])\n+ position_args = position.split(':', 1)\n+ assert position_args[0] in ['before', 'after']\n+ assert self.__checks.get(position_args[1])\nexcept (TypeError, AssertionError):\nmessage = 'Check \"%s\" has been registered at invalid position \"%s\"'\nraise exceptions.GoodtablesException(message % (name, position))\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fixed bug where check.position argument validation was breaking the actual check registration in place. (#339) position variable was being ovewriten as list but the following lines were expecting the original string format <before|after>:<check_name>
234,897
22.04.2020 09:23:01
14,400
6014181e3bd2b4bb023a17c483350960efa4525e
Fixes the test scenarios' names I gave these scenarios unique names (to match their YAML file names) and updated missing_headers.yml to expect the errors in the data and schema.
[ { "change_type": "MODIFY", "old_path": "tests/scenarios/missing_headers.yml", "new_path": "tests/scenarios/missing_headers.yml", "diff": "-primary_key_field:\n+missing_headers:\nsource:\n- [id, last_name, first_name, language]\n- [1, Alex, John, English]\n@@ -17,4 +17,6 @@ primary_key_field:\n- structure\norder_fields: true\nreport:\n- - [1, null, 5, 'missing-header']\n+ - [1, null, null, 'missing-header']\n+ - [1, null, 4, 'non-matching-header']\n+ - [1, null, 5, 'extra-header']\n" }, { "change_type": "MODIFY", "old_path": "tests/scenarios/multipart.yml", "new_path": "tests/scenarios/multipart.yml", "diff": "-datapackages:\n+multipart:\nsource: data/datapackages/multipart/datapackage.json\npreset: datapackage\nreport:\n" }, { "change_type": "MODIFY", "old_path": "tests/scenarios/primary_key_fields.yml", "new_path": "tests/scenarios/primary_key_fields.yml", "diff": "-primary_key_field:\n+primary_key_fields:\nsource:\n- [id, name]\n- [1, Alex']\n" }, { "change_type": "MODIFY", "old_path": "tests/scenarios/reordered_headers_with_missing_header_and_extra_header.yml", "new_path": "tests/scenarios/reordered_headers_with_missing_header_and_extra_header.yml", "diff": "-primary_key_field:\n+reordered_headers_with_missing_header_and_extra_header:\nsource:\n- [LastName, FirstName, Address]\n- [Test, Tester, 23 Avenue]\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fixes the test scenarios' names (#355) I gave these scenarios unique names (to match their YAML file names) and updated missing_headers.yml to expect the errors in the data and schema.
234,912
24.04.2020 10:51:52
-10,800
88af7cde188346121d077db6111eb334caab6176
Fixed AttributeError if a field's type is not supported
[ { "change_type": "MODIFY", "old_path": "setup.py", "new_path": "setup.py", "diff": "@@ -28,7 +28,7 @@ INSTALL_REQUIRES = [\n'simpleeval>=0.9',\n'statistics>=1.0',\n'tabulator>=1.29',\n- 'tableschema>=1.16',\n+ 'tableschema>=1.16.1',\n'datapackage>=1.10',\n]\nINSTALL_FORMAT_ODS_REQUIRES = [\n" }, { "change_type": "MODIFY", "old_path": "tests/test_validate.py", "new_path": "tests/test_validate.py", "diff": "@@ -431,3 +431,16 @@ def test_validate_fails_with_wrong_encoding_issue_274(log):\n# For now, by default encoding is detected incorectly by chardet\nreport = validate('data/encoding-274.csv', encoding='utf-8')\nassert report['valid']\n+\n+\n+def test_validate_invalid_table_schema_issue_304(log):\n+ source = [\n+ ['name', 'age'],\n+ ['Alex', '33'],\n+ ]\n+ schema = {'fields': [\n+ {'name': 'name'},\n+ {'name': 'age', 'type': 'bad'},\n+ ]}\n+ report = validate(source, schema=schema)\n+ assert not report['valid']\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fixed AttributeError if a field's type is not supported (#358)
234,912
27.04.2020 10:57:48
-10,800
dc89fa1f407a766e521388a43f4938b226b75c48
Fix minor table tests
[ { "change_type": "MODIFY", "old_path": "tests/presets/test_nested.py", "new_path": "tests/presets/test_nested.py", "diff": "@@ -21,6 +21,7 @@ def test_validate_tables_invalid(log):\n], preset='nested', infer_schema=True)\nassert log(report) == [\n(2, None, 3, 'blank-header'),\n+ (2, None, 3, 'non-matching-header'),\n(2, None, 4, 'duplicate-header'),\n(2, 2, 3, 'missing-value'),\n(2, 2, 4, 'missing-value'),\n" }, { "change_type": "MODIFY", "old_path": "tests/presets/test_table.py", "new_path": "tests/presets/test_table.py", "diff": "@@ -20,6 +20,7 @@ def test_validate_table_invalid(log):\nreport = validate('data/invalid.csv', infer_schema=True)\nassert log(report) == [\n(1, None, 3, 'blank-header'),\n+ (1, None, 3, 'non-matching-header'),\n(1, None, 4, 'duplicate-header'),\n(1, 2, 3, 'missing-value'),\n(1, 2, 4, 'missing-value'),\n@@ -41,6 +42,7 @@ def test_validate_table_invalid_row_limit(log):\nreport = validate('data/invalid.csv', row_limit=2, infer_schema=True)\nassert log(report) == [\n(1, None, 3, 'blank-header'),\n+ (1, None, 3, 'non-matching-header'),\n(1, None, 4, 'duplicate-header'),\n(1, 2, 3, 'missing-value'),\n(1, 2, 4, 'missing-value'),\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fix minor table tests (#360)
234,912
27.04.2020 16:14:27
-10,800
3a029960b9b154fb539c41e224522760a728c263
Fix an invalid reference table raises an exception in the FK check
[ { "change_type": "MODIFY", "old_path": "goodtables/contrib/checks/foreign_key.py", "new_path": "goodtables/contrib/checks/foreign_key.py", "diff": "@@ -5,9 +5,9 @@ from __future__ import absolute_import\nfrom __future__ import unicode_literals\nimport json\n+import datapackage\nfrom copy import deepcopy\nfrom collections import defaultdict\n-from datapackage import Package\nfrom ...registry import check\nfrom ...error import Error\n@@ -33,7 +33,7 @@ class ForeignKey(object):\ndescriptor = extra['datapackage']\nif descriptor.strip().startswith('{'):\ndescriptor = json.loads(descriptor)\n- self.__package = Package(descriptor)\n+ self.__package = datapackage.Package(descriptor)\n# Prepare schema\nif not schema:\n@@ -43,16 +43,35 @@ class ForeignKey(object):\nself.__schema = schema\n# Prepare foreign keys values\n- relations = _get_relations(\n+ try:\n+ self.__relations = _get_relations(\nself.__package, self.__schema,\ncurrent_resource_name=extra['resource-name'])\nself.__foreign_keys_values = _get_foreign_keys_values(\n- self.__schema, relations)\n+ self.__schema, self.__relations)\n+ self.__relations_exception = None\n+ except _ReferenceTableError as exception:\n+ self.__relations_exception = exception\nreturn True\ndef check_row(self, cells):\nrow_number = cells[0]['row-number']\n+ errors = []\n+\n+ # We DON'T have relations to validate\n+ if self.__relations_exception:\n+\n+ # Add a reference error\n+ message = 'Foreign key violation caused by invalid reference table: %s'\n+ errors.append(Error(\n+ self.__code,\n+ row_number=row_number,\n+ message=message % self.__relations_exception,\n+ ))\n+\n+ # We have relations to validate\n+ else:\n# Prepare keyed_row\nkeyed_row = {}\n@@ -61,7 +80,6 @@ class ForeignKey(object):\nkeyed_row[cell.get('field').name] = cell.get('value')\n# Resolve relations\n- errors = []\nfor foreign_key in self.__schema.foreign_keys:\nsuccess = _resolve_relations(\ndeepcopy(keyed_row), self.__foreign_keys_values, foreign_key)\n@@ -78,6 +96,7 @@ class ForeignKey(object):\nerror_cell = cell\nbreak\n+ # Add an error\nerrors.append(Error(\nself.__code,\ncell=error_cell,\n@@ -118,13 +137,17 @@ def _get_relations(package, schema, current_resource_name=None):\ndescriptor = package_name\nif not descriptor.startswith('http'):\ndescriptor = '/'.join([package.base_path, package_name])\n- package = Package(descriptor)\n+ package = datapackage.Package(descriptor)\nresource = package.get_resource(resource_name)\n# Add to relations (can be None)\nrelations[resource_name] = resource\nif resource and resource.tabular:\n+ try:\nrelations[resource_name] = resource.read(keyed=True)\n+ # TODO: datapackage should raise `IntegrityError` here\n+ except datapackage.exceptions.CastError as exception:\n+ raise _ReferenceTableError('[%s] %s' % (resource_name, str(exception)))\nreturn relations\n@@ -177,3 +200,7 @@ def _resolve_relations(keyed_row, foreign_keys_values, foreign_key):\nelse:\n# empty values for all keys, return original values\nreturn keyed_row\n+\n+\n+class _ReferenceTableError(Exception):\n+ pass\n" }, { "change_type": "MODIFY", "old_path": "tests/test_validate.py", "new_path": "tests/test_validate.py", "diff": "@@ -484,3 +484,56 @@ def test_validate_inline_no_format_issue_349(log):\nerror = report['tables'][0]['errors'][0]\nassert error['code'] == 'format-error'\nassert error['message'] == 'Format \"None\" is not supported'\n+\n+\n+def test_validate_fk_invalid_reference_table_issue_347(log):\n+ descriptor = {\n+ 'resources': [\n+ {\n+ 'name': 'people',\n+ 'data': [\n+ ['id', 'name', 'surname'],\n+ ['p1', 'Tom', 'Hanks'],\n+ ['p2', 'Meryl', 'Streep']\n+ ],\n+ 'schema': {\n+ 'fields': [\n+ {'name': 'id', 'type': 'string'},\n+ {'name': 'name', 'type': 'string'},\n+ {'name': 'surname', 'type': 'string'},\n+ {'name': 'dob', 'type': 'date'}\n+ ]\n+ }\n+ },\n+ {\n+ 'name': 'oscars',\n+ 'data': [\n+ ['person_id', 'category', 'year', 'work'],\n+ ['p1', 'Best Actor', 1994, 'Philadelphia'],\n+ ['p1', 'Best Actor', 1995, 'Forrest Gump'],\n+ ['p2', 'Best Supporting Actress', 1980, 'Kramer vs. Kramer'],\n+ ['p2', 'Best Actress', 1982, 'Sophie\"s Choice'],\n+ ['p2', 'Best Actress', 2012, 'The Iron Lady'],\n+ ['p3', 'Best Actor', 2019, 'Joker']\n+ ],\n+ 'schema': {\n+ 'fields': [\n+ {'name': 'person_id', 'type': 'string'},\n+ {'name': 'category', 'type': 'string'},\n+ {'name': 'year', 'type': 'year'},\n+ {'name': 'work', 'type': 'string'},\n+ ],\n+ 'foreignKeys': [\n+ {\n+ 'fields': 'person_id',\n+ 'reference': {'resource': 'people', 'fields': 'id'}\n+ }\n+ ]\n+ }\n+ }\n+ ]\n+ }\n+ report = validate(descriptor, checks=['structure', 'schema', 'foreign-key'])\n+ assert report['tables'][1]['error-count'] == 6\n+ assert report['tables'][1]['errors'][0]['code'] == 'foreign-key'\n+ assert report['tables'][1]['errors'][0]['message'] == 'Foreign key violation caused by invalid reference table: [people] Row length 3 doesn\\'t match fields count 4 for row \"2\"'\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fix an invalid reference table raises an exception in the FK check (#365)
234,912
21.09.2020 14:06:58
-10,800
46777738fa557850aa6f3e518f03b5631c0bf1a5
Improved the migration note
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "Frictionless is a framework to describe, extract, validate, and transform tabular data. It supports a great deal of data sources and formats, as well as provides popular platforms integrations. The framework is powered by the lightweight yet comprehensive [Frictionless Data Specifications](https://specs.frictionlessdata.io/).\n-> Since version 3 `goodtables` was renamed to `frictionless`. The framework got various improvements and was extended to be a complete data solution. The change in not breaking for the existing software so no actions are required. We continue to maintain [Goodtables Branch](https://github.com/frictionlessdata/goodtables-py/tree/goodtables) in this repo in bug-fixing mode as well as it's available on PyPi as `goodtables`. Please read the [Migration Guide](https://github.com/frictionlessdata/frictionless-py/blob/master/docs/target/migration-guide/README.md) to start working with the newer Frictionless for Python. Please note that `[email protected]` version's API, available at the moment, is not stable. We will release `frictionless@4` by the end of 2020 to be the first SemVer/stable version of the framework.\n+> Since version 3 `goodtables` was renamed to `frictionless`. The framework got various improvements and was extended to be a complete data solution. The change in not breaking for the existing software so no actions are required. Please read the [Migration Guide](https://github.com/frictionlessdata/frictionless-py/blob/master/docs/target/migration-guide/README.md) to start working with the newer Frictionless for Python. Here is some importante information:\n+- we continue to bug-fix `[email protected]` in this [branch](https://github.com/frictionlessdata/goodtables-py/tree/goodtables) as well as it's available on [PyPi](https://pypi.org/project/goodtables/) as it was before\n+- please note that `[email protected]` version's API, we're working on at the moment, is not stable\n+- we will release `[email protected]` by the end of 2020 to be the first SemVer/stable version\n## Purpose\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Improved the migration note
234,912
21.09.2020 14:10:53
-10,800
caa67fa308c02fc52af43dd973df3942ad17514a
Improved readme's readability
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "Frictionless is a framework to describe, extract, validate, and transform tabular data. It supports a great deal of data sources and formats, as well as provides popular platforms integrations. The framework is powered by the lightweight yet comprehensive [Frictionless Data Specifications](https://specs.frictionlessdata.io/).\n-> Since version 3 `goodtables` was renamed to `frictionless`. The framework got various improvements and was extended to be a complete data solution. The change in not breaking for the existing software so no actions are required. Please read the [Migration Guide](https://github.com/frictionlessdata/frictionless-py/blob/master/docs/target/migration-guide/README.md) to start working with the newer Frictionless for Python. Here is some importante information:\n+> **[Important Notice]** `goodtables` was renamed to `frictionless` since version 3. The framework got various improvements and was extended to be a complete data solution. The change in not breaking for the existing software so no actions are required. Please read the [Migration Guide](https://github.com/frictionlessdata/frictionless-py/blob/master/docs/target/migration-guide/README.md) to start working with the newer Frictionless for Python. Here is some importante information:\n> - we continue to bug-fix `[email protected]` in this [branch](https://github.com/frictionlessdata/goodtables-py/tree/goodtables) as well as it's available on [PyPi](https://pypi.org/project/goodtables/) as it was before\n> - please note that `[email protected]` version's API, we're working on at the moment, is not stable\n> - we will release `[email protected]` by the end of 2020 to be the first SemVer/stable version\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Improved readme's readability
234,912
28.09.2020 14:45:16
-10,800
4a1ddfde820f05c7a73140ce9b4273aaa0d6aa97
Added stream argument to the extract functions
[ { "change_type": "MODIFY", "old_path": "frictionless/extract/main.py", "new_path": "frictionless/extract/main.py", "diff": "@@ -6,9 +6,8 @@ from ..package import Package\nfrom .. import helpers\n-# NOTE: ability to extract stream?\n-def extract(source, *, source_type=None, process=None, **options):\n- \"\"\"Extract resource rows into memory\n+def extract(source, *, source_type=None, process=None, stream=False, **options):\n+ \"\"\"Extract resource rows\nAPI | Usage\n-------- | --------\n@@ -18,6 +17,7 @@ def extract(source, *, source_type=None, process=None, **options):\nsource (dict|str): data source\nsource_type (str): source type - package, resource or table\nprocess? (func): a row processor function\n+ stream? (bool): return a row stream(s) instead of loading into memory\n**options (dict): options for the underlaying function\nReturns:\n@@ -46,4 +46,4 @@ def extract(source, *, source_type=None, process=None, **options):\n# Extract source\nextract = getattr(module, \"extract_%s\" % source_type)\n- return extract(source, process=process, **options)\n+ return extract(source, process=process, stream=stream, **options)\n" }, { "change_type": "MODIFY", "old_path": "frictionless/extract/package.py", "new_path": "frictionless/extract/package.py", "diff": "@@ -2,8 +2,8 @@ from collections import OrderedDict\nfrom ..package import Package\n-def extract_package(source, *, process=None):\n- \"\"\"Extract package rows into memory\n+def extract_package(source, *, process=None, stream=False):\n+ \"\"\"Extract package rows\nAPI | Usage\n-------- | --------\n@@ -12,9 +12,10 @@ def extract_package(source, *, process=None):\nParameters:\nsource (dict|str): data resource descriptor\nprocess? (func): a row processor function\n+ stream? (bool): return a row streams instead of loading into memory\nReturns:\n- {path: Row[]}: a dictionary of arrays of rows\n+ {path: Row[]}: a dictionary of arrays/streams of rows\n\"\"\"\n@@ -25,10 +26,7 @@ def extract_package(source, *, process=None):\nresult = OrderedDict()\nfor number, resource in enumerate(package.resources, start=1):\nkey = resource.fullpath if not resource.inline else f\"memory{number}\"\n- if process:\n- result[key] = []\n- for row in resource.read_row_stream():\n- result[key].append(process(row))\n- continue\n- result[key] = resource.read_rows()\n+ data = resource.read_row_stream()\n+ data = (process(row) for row in data) if process else data\n+ result[key] = data if stream else list(data)\nreturn result\n" }, { "change_type": "MODIFY", "old_path": "frictionless/extract/resource.py", "new_path": "frictionless/extract/resource.py", "diff": "from ..resource import Resource\n-def extract_resource(source, *, process=None):\n- \"\"\"Extract resource rows into memory\n+def extract_resource(source, *, process=None, stream=False):\n+ \"\"\"Extract resource rows\nAPI | Usage\n-------- | --------\n@@ -13,7 +13,7 @@ def extract_resource(source, *, process=None):\nprocess? (func): a row processor function\nReturns:\n- Row[]: an array of rows\n+ Row[]: an array/stream of rows\n\"\"\"\n@@ -21,9 +21,6 @@ def extract_resource(source, *, process=None):\nresource = Resource(source)\n# Extract resource\n- if process:\n- result = []\n- for row in resource.read_row_stream():\n- result.append(process(row))\n- return result\n- return resource.read_rows()\n+ data = resource.read_row_stream()\n+ data = (process(row) for row in data) if process else data\n+ return data if stream else list(data)\n" }, { "change_type": "MODIFY", "old_path": "frictionless/extract/table.py", "new_path": "frictionless/extract/table.py", "diff": "@@ -28,8 +28,9 @@ def extract_table(\nlookup=None,\n# Extraction\nprocess=None,\n+ stream=False,\n):\n- \"\"\"Extract table rows into memory\n+ \"\"\"Extract table rows\nAPI | Usage\n-------- | --------\n@@ -112,9 +113,10 @@ def extract_table(\nFor more information, please check \"Extracting Data\" guide.\nprocess? (func): a row processor function\n+ stream? (bool): return a row streams instead of loading into memory\nReturns:\n- Row[]: an array for rows\n+ Row[]: an array/stream of rows\n\"\"\"\n@@ -144,10 +146,15 @@ def extract_table(\n)\n# Extract table\n+ data = read_row_stream(table)\n+ data = (process(row) for row in data) if process else data\n+ return data if stream else list(data)\n+\n+\n+# Internal\n+\n+\n+def read_row_stream(table):\nwith table as table:\n- if process:\n- result = []\nfor row in table.row_stream:\n- result.append(process(row))\n- return result\n- return table.read_rows()\n+ yield row\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Added stream argument to the extract functions (#442)
234,898
02.10.2020 13:43:36
-7,200
bdc8c456d002d8a4e544342bfce7b1ba003c7cdb
Correct typos in Migration Guide
[ { "change_type": "MODIFY", "old_path": "docs/target/migration-guide/README.md", "new_path": "docs/target/migration-guide/README.md", "diff": "[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1eWGtfAgD4mkvyT2BcqU3Y68Yg25ZrlU-)\n-\n-\nFrictionless is a logical continuation of many currently existing packages:\n- goodtables\n- datapackage\n@@ -30,10 +28,9 @@ The Python interface is also mostly identical:\n# Before\nreport = goodtables.validate('table.csv')\n# After\n-report = frictonles.validate('table.csv')\n+report = frictonless.validate('table.csv')\n```\n-\nPlease read the following sections and use `frictionless validate --help` to learn what is the difference in the options and in report's properties.\n### Validate\n@@ -45,7 +42,6 @@ Please read the following sections and use `frictionless validate --help` to lea\n- `row_limit` was replaced by `query` (see \"Table Query)\n- `preset` was replaced by `source_type`\n-\n### Report\n- all the properties now are camelCased instead of being lower-cased\n@@ -124,7 +120,6 @@ field = frictionless.Field('field.json')\n## From tabulator\n-\nFrictionless has `Table` class which is an equivalent of the tabulator's `Stream` class.\n```python\n@@ -136,7 +131,6 @@ with frictionless.Table('table.csv') as table:\nprint(table.read_rows())\n```\n-\n### Table\n- the Table class now always infers `table.schema`\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Correct typos in Migration Guide (#448)
234,912
14.10.2020 13:51:54
-10,800
6337cb7f04e45b5eb24a3431587873d3bc84d124
Added topojson validation
[ { "change_type": "ADD", "old_path": null, "new_path": "frictionless/assets/profiles/topojson.json", "diff": "+{\n+ \"$schema\":\"http://json-schema.org/draft-04/schema#\",\n+ \"title\":\"TopoJSON object\",\n+ \"description\":\"Schema for a TopoJSON object\",\n+ \"type\":\"object\",\n+ \"required\":[\n+ \"type\"\n+ ],\n+ \"properties\":{\n+ \"bbox\":{\n+ \"$ref\":\"#/definitions/bbox\"\n+ }\n+ },\n+ \"oneOf\":[\n+ {\n+ \"$ref\":\"#/definitions/topology\"\n+ },\n+ {\n+ \"$ref\":\"#/definitions/geometry\"\n+ }\n+ ],\n+ \"definitions\":{\n+ \"bbox\":{\n+ \"title\":\"TopoJSON bounding box\",\n+ \"description\":\"A bounding box as defined by TopoJSON\",\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"$ref\":\"#/definitions/bbox/definitions/dimension\"\n+ },\n+ \"minItems\":2,\n+ \"maxItems\":2,\n+ \"definitions\":{\n+ \"dimension\":{\n+ \"type\":\"array\",\n+ \"description\":\"This array should have an entry per dimension in the geometries\",\n+ \"items\":{\n+ \"type\":\"number\"\n+ }\n+ }\n+ }\n+ },\n+ \"geometry\":{\n+ \"title\":\"Geometry objects\",\n+ \"description\":\"A Geometry object as defined by TopoJSON\",\n+ \"type\":\"object\",\n+ \"required\":[\n+ \"type\"\n+ ],\n+ \"properties\":{\n+ \"id\":{\n+ \"type\":[\n+ \"string\",\n+ \"integer\"\n+ ]\n+ },\n+ \"properties\":{\n+ \"type\":\"object\"\n+ }\n+ },\n+ \"oneOf\":[\n+ {\n+ \"title\":\"Point\",\n+ \"description\":\"A Point Geometry object as defined by TopoJSON\",\n+ \"required\":[\n+ \"type\",\n+ \"coordinates\"\n+ ],\n+ \"properties\":{\n+ \"type\":{\n+ \"enum\":[\n+ \"Point\"\n+ ]\n+ },\n+ \"coordinates\":{\n+ \"$ref\":\"#/definitions/geometry/definitions/position\"\n+ }\n+ }\n+ },\n+ {\n+ \"title\":\"MultiPoint\",\n+ \"description\":\"A MultiPoint Geometry object as defined by TopoJSON\",\n+ \"required\":[\n+ \"type\",\n+ \"coordinates\"\n+ ],\n+ \"properties\":{\n+ \"type\":{\n+ \"enum\":[\n+ \"MultiPoint\"\n+ ]\n+ },\n+ \"coordinates\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"$ref\":\"#/definitions/geometry/definitions/position\"\n+ }\n+ }\n+ }\n+ },\n+ {\n+ \"title\":\"LineString\",\n+ \"description\":\"A LineString Geometry object as defined by TopoJSON\",\n+ \"required\":[\n+ \"type\",\n+ \"arcs\"\n+ ],\n+ \"properties\":{\n+ \"type\":{\n+ \"enum\":[\n+ \"LineString\"\n+ ]\n+ },\n+ \"arcs\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"integer\"\n+ }\n+ }\n+ }\n+ },\n+ {\n+ \"title\":\"MultiLineString\",\n+ \"description\":\"A MultiLineString Geometry object as defined by TopoJSON\",\n+ \"required\":[\n+ \"type\",\n+ \"arcs\"\n+ ],\n+ \"properties\":{\n+ \"type\":{\n+ \"enum\":[\n+ \"MultiLineString\"\n+ ]\n+ },\n+ \"arcs\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"integer\"\n+ }\n+ }\n+ }\n+ }\n+ },\n+ {\n+ \"title\":\"Polygon\",\n+ \"description\":\"A Polygon Geometry object as defined by TopoJSON\",\n+ \"required\":[\n+ \"type\",\n+ \"arcs\"\n+ ],\n+ \"properties\":{\n+ \"type\":{\n+ \"enum\":[\n+ \"Polygon\"\n+ ]\n+ },\n+ \"arcs\":{\n+ \"TODO\":\"Check if arcs refer to valid LinearRings\",\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"integer\"\n+ }\n+ }\n+ }\n+ }\n+ },\n+ {\n+ \"title\":\"MultiPolygon\",\n+ \"description\":\"A MultiPolygon Geometry object as defined by TopoJSON\",\n+ \"required\":[\n+ \"type\",\n+ \"arcs\"\n+ ],\n+ \"properties\":{\n+ \"type\":{\n+ \"enum\":[\n+ \"MultiPolygon\"\n+ ]\n+ },\n+ \"arcs\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"integer\"\n+ }\n+ }\n+ }\n+ }\n+ }\n+ },\n+ {\n+ \"title\":\"GeometryCollection\",\n+ \"description\":\"A MultiPolygon Geometry object as defined by TopoJSON\",\n+ \"required\":[\n+ \"type\",\n+ \"geometries\"\n+ ],\n+ \"properties\":{\n+ \"type\":{\n+ \"enum\":[\n+ \"GeometryCollection\"\n+ ]\n+ },\n+ \"geometries\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"$ref\":\"#/definitions/geometry\"\n+ }\n+ }\n+ }\n+ }\n+ ],\n+ \"definitions\":{\n+ \"position\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"number\"\n+ },\n+ \"minItems\":2\n+ }\n+ }\n+\n+ },\n+ \"topology\":{\n+ \"title\":\"Topology\",\n+ \"description\":\"A Topology object as defined by TopoJSON\",\n+ \"type\":\"object\",\n+ \"required\":[\n+ \"objects\",\n+ \"arcs\"\n+ ],\n+ \"properties\":{\n+ \"type\":{\n+ \"enum\":[\n+ \"Topology\"\n+ ]\n+ },\n+ \"objects\":{\n+ \"type\":\"object\",\n+ \"additionalProperties\":{\n+ \"$ref\":\"#/definitions/geometry\"\n+ }\n+ },\n+ \"arcs\":{\n+ \"$ref\":\"#/definitions/topology/definitions/arcs\"\n+ },\n+ \"transform\":{\n+ \"$ref\":\"#/definitions/topology/definitions/transform\"\n+ },\n+ \"bbox\":{\n+ \"$ref\":\"#/definitions/bbox\"\n+ }\n+ },\n+ \"definitions\":{\n+ \"transform\":{\n+ \"type\":\"object\",\n+ \"required\":[\n+ \"scale\",\n+ \"translate\"\n+ ],\n+ \"properties\":{\n+ \"scale\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"number\"\n+ },\n+ \"minItems\":2\n+ },\n+ \"translate\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"number\"\n+ },\n+ \"minItems\":2\n+ }\n+ }\n+ },\n+ \"arcs\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"oneOf\":[\n+ {\n+ \"$ref\":\"#/definitions/topology/definitions/position\"\n+ },\n+ {\n+ \"type\":\"null\"\n+ }\n+ ]\n+ },\n+ \"minItems\":2\n+ }\n+ },\n+ \"position\":{\n+ \"type\":\"array\",\n+ \"items\":{\n+ \"type\":\"number\"\n+ },\n+ \"minItems\":2\n+ }\n+ }\n+ }\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "frictionless/config.py", "new_path": "frictionless/config.py", "diff": "@@ -19,7 +19,6 @@ def read_asset(*paths):\nVERSION = read_asset(\"VERSION\")\nCOMPRESSION_FORMATS = [\"zip\", \"gz\"]\nREMOTE_SCHEMES = [\"http\", \"https\", \"ftp\", \"ftps\"]\n-GEOJSON_PROFILE = json.loads(read_asset(\"profiles\", \"geojson.json\"))\nINQUIRY_PROFILE = json.loads(read_asset(\"profiles\", \"inquiry.json\"))\nREPORT_PROFILE = json.loads(read_asset(\"profiles\", \"report.json\"))\nSCHEMA_PROFILE = json.loads(read_asset(\"profiles\", \"schema.json\"))\n@@ -27,6 +26,8 @@ RESOURCE_PROFILE = json.loads(read_asset(\"profiles\", \"resource\", \"general.json\")\nTABULAR_RESOURCE_PROFILE = json.loads(read_asset(\"profiles\", \"resource\", \"tabular.json\"))\nPACKAGE_PROFILE = json.loads(read_asset(\"profiles\", \"package\", \"general.json\"))\nFISCAL_PACKAGE_PROFILE = json.loads(read_asset(\"profiles\", \"package\", \"fiscal.json\"))\n+TOPOJSON_PROFILE = json.loads(read_asset(\"profiles\", \"topojson.json\"))\n+GEOJSON_PROFILE = json.loads(read_asset(\"profiles\", \"geojson.json\"))\nUNDEFINED = object()\n" }, { "change_type": "MODIFY", "old_path": "frictionless/types/geojson.py", "new_path": "frictionless/types/geojson.py", "diff": "import json\n-import jsonschema\n+from jsonschema.validators import validator_for\nfrom .. import config\nfrom ..type import Type\n@@ -28,13 +28,11 @@ class GeojsonType(Type):\nreturn None\nif not isinstance(cell, dict):\nreturn None\n- if self.field.format == \"default\":\n+ if self.field.format in [\"default\", \"topojson\"]:\ntry:\n- validator.validate(cell)\n+ VALIDATORS[self.field.format].validate(cell)\nexcept Exception:\nreturn None\n- elif self.field.format == \"topojson\":\n- pass # Accept any dict as possibly topojson for now\nreturn cell\n# Write\n@@ -46,6 +44,7 @@ class GeojsonType(Type):\n# Internal\n-validator = jsonschema.validators.validator_for(config.GEOJSON_PROFILE)(\n- config.GEOJSON_PROFILE\n-)\n+VALIDATORS = {\n+ \"default\": validator_for(config.GEOJSON_PROFILE)(config.GEOJSON_PROFILE),\n+ \"topojson\": validator_for(config.TOPOJSON_PROFILE)(config.TOPOJSON_PROFILE),\n+}\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Added topojson validation (#487)
234,912
02.11.2020 17:03:26
-10,800
cc0dde7d926d148f776334d6b43488ec62938d10
Fixed s3 path with spaces problem
[ { "change_type": "MODIFY", "old_path": "frictionless/plugins/aws.py", "new_path": "frictionless/plugins/aws.py", "diff": "import io\nimport os\n-import requests.utils\nfrom urllib.parse import urlparse\nfrom ..controls import Control\nfrom ..plugin import Plugin\n@@ -99,9 +98,8 @@ class S3Loader(Loader):\ndef read_byte_stream_create(self):\nboto3 = helpers.import_from_plugin(\"boto3\", plugin=\"aws\")\n- source = requests.utils.requote_uri(self.resource.source)\ncontrol = self.resource.control\n- parts = urlparse(source, allow_fragments=False)\n+ parts = urlparse(self.resource.source, allow_fragments=False)\nclient = boto3.resource(\"s3\", endpoint_url=control.endpoint_url)\nobject = client.Object(bucket_name=parts.netloc, key=parts.path[1:])\nbyte_stream = S3ByteStream(object)\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fixed s3 path with spaces problem (#502)
234,887
09.11.2020 10:53:28
0
c6d61ab415360da2aacfabc54ba7b336d2606695
Fix some errors in docstrings
[ { "change_type": "MODIFY", "old_path": "frictionless/dialects.py", "new_path": "frictionless/dialects.py", "diff": "@@ -9,7 +9,7 @@ class Dialect(Metadata):\nAPI | Usage\n-------- | --------\n- Public | `from frictionless import dialects`\n+ Public | `from frictionless.dialects import Dialect`\nParameters:\ndescriptor? (str|dict): descriptor\n" }, { "change_type": "MODIFY", "old_path": "frictionless/package.py", "new_path": "frictionless/package.py", "diff": "@@ -321,7 +321,7 @@ class Package(Metadata):\n@staticmethod\ndef from_bigquery(*, service, project, dataset, prefix=\"\"):\n- \"\"\"Import package from SPSS directory\n+ \"\"\"Import package from Bigquery\nParameters:\nservice (object): BigQuery `Service` object\n@@ -428,7 +428,7 @@ class Package(Metadata):\n)\ndef to_bigquery(self, *, service, project, dataset, prefix=\"\", force=False):\n- \"\"\"Export package to SPSS directory\n+ \"\"\"Export package to Bigquery\nParameters:\nservice (object): BigQuery `Service` object\n" }, { "change_type": "MODIFY", "old_path": "frictionless/parsers/csv.py", "new_path": "frictionless/parsers/csv.py", "diff": "@@ -12,7 +12,7 @@ class CsvParser(Parser):\nAPI | Usage\n-------- | --------\n- Public | `from frictionless import parsers`\n+ Public | `from frictionless.parsers import CsvParser`\n\"\"\"\n" }, { "change_type": "MODIFY", "old_path": "frictionless/parsers/excel.py", "new_path": "frictionless/parsers/excel.py", "diff": "@@ -21,7 +21,7 @@ class XlsxParser(Parser):\nAPI | Usage\n-------- | --------\n- Public | `from frictionless import parsers`\n+ Public | `from frictionless.parsers import XlsxParser`\n\"\"\"\n@@ -140,7 +140,7 @@ class XlsParser(Parser):\nAPI | Usage\n-------- | --------\n- Public | `from frictionless import parsers`\n+ Public | `from frictionless.parsers import XlsParser`\n\"\"\"\n" }, { "change_type": "MODIFY", "old_path": "frictionless/parsers/inline.py", "new_path": "frictionless/parsers/inline.py", "diff": "@@ -11,7 +11,7 @@ class InlineParser(Parser):\nAPI | Usage\n-------- | --------\n- Public | `from frictionless import parsers`\n+ Public | `from frictionless.parsers import InlineParser`\n\"\"\"\n" }, { "change_type": "MODIFY", "old_path": "frictionless/parsers/json.py", "new_path": "frictionless/parsers/json.py", "diff": "@@ -16,7 +16,7 @@ class JsonParser(Parser):\nAPI | Usage\n-------- | --------\n- Public | `from frictionless import parser`\n+ Public | `from frictionless.parsers import JsonParser`\n\"\"\"\n@@ -73,7 +73,7 @@ class JsonlParser(Parser):\nAPI | Usage\n-------- | --------\n- Public | `from frictionless import parsers`\n+ Public | `from frictionless.parsers import JsonlParser`\n\"\"\"\n" }, { "change_type": "MODIFY", "old_path": "frictionless/plugins/pandas.py", "new_path": "frictionless/plugins/pandas.py", "diff": "@@ -54,7 +54,7 @@ class PandasPlugin(Plugin):\nclass PandasDialect(Dialect):\n- \"\"\"Tsv dialect representation\n+ \"\"\"Pandas dialect representation\nAPI | Usage\n-------- | --------\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Fix some errors in docstrings (#510)
234,887
09.11.2020 10:58:14
0
71a0ddf624ca701fc48c6683ee126ab9fc592427
add to two SQL tests
[ { "change_type": "MODIFY", "old_path": "tests/plugins/test_sql.py", "new_path": "tests/plugins/test_sql.py", "diff": "@@ -485,6 +485,7 @@ def test_postgresql_storage_constraints_not_valid_error(database_url, field_name\nresource.to_sql(engine=engine, force=True)\[email protected]\ndef test_postgresql_storage_views_support():\nengine = sa.create_engine(os.environ[\"POSTGRESQL_URL\"])\nengine.execute(\"DROP VIEW IF EXISTS data_view\")\n@@ -698,6 +699,7 @@ def test_mysql_storage_constraints_not_valid_error(field_name, cell):\nresource.to_sql(engine=engine, force=True)\[email protected]\ndef test_mysql_storage_views_support():\nengine = sa.create_engine(os.environ[\"MYSQL_URL\"])\nengine.execute(\"DROP VIEW IF EXISTS data_view\")\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
add @pytest.mark.ci to two SQL tests (#509) Co-authored-by: roll <[email protected]>
234,912
09.11.2020 15:31:21
-10,800
90099aa38268175aa9cdf47458949f9e0d4f81d9
Added "nolookup" argument for validate_package
[ { "change_type": "MODIFY", "old_path": "frictionless/validate/package.py", "new_path": "frictionless/validate/package.py", "diff": "@@ -7,7 +7,9 @@ from .. import exceptions\[email protected]_validate\n-def validate_package(source, basepath=None, trusted=False, noinfer=False, **options):\n+def validate_package(\n+ source, basepath=None, trusted=False, noinfer=False, nolookup=False, **options\n+):\n\"\"\"Validate package\nAPI | Usage\n@@ -19,6 +21,7 @@ def validate_package(source, basepath=None, trusted=False, noinfer=False, **opti\nbasepath? (str): package basepath\ntrusted? (bool): don't raise an exception on unsafe paths\nnoinfer? (bool): don't call `package.infer`\n+ nolookup? (bool): don't read lookup tables skipping integrity checks\n**options (dict): options for every extracted table\nReturns:\n@@ -46,7 +49,7 @@ def validate_package(source, basepath=None, trusted=False, noinfer=False, **opti\ndescriptor = {\"tasks\": []}\nfor resource in package.resources:\nif resource.profile == \"tabular-data-resource\":\n- lookup = resource.read_lookup()\n+ lookup = None if nolookup else resource.read_lookup()\ndescriptor[\"tasks\"].append(\nhelpers.create_descriptor(\n**options,\n" }, { "change_type": "MODIFY", "old_path": "tests/validate/test_package.py", "new_path": "tests/validate/test_package.py", "diff": "@@ -309,6 +309,14 @@ def test_validate_integrity_foreign_key_internal_resource_violation_non_existent\n]\[email protected]\n+def test_validate_integrity_foreign_key_internal_resource_violation_with_nolookup():\n+ descriptor = deepcopy(DESCRIPTOR_FK)\n+ del descriptor[\"resources\"][1][\"data\"][4]\n+ report = validate(descriptor, nolookup=True)\n+ assert report.valid\n+\n+\n# Issues\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Added "nolookup" argument for validate_package (#515)
234,912
10.11.2020 15:15:52
-10,800
77fc1fbf352dcfa200ce0c7d5d08a1dee520c844
Added trusted flag to the describe calls
[ { "change_type": "MODIFY", "old_path": "frictionless/describe/package.py", "new_path": "frictionless/describe/package.py", "diff": "@@ -21,7 +21,7 @@ def describe_package(source, *, hashing=None, basepath=None, expand=False):\n\"\"\"\n# Infer package\n- package = Package(hashing=hashing, basepath=basepath)\n+ package = Package(hashing=hashing, basepath=basepath, trusted=True)\npackage.infer(source)\n# Expand package\n" }, { "change_type": "MODIFY", "old_path": "frictionless/describe/resource.py", "new_path": "frictionless/describe/resource.py", "diff": "@@ -142,6 +142,7 @@ def describe_resource(\nschema=table.schema,\nstats=table.stats,\nprofile=\"tabular-data-resource\",\n+ trusted=True,\n)\n# Inline resource\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Added trusted flag to the describe calls (#522)
234,912
11.11.2020 12:12:22
-10,800
91f04f9cb6bcd6fd69e80766248913899eb8742b
Restrict fields/row_limit/offest to minimum 1
[ { "change_type": "MODIFY", "old_path": "frictionless/query.py", "new_path": "frictionless/query.py", "diff": "@@ -170,11 +170,11 @@ class Query(Metadata):\n\"properties\": {\n\"pickFields\": {\"type\": \"array\"},\n\"skipFields\": {\"type\": \"array\"},\n- \"limitFields\": {\"type\": \"number\"},\n- \"offsetFields\": {\"type\": \"number\"},\n+ \"limitFields\": {\"type\": \"number\", \"minimum\": 1},\n+ \"offsetFields\": {\"type\": \"number\", \"minimum\": 1},\n\"pickRows\": {\"type\": \"array\"},\n\"skipRows\": {\"type\": \"array\"},\n- \"limitRows\": {\"type\": \"number\"},\n- \"offsetRows\": {\"type\": \"number\"},\n+ \"limitRows\": {\"type\": \"number\", \"minimum\": 1},\n+ \"offsetRows\": {\"type\": \"number\", \"minimum\": 1},\n},\n}\n" }, { "change_type": "MODIFY", "old_path": "tests/test_table.py", "new_path": "tests/test_table.py", "diff": "@@ -851,6 +851,50 @@ def test_table_limit_offset_rows():\nassert table.read_data() == [[\"3\", \"c\"], [\"4\", \"d\"]]\n+def test_table_limit_fields_error_zero_issue_521():\n+ source = \"data/long.csv\"\n+ query = Query(limit_fields=0)\n+ table = Table(source, query=query)\n+ with pytest.raises(exceptions.FrictionlessException) as excinfo:\n+ table.open()\n+ error = excinfo.value.error\n+ assert error.code == \"query-error\"\n+ assert error.note.count('minimum of 1\" at \"limitFields')\n+\n+\n+def test_table_offset_fields_error_zero_issue_521():\n+ source = \"data/long.csv\"\n+ query = Query(offset_fields=0)\n+ table = Table(source, query=query)\n+ with pytest.raises(exceptions.FrictionlessException) as excinfo:\n+ table.open()\n+ error = excinfo.value.error\n+ assert error.code == \"query-error\"\n+ assert error.note.count('minimum of 1\" at \"offsetFields')\n+\n+\n+def test_table_limit_rows_error_zero_issue_521():\n+ source = \"data/long.csv\"\n+ query = Query(limit_rows=0)\n+ table = Table(source, query=query)\n+ with pytest.raises(exceptions.FrictionlessException) as excinfo:\n+ table.open()\n+ error = excinfo.value.error\n+ assert error.code == \"query-error\"\n+ assert error.note.count('minimum of 1\" at \"limitRows')\n+\n+\n+def test_table_offset_rows_error_zero_issue_521():\n+ source = \"data/long.csv\"\n+ query = Query(offset_rows=0)\n+ table = Table(source, query=query)\n+ with pytest.raises(exceptions.FrictionlessException) as excinfo:\n+ table.open()\n+ error = excinfo.value.error\n+ assert error.code == \"query-error\"\n+ assert error.note.count('minimum of 1\" at \"offsetRows')\n+\n+\n# Header\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
Restrict fields/row_limit/offest to minimum 1 (#525)
234,887
13.11.2020 13:45:50
0
5c13a6c5431e1b5c6c715ba48674edfd246c1f63
CKAN plugin: implement read_package and read_resource
[ { "change_type": "ADD", "old_path": null, "new_path": "data/ckan_mock_responses/ckan_error.json", "diff": "+{\n+ \"help\": \"https://demo.ckan.org/api/3/action/help_show?name=package_show\",\n+ \"success\": false,\n+ \"error\": {\n+ \"message\": \"Not found\",\n+ \"__type\": \"Not Found Error\"\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "data/ckan_mock_responses/datastore_search_describe.json", "diff": "+{\n+ \"help\": \"https://demo.ckan.org/api/3/action/help_show?name=datastore_search\",\n+ \"success\": true,\n+ \"result\": {\n+ \"resource_id\": \"79843e49-7974-411c-8eb5-fb2d1111d707\",\n+ \"fields\": [\n+ {\n+ \"type\": \"int4\",\n+ \"id\": \"_id\"\n+ },\n+ {\n+ \"type\": \"int4\",\n+ \"id\": \"id\"\n+ },\n+ {\n+ \"type\": \"int4\",\n+ \"id\": \"parent\"\n+ },\n+ {\n+ \"type\": \"text\",\n+ \"id\": \"name\"\n+ },\n+ {\n+ \"type\": \"bool\",\n+ \"id\": \"current\"\n+ },\n+ {\n+ \"type\": \"float8\",\n+ \"id\": \"rating\"\n+ },\n+ {\n+ \"type\": \"int4\",\n+ \"id\": \"created_year\"\n+ },\n+ {\n+ \"type\": \"date\",\n+ \"id\": \"created_date\"\n+ },\n+ {\n+ \"type\": \"time\",\n+ \"id\": \"created_time\"\n+ },\n+ {\n+ \"type\": \"timestamp\",\n+ \"id\": \"created_datetime\"\n+ },\n+ {\n+ \"type\": \"json\",\n+ \"id\": \"stats\"\n+ },\n+ {\n+ \"type\": \"_text\",\n+ \"id\": \"persons\"\n+ },\n+ {\n+ \"type\": \"json\",\n+ \"id\": \"location\"\n+ }\n+ ],\n+ \"records\": [],\n+ \"_links\": {\n+ \"start\": \"/api/3/action/datastore_search?limit=0&resource_id=79843e49-7974-411c-8eb5-fb2d1111d707\",\n+ \"next\": \"/api/3/action/datastore_search?offset=0&limit=0&resource_id=79843e49-7974-411c-8eb5-fb2d1111d707\"\n+ },\n+ \"limit\": 0\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "data/ckan_mock_responses/datastore_search_rows_empty.json", "diff": "+{\n+ \"help\": \"https://demo.ckan.org/api/3/action/help_show?name=datastore_search\",\n+ \"success\": true,\n+ \"result\": {\n+ \"resource_id\": \"79843e49-7974-411c-8eb5-fb2d1111d707\",\n+ \"fields\": [\n+ {\n+ \"type\": \"int4\",\n+ \"id\": \"_id\"\n+ },\n+ {\n+ \"type\": \"int4\",\n+ \"id\": \"id\"\n+ },\n+ {\n+ \"type\": \"int4\",\n+ \"id\": \"parent\"\n+ },\n+ {\n+ \"type\": \"text\",\n+ \"id\": \"name\"\n+ },\n+ {\n+ \"type\": \"bool\",\n+ \"id\": \"current\"\n+ },\n+ {\n+ \"type\": \"float8\",\n+ \"id\": \"rating\"\n+ },\n+ {\n+ \"type\": \"int4\",\n+ \"id\": \"created_year\"\n+ },\n+ {\n+ \"type\": \"date\",\n+ \"id\": \"created_date\"\n+ },\n+ {\n+ \"type\": \"time\",\n+ \"id\": \"created_time\"\n+ },\n+ {\n+ \"type\": \"timestamp\",\n+ \"id\": \"created_datetime\"\n+ },\n+ {\n+ \"type\": \"json\",\n+ \"id\": \"stats\"\n+ },\n+ {\n+ \"type\": \"_text\",\n+ \"id\": \"persons\"\n+ },\n+ {\n+ \"type\": \"json\",\n+ \"id\": \"location\"\n+ }\n+ ],\n+ \"records\": [],\n+ \"_links\": {\n+ \"start\": \"/api/3/action/datastore_search?resource_id=79843e49-7974-411c-8eb5-fb2d1111d707\",\n+ \"next\": \"/api/3/action/datastore_search?offset=200&resource_id=79843e49-7974-411c-8eb5-fb2d1111d707\"\n+ },\n+ \"offset\": 100\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "data/ckan_mock_responses/datastore_search_table_metadata_01.json", "diff": "+{\n+ \"help\": \"https://demo.ckan.org/api/3/action/help_show?name=datastore_search\",\n+ \"success\": true,\n+ \"result\": {\n+ \"resource_id\": \"_table_metadata\",\n+ \"fields\": [\n+ {\n+ \"type\": \"text\",\n+ \"id\": \"_id\"\n+ },\n+ {\n+ \"type\": \"name\",\n+ \"id\": \"name\"\n+ },\n+ {\n+ \"type\": \"oid\",\n+ \"id\": \"oid\"\n+ },\n+ {\n+ \"type\": \"name\",\n+ \"id\": \"alias_of\"\n+ }\n+ ],\n+ \"records\": [\n+ {\n+ \"_id\": \"127e87deb7b16215\",\n+ \"alias_of\": null,\n+ \"name\": \"bd79c992-40f0-454a-a0ff-887f84a792fb\",\n+ \"oid\": 14788505\n+ },\n+ {\n+ \"_id\": \"d16cf8659bb85f02\",\n+ \"alias_of\": null,\n+ \"name\": \"79843e49-7974-411c-8eb5-fb2d1111d707\",\n+ \"oid\": 14787229\n+ }\n+ ],\n+ \"_links\": {\n+ \"start\": \"/api/3/action/datastore_search?filters=%7B%22name%22%3A+%5B%22bd79c992-40f0-454a-a0ff-887f84a792fb%22%2C+%2279843e49-7974-411c-8eb5-fb2d1111d707%22%5D%7D&resource_id=_table_metadata\",\n+ \"next\": \"/api/3/action/datastore_search?offset=100&filters=%7B%22name%22%3A+%5B%22bd79c992-40f0-454a-a0ff-887f84a792fb%22%2C+%2279843e49-7974-411c-8eb5-fb2d1111d707%22%5D%7D&resource_id=_table_metadata\"\n+ },\n+ \"filters\": {\n+ \"name\": [\n+ \"bd79c992-40f0-454a-a0ff-887f84a792fb\",\n+ \"79843e49-7974-411c-8eb5-fb2d1111d707\"\n+ ]\n+ },\n+ \"total\": 2\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "data/ckan_mock_responses/datastore_search_table_metadata_02.json", "diff": "+{\n+ \"help\": \"https://demo.ckan.org/api/3/action/help_show?name=datastore_search\",\n+ \"success\": true,\n+ \"result\": {\n+ \"resource_id\": \"_table_metadata\",\n+ \"fields\": [\n+ {\n+ \"type\": \"text\",\n+ \"id\": \"_id\"\n+ },\n+ {\n+ \"type\": \"name\",\n+ \"id\": \"name\"\n+ },\n+ {\n+ \"type\": \"oid\",\n+ \"id\": \"oid\"\n+ },\n+ {\n+ \"type\": \"name\",\n+ \"id\": \"alias_of\"\n+ }\n+ ],\n+ \"records\": [],\n+ \"_links\": {\n+ \"start\": \"/api/3/action/datastore_search?filters=%7B%22name%22%3A+%5B%22bd79c992-40f0-454a-a0ff-887f84a792fb%22%2C+%2279843e49-7974-411c-8eb5-fb2d1111d707%22%5D%7D&resource_id=_table_metadata\",\n+ \"next\": \"/api/3/action/datastore_search?offset=200&filters=%7B%22name%22%3A+%5B%22bd79c992-40f0-454a-a0ff-887f84a792fb%22%2C+%2279843e49-7974-411c-8eb5-fb2d1111d707%22%5D%7D&resource_id=_table_metadata\"\n+ },\n+ \"filters\": {\n+ \"name\": [\n+ \"bd79c992-40f0-454a-a0ff-887f84a792fb\",\n+ \"79843e49-7974-411c-8eb5-fb2d1111d707\"\n+ ]\n+ },\n+ \"offset\": 100\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "data/ckan_mock_responses/package_show.json", "diff": "+{\n+ \"help\": \"https://demo.ckan.org/api/3/action/help_show?name=package_show\",\n+ \"success\": true,\n+ \"result\": {\n+ \"license_title\": \"\",\n+ \"maintainer\": \"\",\n+ \"relationships_as_object\": [],\n+ \"private\": false,\n+ \"maintainer_email\": \"\",\n+ \"num_tags\": 0,\n+ \"id\": \"7766839b-face-4336-8e1a-3c51c5e7634d\",\n+ \"metadata_created\": \"2017-10-13T14:00:49.983285\",\n+ \"metadata_modified\": \"2017-10-18T14:44:12.587015\",\n+ \"author\": \"\",\n+ \"author_email\": \"\",\n+ \"state\": \"active\",\n+ \"version\": \"\",\n+ \"creator_user_id\": \"9cdbdaf8-b7e9-468b-bd72-4b23a07b9066\",\n+ \"type\": \"dataset\",\n+ \"resources\": [\n+ {\n+ \"mimetype\": null,\n+ \"cache_url\": null,\n+ \"hash\": \"\",\n+ \"description\": \"\",\n+ \"name\": \"co2-mm-mlo_csv_not_streamed\",\n+ \"format\": \"CSV\",\n+ \"url\": \"https://pkgstore.datahub.io/core/co2-ppm:co2-mm-mlo_csv/data/co2-mm-mlo_csv.csv\",\n+ \"datastore_active\": true,\n+ \"cache_last_updated\": null,\n+ \"package_id\": \"7766839b-face-4336-8e1a-3c51c5e7634d\",\n+ \"created\": \"2017-10-18T14:44:10.636629\",\n+ \"state\": \"active\",\n+ \"mimetype_inner\": null,\n+ \"last_modified\": null,\n+ \"position\": 0,\n+ \"revision_id\": \"99b5f272-aaca-4f69-9b74-b64432b27cde\",\n+ \"url_type\": null,\n+ \"id\": \"bd79c992-40f0-454a-a0ff-887f84a792fb\",\n+ \"resource_type\": null,\n+ \"size\": null\n+ },\n+ {\n+ \"mimetype\": null,\n+ \"cache_url\": null,\n+ \"hash\": \"d83fd70eeef26cbc33904cf84664d99c\",\n+ \"description\": \"\",\n+ \"name\": \"co2-mm-mlo_csv_streamed\",\n+ \"encoding\": \"utf-8\",\n+ \"url\": \"https://demo.ckan.org/dataset/7766839b-face-4336-8e1a-3c51c5e7634d/resource/79843e49-7974-411c-8eb5-fb2d1111d707/download/co2-mm-mlo_csv_streamed.csv\",\n+ \"datastore_active\": true,\n+ \"format\": \"CSV\",\n+ \"cache_last_updated\": null,\n+ \"package_id\": \"7766839b-face-4336-8e1a-3c51c5e7634d\",\n+ \"created\": \"2017-10-18T14:44:12.692356\",\n+ \"state\": \"active\",\n+ \"mimetype_inner\": null,\n+ \"last_modified\": null,\n+ \"position\": 1,\n+ \"revision_id\": \"99b5f272-aaca-4f69-9b74-b64432b27cde\",\n+ \"url_type\": \"upload\",\n+ \"id\": \"79843e49-7974-411c-8eb5-fb2d1111d707\",\n+ \"resource_type\": null,\n+ \"size\": null\n+ }\n+ ],\n+ \"num_resources\": 2,\n+ \"tags\": [],\n+ \"groups\": [],\n+ \"license_id\": \"\",\n+ \"relationships_as_subject\": [],\n+ \"organization\": {\n+ \"description\": \"\",\n+ \"created\": \"2017-10-13T14:00:40.959338\",\n+ \"title\": \"My Test Org\",\n+ \"name\": \"my-test-org\",\n+ \"is_organization\": true,\n+ \"state\": \"active\",\n+ \"image_url\": \"\",\n+ \"revision_id\": \"bf91def8-2b83-41a8-98dd-6a27707fdba4\",\n+ \"type\": \"organization\",\n+ \"id\": \"4c0827c9-8eb0-4ec0-a95c-28491bceeb6f\",\n+ \"approval_status\": \"approved\"\n+ },\n+ \"name\": \"test-dataset-010203\",\n+ \"isopen\": false,\n+ \"url\": \"\",\n+ \"notes\": \"\",\n+ \"owner_org\": \"4c0827c9-8eb0-4ec0-a95c-28491bceeb6f\",\n+ \"extras\": [\n+ {\n+ \"key\": \"hash\",\n+ \"value\": \"ae07f1ac9c7960e614f74d4160d1bf80\"\n+ },\n+ {\n+ \"key\": \"profile\",\n+ \"value\": \"data-package\"\n+ }\n+ ],\n+ \"title\": \"Test Dataset\",\n+ \"revision_id\": \"70564e27-9576-4c15-9dc2-6d57791f35da\"\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "frictionless/package.py", "new_path": "frictionless/package.py", "diff": "@@ -284,6 +284,17 @@ class Package(Metadata):\n\"\"\"\nreturn storage.read_package()\n+ @staticmethod\n+ def from_ckan(*, base_url, dataset_id, api_key=None):\n+ return Package.from_storage(\n+ system.create_storage(\n+ \"ckan_datastore\",\n+ base_url=base_url,\n+ dataset_id=dataset_id,\n+ api_key=api_key,\n+ )\n+ )\n+\n@staticmethod\ndef from_sql(*, engine, prefix=\"\", namespace=None):\n\"\"\"Import package from SQL\n" }, { "change_type": "MODIFY", "old_path": "frictionless/plugins/ckan.py", "new_path": "frictionless/plugins/ckan.py", "diff": "-import os\nimport json\nimport logging\n+import os\n+from functools import partial\n+\nimport requests\n+\n+from .. import errors, exceptions\nfrom ..field import Field\n-from ..schema import Schema\n+from ..package import Package\nfrom ..plugin import Plugin\n-from ..storage import Storage\nfrom ..resource import Resource\n-from .. import exceptions\n-from .. import errors\n+from ..schema import Schema\n+from ..storage import Storage\nlog = logging.getLogger(__name__)\n@@ -31,7 +34,8 @@ class CkanPlugin(Plugin):\npass\ndef create_storage(self, name, **options):\n- pass\n+ if name == \"ckan_datastore\":\n+ return CkanStorage(**options)\n# TODO: implement Dialect\n@@ -59,10 +63,12 @@ class CkanStorage(Storage):\nself.__bucket_cache = None\nself.__tables = {}\n+ def __iter__(self):\n+ return iter(self.__bucket_cache)\n+\n# Read\n- @property\n- def read_table_names(self):\n+ def _read_table_names(self):\nif self.__bucket_cache:\nreturn self.__bucket_cache\nparams = {\"resource_id\": \"_table_metadata\"}\n@@ -83,20 +89,21 @@ class CkanStorage(Storage):\nif count == self.__max_pages:\nlog.warn(\"Max name count exceeded. {} names returned.\".format(len(names)))\nbreak\n- self.__name_cache = names\n+ self.__bucket_cache = names\nreturn names\n- def read_table(self, name):\n- table = self.__table.get(name)\n+ def _read_table(self, name):\n+ table = self.__tables.get(name)\nif table is None:\ndatastore_search_url = \"{}/datastore_search\".format(self.__base_endpoint)\nparams = {\"limit\": 0, \"resource_id\": name}\nresponse = self.__make_ckan_request(datastore_search_url, params=params)\nckan_table = response[\"result\"][\"fields\"]\n- table = self.read_table_convert_table(name, ckan_table)\n+ table = self._read_table_convert_table(name, ckan_table)\n+ self.__tables[name] = table\nreturn table\n- def read_table_convert_table(self, name, ckan_table):\n+ def _read_table_convert_table(self, name, ckan_table):\nschema = Schema()\n# Fields\n@@ -106,17 +113,20 @@ class CkanStorage(Storage):\ncontinue\ndatastore_type = f[\"type\"]\ndatastore_id = f[\"id\"]\n- ts_type, ts_format = self.datastore_field_type_to_schema_type(datastore_type)\n+ ts_type, ts_format = self._read_table_convert_field_type(datastore_type)\nfield = Field(name=datastore_id, type=ts_type)\nif ts_format is not None:\nfield.format = ts_format\nschema.fields.append(field)\n# Table\n- table = Resource(name=name, schema=schema)\n+ data = partial(self._read_table_row_stream, name)\n+ table = Resource(\n+ name=name, schema=schema, data=data(), dialect={\"keys\": schema.field_names}\n+ )\nreturn table\n- def read_table_convert_field_type(self, dstore_type):\n+ def _read_table_convert_field_type(self, dstore_type):\ndstore_type = dstore_type.rstrip(\"0123456789\")\nif dstore_type.startswith(\"_\"):\ndstore_type = \"array\"\n@@ -150,111 +160,43 @@ class CkanStorage(Storage):\n)\nreturn (\"string\", None)\n- def read_table_row_stream(self, name):\n- table = self.read_table(name)\n+ def _read_table_row_stream(self, name):\n+ table = self._read_table(name)\ndatastore_search_url = \"{}/datastore_search\".format(self.__base_endpoint)\nparams = {\"resource_id\": table.name}\nresponse = self.__make_ckan_request(datastore_search_url, params=params)\nwhile response[\"result\"][\"records\"]:\nfor row in response[\"result\"][\"records\"]:\n- # row = self.__mapper.restore_row(row, schema=table.schema)\nyield row\nnext_url = self.__base_url + response[\"result\"][\"_links\"][\"next\"]\nresponse = self.__make_ckan_request(next_url)\n- # Write\n-\n- def write_table(self, *tables, force=False):\n-\n- # Check for existence\n- for table in tables:\n- if table.name in self.read_table_names():\n- if not force:\n- note = f'Table \"{table.name}\" already exists'\n- raise exceptions.FrictionlessException(errors.StorageError(note=note))\n- self.write_table_remove(table.name)\n-\n- # Define tables\n- for table in tables:\n- self.__tables[table.name] = table\n- datastore_dict = self.write_table_convert_table(table)\n- datastore_url = \"{}/datastore_create\".format(self.__base_endpoint)\n- self.__make_ckan_request(datastore_url, method=\"POST\", json=datastore_dict)\n-\n- # Invalidate cache\n- self.__bucket_cache = None\n+ def read_resource(self, name, **options):\n+ return self._read_table(name)\n- def write_table_remove(self, *names, ignore=False):\n+ def read_package(self, **options):\n+ self._read_table_names()\n+ package = Package()\n+ for name in self:\n+ resource = self.read_resource(name)\n+ package.resources.append(resource)\n+ return package\n- # Remove tables\n- for name in names:\n+ # Write\n- # Check existent\n- if name not in self.read_table_names():\n- if not ignore:\n- note = f'Table \"{name}\" already exists'\n- raise exceptions.FrictionlessException(errors.StorageError(note=note))\n- continue\n+ def write_resource(self, resource, *, force=False, **options):\n+ pass\n- # Remove from table\n- if name in self.__tables:\n- del self.__tables[name]\n+ def write_package(self, package, *, force=False, **options):\n+ pass\n- # Remove from ckan\n- datastore_delete_url = \"{}/datastore_delete\".format(self.__base_endpoint)\n- params = {\"resource_id\": name, \"force\": True}\n- self.__make_ckan_request(datastore_delete_url, method=\"POST\", json=params)\n+ # Delete\n- # Invalidate cache\n- self.__bucket_cache = None\n+ def delete_resource(self, name, *, ignore=False, **options):\n+ pass\n- def write_table_convert_table(self, table):\n- schema = table.schema\n- datastore_dict = {\"fields\": [], \"resource_id\": table.name, \"force\": True}\n- for field in schema.fields:\n- datastore_field = {\"id\": field.name}\n- datastore_type = self.descritor_type_to_datastore_type(field.type)\n- if datastore_type:\n- datastore_field[\"type\"] = datastore_type\n- datastore_dict[\"fields\"].append(datastore_field)\n- if schema.primary_key is not None:\n- datastore_dict[\"primary_key\"] = schema.primary_key\n- return datastore_dict\n-\n- def write_table_convert_field_type(self, type):\n- DESCRIPTOR_TYPE_MAPPING = {\n- \"number\": \"float\",\n- \"string\": \"text\",\n- \"integer\": \"int\",\n- \"boolean\": \"bool\",\n- \"object\": \"json\",\n- \"array\": \"text[]\",\n- \"geojson\": \"json\",\n- \"date\": \"date\",\n- \"time\": \"time\",\n- \"year\": \"int\",\n- \"datetime\": \"timestamp\",\n- }\n- try:\n- return DESCRIPTOR_TYPE_MAPPING[type]\n- except KeyError:\n- log.warn(\"Unsupported descriptor type '{}'.\".format(type))\n- return None\n-\n- def write_table_row_stream(self, name, row_stream, method=\"upsert\"):\n- table = self.read_table(name)\n- datastore_upsert_url = \"{}/datastore_upsert\".format(self.__base_endpoint)\n- records = []\n- for r in row_stream:\n- # r = self.__mapper.convert_row(r, table.eschema)\n- records.append(r)\n- params = {\n- \"resource_id\": table.name,\n- \"method\": method,\n- \"force\": True,\n- \"records\": records,\n- }\n- self.__make_ckan_request(datastore_upsert_url, method=\"POST\", json=params)\n+ def delete_package(self, names, *, ignore=False, **options):\n+ pass\n# Private\n" }, { "change_type": "MODIFY", "old_path": "frictionless/resource.py", "new_path": "frictionless/resource.py", "diff": "@@ -635,6 +635,17 @@ class Resource(Metadata):\n\"\"\"\nreturn storage.read_resource(name)\n+ @staticmethod\n+ def from_ckan(*, base_url, resource_id, api_key=None):\n+ return Resource.from_storage(\n+ system.create_storage(\n+ \"ckan_datastore\",\n+ base_url=base_url,\n+ api_key=api_key,\n+ ),\n+ name=resource_id,\n+ )\n+\n@staticmethod\ndef from_sql(*, name, engine, prefix=\"\", namespace=None):\n\"\"\"Import resource from SQL table\n" }, { "change_type": "ADD", "old_path": null, "new_path": "tests/plugins/test_ckan.py", "diff": "+import datetime\n+import json\n+import urllib\n+\n+import pytest\n+import responses\n+from frictionless import Package, Resource, exceptions\n+\n+\n+def assert_resource_valid(resource):\n+ assert resource.schema == {\n+ \"fields\": [\n+ {\"name\": \"id\", \"type\": \"integer\"},\n+ {\"name\": \"parent\", \"type\": \"integer\"},\n+ {\"name\": \"name\", \"type\": \"string\"},\n+ {\"name\": \"current\", \"type\": \"boolean\"},\n+ {\"name\": \"rating\", \"type\": \"number\"},\n+ {\"name\": \"created_year\", \"type\": \"integer\"},\n+ {\"name\": \"created_date\", \"type\": \"date\", \"format\": \"any\"},\n+ {\"name\": \"created_time\", \"type\": \"time\", \"format\": \"any\"},\n+ {\"name\": \"created_datetime\", \"type\": \"datetime\", \"format\": \"any\"},\n+ {\"name\": \"stats\", \"type\": \"object\"},\n+ {\"name\": \"persons\", \"type\": \"array\"},\n+ {\"name\": \"location\", \"type\": \"object\"},\n+ ]\n+ }\n+\n+ rows = resource.read_rows()\n+ assert len(rows) == 3\n+ assert rows[0].to_dict() == {\n+ \"id\": 1,\n+ \"parent\": None,\n+ \"name\": \"Taxes\",\n+ \"current\": True,\n+ \"rating\": 9.5,\n+ \"created_year\": 2015,\n+ \"created_date\": datetime.date(2015, 1, 1),\n+ \"created_time\": datetime.time(3, 0),\n+ \"created_datetime\": datetime.datetime(2015, 1, 1, 3, 0),\n+ \"stats\": {\"chars\": 560, \"height\": 54.8},\n+ \"persons\": [\"mike\", \"alice\"],\n+ \"location\": {\"type\": \"Point\", \"coordinates\": [50.0, 50.0]},\n+ }\n+\n+\[email protected]\n+def test_read_package_valid():\n+ resources_ids = [\n+ \"bd79c992-40f0-454a-a0ff-887f84a792fb\",\n+ \"79843e49-7974-411c-8eb5-fb2d1111d707\",\n+ ]\n+ filter_qs = urllib.parse.urlencode({\"filters\": json.dumps({\"name\": resources_ids})})\n+ dataset_id = \"my-dataset-id\"\n+ base_url = \"https://demo.ckan.org\"\n+\n+ mock_package_show_payload = json.load(\n+ open(\"data/ckan_mock_responses/package_show.json\", encoding=\"utf-8\")\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/package_show?id={dataset_id}\",\n+ json=mock_package_show_payload,\n+ status=200,\n+ )\n+\n+ # First response gets the _table_metadata results\n+ mock_datastore_search_01_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/datastore_search_table_metadata_01.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/datastore_search?resource_id=_table_metadata&{filter_qs}\",\n+ json=mock_datastore_search_01_payload,\n+ status=200,\n+ )\n+ # Second response is empty, indicating the results are exhausted\n+ mock_datastore_search_02_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/datastore_search_table_metadata_02.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/datastore_search?offset=100&{filter_qs}&resource_id=_table_metadata\",\n+ json=mock_datastore_search_02_payload,\n+ status=200,\n+ )\n+\n+ for resource_id in resources_ids:\n+ mock_datastore_search_describe_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/datastore_search_describe.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/datastore_search?limit=0&resource_id={resource_id}\",\n+ json=mock_datastore_search_describe_payload,\n+ status=200,\n+ )\n+\n+ # First response gets the data rows\n+ mock_datastore_search_rows_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/datastore_search_rows.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/datastore_search?resource_id={resource_id}\",\n+ json=mock_datastore_search_rows_payload,\n+ status=200,\n+ )\n+ # Second response is empty, indicating the results are exhausted\n+ mock_datastore_search_rows_empty_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/datastore_search_rows_empty.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/datastore_search?resource_id={resource_id}&offset=100\",\n+ json=mock_datastore_search_rows_empty_payload,\n+ status=200,\n+ )\n+\n+ package = Package.from_ckan(\n+ base_url=base_url,\n+ dataset_id=dataset_id,\n+ api_key=\"env:CKAN_API_KEY\",\n+ )\n+\n+ resource = package.get_resource(resources_ids[1])\n+ resource.onerror = \"raise\" # be strict about errors under test\n+\n+ assert_resource_valid(resource)\n+\n+\[email protected]\n+def test_read_package_bad_package_id():\n+ dataset_id = \"bad-dataset-id\"\n+ base_url = \"https://demo.ckan.org\"\n+\n+ error_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/ckan_error.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/package_show?id={dataset_id}\",\n+ json=error_payload,\n+ status=404,\n+ )\n+\n+ with pytest.raises(exceptions.FrictionlessException) as excinfo:\n+ Package.from_ckan(\n+ base_url=base_url,\n+ dataset_id=dataset_id,\n+ api_key=\"env:CKAN_API_KEY\",\n+ )\n+ error = excinfo.value.error\n+ assert error.code == \"storage-error\"\n+ assert error.note.count(\"Not found\")\n+\n+\[email protected]\n+def test_read_resource_valid():\n+ resource_id = \"79843e49-7974-411c-8eb5-fb2d1111d707\"\n+ base_url = \"https://demo.ckan.org\"\n+\n+ mock_datastore_search_describe_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/datastore_search_describe.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/datastore_search?limit=0&resource_id={resource_id}\",\n+ json=mock_datastore_search_describe_payload,\n+ status=200,\n+ )\n+\n+ # First response gets the data rows\n+ mock_datastore_search_rows_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/datastore_search_rows.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/datastore_search?resource_id={resource_id}\",\n+ json=mock_datastore_search_rows_payload,\n+ status=200,\n+ )\n+ # Second response is empty, indicating the results are exhausted\n+ mock_datastore_search_rows_empty_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/datastore_search_rows_empty.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/datastore_search?resource_id={resource_id}&offset=100\",\n+ json=mock_datastore_search_rows_empty_payload,\n+ status=200,\n+ )\n+\n+ resource = Resource.from_ckan(\n+ base_url=base_url,\n+ resource_id=resource_id,\n+ api_key=\"env:CKAN_API_KEY\",\n+ )\n+ resource.onerror = \"raise\" # be strict about errors under test\n+\n+ assert_resource_valid(resource)\n+\n+\[email protected]\n+def test_read_resource_bad_resource_id():\n+ resource_id = \"bad-resource-id\"\n+ base_url = \"https://demo.ckan.org\"\n+\n+ error_payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/ckan_error.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.GET,\n+ f\"{base_url}/api/3/action/datastore_search?limit=0&resource_id={resource_id}\",\n+ json=error_payload,\n+ status=404,\n+ )\n+\n+ with pytest.raises(exceptions.FrictionlessException) as excinfo:\n+ Resource.from_ckan(\n+ base_url=base_url,\n+ resource_id=resource_id,\n+ api_key=\"env:CKAN_API_KEY\",\n+ )\n+ error = excinfo.value.error\n+ assert error.code == \"storage-error\"\n+ assert error.note.count(\"Not found\")\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
CKAN plugin: implement read_package and read_resource
234,887
13.11.2020 13:46:08
0
2cf11954752c4297390fdf1122b9a0d0f6306359
CKAN plugin: implement delete_package and delete_resource
[ { "change_type": "ADD", "old_path": null, "new_path": "data/ckan_mock_responses/datastore_delete.json", "diff": "+{\n+ \"help\": \"https://demo.ckan.org/api/3/action/help_show?name=datastore_delete\",\n+ \"success\": true,\n+ \"result\": {\n+ \"resource_id\": \"79843e49-7974-411c-8eb5-fb2d1111d707\"\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "frictionless/plugins/ckan.py", "new_path": "frictionless/plugins/ckan.py", "diff": "@@ -192,11 +192,31 @@ class CkanStorage(Storage):\n# Delete\n- def delete_resource(self, name, *, ignore=False, **options):\n- pass\n+ def _write_table_remove(self, name, ignore=False):\n+ # Check existent\n+ if name not in self._read_table_names():\n+ if not ignore:\n+ note = f'Table \"{name}\" does not exist'\n+ raise exceptions.FrictionlessException(errors.StorageError(note=note))\n- def delete_package(self, names, *, ignore=False, **options):\n- pass\n+ # Remove from table\n+ if name in self.__tables:\n+ del self.__tables[name]\n+\n+ # Remove from ckan\n+ datastore_delete_url = \"{}/datastore_delete\".format(self.__base_endpoint)\n+ params = {\"resource_id\": name, \"force\": True}\n+ self.__make_ckan_request(datastore_delete_url, method=\"POST\", json=params)\n+\n+ # Invalidate cache\n+ self.__bucket_cache = None\n+\n+ def delete_resource(self, name, *, ignore=False):\n+ self._write_table_remove(name, ignore=ignore)\n+\n+ def delete_package(self, names, *, ignore=False):\n+ for name in names:\n+ self._write_table_remove(name, ignore=ignore)\n# Private\n" }, { "change_type": "MODIFY", "old_path": "tests/plugins/test_ckan.py", "new_path": "tests/plugins/test_ckan.py", "diff": "@@ -5,9 +5,20 @@ import urllib\nimport pytest\nimport responses\nfrom frictionless import Package, Resource, exceptions\n+from frictionless.plugins.ckan import CkanStorage\n+\"\"\"\n+Tests for CKAN plugin\n-def assert_resource_valid(resource):\n+Note: in this module we decorate all test functions with `@responses.activate` even\n+if we don't expect the test to make any HTTP calls. This way, if a test we are not\n+expecting to communicate over HTTP tries to make a HTTP request we will throw\n+`Connection refused by Responses - the call doesn't match any registered mock`\n+instead of silently making the request.\n+\"\"\"\n+\n+\n+def _assert_resource_valid(resource):\nassert resource.schema == {\n\"fields\": [\n{\"name\": \"id\", \"type\": \"integer\"},\n@@ -140,7 +151,7 @@ def test_read_package_valid():\nresource = package.get_resource(resources_ids[1])\nresource.onerror = \"raise\" # be strict about errors under test\n- assert_resource_valid(resource)\n+ _assert_resource_valid(resource)\[email protected]\n@@ -224,7 +235,7 @@ def test_read_resource_valid():\n)\nresource.onerror = \"raise\" # be strict about errors under test\n- assert_resource_valid(resource)\n+ _assert_resource_valid(resource)\[email protected]\n@@ -254,3 +265,45 @@ def test_read_resource_bad_resource_id():\nerror = excinfo.value.error\nassert error.code == \"storage-error\"\nassert error.note.count(\"Not found\")\n+\n+\[email protected]\n+def test_delete_valid():\n+ resource_id = \"79843e49-7974-411c-8eb5-fb2d1111d707\"\n+ base_url = \"https://demo.ckan.org\"\n+\n+ for method, params in [\n+ (\"delete_package\", [resource_id]),\n+ (\"delete_resource\", resource_id),\n+ ]:\n+ payload = json.load(\n+ open(\n+ \"data/ckan_mock_responses/datastore_delete.json\",\n+ encoding=\"utf-8\",\n+ )\n+ )\n+ responses.add(\n+ responses.POST,\n+ f\"{base_url}/api/3/action/datastore_delete\",\n+ json=payload,\n+ status=200,\n+ )\n+\n+ storage = CkanStorage(base_url=base_url)\n+ storage._CkanStorage__bucket_cache = [resource_id]\n+ getattr(storage, method)(params)\n+\n+ assert responses.assert_call_count(f\"{base_url}/api/3/action/datastore_delete\", 1)\n+ responses.reset()\n+\n+\[email protected]\n+def test_delete_bad_resource_id():\n+ for method, params in [(\"delete_package\", [\"bad-id\"]), (\"delete_resource\", \"bad-id\")]:\n+ storage = CkanStorage(base_url=\"https://demo.ckan.org\")\n+ storage._CkanStorage__bucket_cache = [\"79843e49-7974-411c-8eb5-fb2d1111d707\"]\n+ with pytest.raises(exceptions.FrictionlessException) as excinfo:\n+ getattr(storage, method)(params)\n+ error = excinfo.value.error\n+ assert error.code == \"storage-error\"\n+ assert error.note.count('Table \"bad-id\" does not exist')\n" } ]
Python
MIT License
frictionlessdata/frictionless-py
CKAN plugin: implement delete_package and delete_resource