Skip to content
Snippets Groups Projects
Commit 81bec38c authored by Martin Weise's avatar Martin Weise
Browse files

Merge branch 'dev' into 'master'

Fixed mapping problem where UK and FK share columns they are inserted

See merge request !341
parents 31676975 cbd98fe6
No related branches found
No related tags found
4 merge requests!357Master,!347Resolve "Bug prevents volume computation when data length column in Metadata DB is null",!346Master,!341Fixed mapping problem where UK and FK share columns they are inserted
Showing
with 119 additions and 59 deletions
# Example values to override for non-test deployments
#BASE_URL=https://example.com
#ADMIN_EMAIL=noreply@example.com
#LOG_LEVEL=info
#IDENTITY_SERVICE_ADMIN_PASSWORD=admin
#AUTH_SERVICE_ADMIN_PASSWORD=admin
#METADATA_DB_PASSWORD=dbrepo
#DATA_DB_PASSWORD=dbrepo
#AUTH_DB_PASSWORD=dbrepo
#S3_ACCESS_KEY_ID=seaweedfsadmin
#S3_SECRET_ACCESS_KEY=seaweedfsadmin
#SYSTEM_PASSWORD=admin
...@@ -24,24 +24,10 @@ Library. ...@@ -24,24 +24,10 @@ Library.
## Data ## Data
The procedures require the user-generated databases to have the same collation (because of comparison operations). The procedures requires the in parameter of the `hash_table` stored procedure to have the same collation as the
Ensure that the Data Database has the character set `utf8mb4` and collation `utf8mb4_general_ci` in your `my.cfg`: `information_schema.columns` table. We observed this unexpected behavior for
```ini
[mysqld]
character_set_server=utf8mb4
collation_server=utf8mb4_general_ci
```
We observed this unexpected behavior for
the [MariaDB Galera chart](https://artifacthub.io/packages/helm/bitnami/mariadb-galera) powered by Bitnami and had to the [MariaDB Galera chart](https://artifacthub.io/packages/helm/bitnami/mariadb-galera) powered by Bitnami and had to
set extra flags. We could not observe this behavior with set extra flags.
the [MariaDB Galera container image](https://hub.docker.com/r/bitnami/mariadb-galera) itself.
```yaml
mariadb-galera:
extraFlags: "--character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci"
```
### Backup ### Backup
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</mask> </mask>
<g mask="url(#anybadge_1)"> <g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h65v20H0z"/> <path fill="#555" d="M0 0h65v20H0z"/>
<path fill="#A9A9A9" d="M65 0h59v20H65z"/> <path fill="#C0C0C0" d="M65 0h59v20H65z"/>
<path fill="url(#b)" d="M0 0h124v20H0z"/> <path fill="url(#b)" d="M0 0h124v20H0z"/>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
......
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="158" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<mask id="anybadge_1">
<rect width="158" height="20" rx="3" fill="#fff"/>
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h99v20H0z"/>
<path fill="#C0C0C0" d="M99 0h59v20H99z"/>
<path fill="url(#b)" d="M0 0h158v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="50.5" y="15" fill="#010101" fill-opacity=".3">maintainability</text>
<text x="49.5" y="14">maintainability</text>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="129.5" y="15" fill="#010101" fill-opacity=".3">unknown</text>
<text x="128.5" y="14">unknown</text>
</g>
</svg>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</mask> </mask>
<g mask="url(#anybadge_1)"> <g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h57v20H0z"/> <path fill="#555" d="M0 0h57v20H0z"/>
<path fill="#A9A9A9" d="M57 0h59v20H57z"/> <path fill="#C0C0C0" d="M57 0h59v20H57z"/>
<path fill="url(#b)" d="M0 0h116v20H0z"/> <path fill="url(#b)" d="M0 0h116v20H0z"/>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
......
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="119" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<mask id="anybadge_1">
<rect width="119" height="20" rx="3" fill="#fff"/>
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h60v20H0z"/>
<path fill="#C0C0C0" d="M60 0h59v20H60z"/>
<path fill="url(#b)" d="M0 0h119v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="31.0" y="15" fill="#010101" fill-opacity=".3">security</text>
<text x="30.0" y="14">security</text>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="90.5" y="15" fill="#010101" fill-opacity=".3">unknown</text>
<text x="89.5" y="14">unknown</text>
</g>
</svg>
...@@ -11,6 +11,8 @@ author: Martin Weise ...@@ -11,6 +11,8 @@ author: Martin Weise
[![Image Pulls](https://img.shields.io/docker/pulls/dbrepo/data-service?style=flat)](https://hub.docker.com/u/dbrepo){ tabindex=-1 } [![Image Pulls](https://img.shields.io/docker/pulls/dbrepo/data-service?style=flat)](https://hub.docker.com/u/dbrepo){ tabindex=-1 }
[![Helm Chart version](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/dbrepo)](https://artifacthub.io/packages/helm/dbrepo/dbrepo){ tabindex=-1 } [![Helm Chart version](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/dbrepo)](https://artifacthub.io/packages/helm/dbrepo/dbrepo){ tabindex=-1 }
[![GitLab License](https://img.shields.io/gitlab/license/fair-data-austria-db-repository%2Ffda-services?gitlab_url=https%3A%2F%2Fgitlab.phaidra.org%2F&style=flat&cacheSeconds=3600)](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services){ tabindex=-1 } [![GitLab License](https://img.shields.io/gitlab/license/fair-data-austria-db-repository%2Ffda-services?gitlab_url=https%3A%2F%2Fgitlab.phaidra.org%2F&style=flat&cacheSeconds=3600)](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services){ tabindex=-1 }
![Maintainability Rating](./images/maintainability.svg)
![Security Rating](./images/security.svg)
Documentation for version: [v1.5.0](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/releases). Documentation for version: [v1.5.0](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/releases).
......
...@@ -61,7 +61,7 @@ ready ...@@ -61,7 +61,7 @@ ready
*.p12 *.p12
# Environment # Environment
.env .docker/.env
# X509 # X509
root.crt root.crt
......
...@@ -360,9 +360,10 @@ docs-registry: ...@@ -360,9 +360,10 @@ docs-registry:
refs: refs:
- /^release-.*/ - /^release-.*/
before_script: before_script:
- "pip install pipenv"
- "pipenv install --dev --system --deploy"
- "apt-get update && apt-get install -y sed" - "apt-get update && apt-get install -y sed"
script: script:
- pip install -r ./requirements.txt
- python3 .docs/docker/release.py - python3 .docs/docker/release.py
release-images: release-images:
...@@ -414,9 +415,9 @@ release-docs: ...@@ -414,9 +415,9 @@ release-docs:
refs: refs:
- /^release-.*/ - /^release-.*/
before_script: before_script:
- "apk add --update alpine-sdk bash sed wget openssh jq curl" - "apk add --no-cache alpine-sdk bash sed wget openssh jq curl"
- "pip install pipenv" - "pip install pipenv"
- "pip install -r ./requirements.txt" - "pipenv install --dev --system --deploy"
- "mkdir -p ./final/${DOC_VERSION}/rest" - "mkdir -p ./final/${DOC_VERSION}/rest"
script: script:
- "make gen-lib-doc gen-docs-doc package-config" - "make gen-lib-doc gen-docs-doc package-config"
......
#!/bin/bash #!/bin/bash
GITLAB_URL="https://gitlab.phaidra.org" GITLAB_URL="https://gitlab.phaidra.org"
# if we reached this script, all the tests have passed # if we reached this script, all the tests have passed
anybadge --label pipeline --value "passed" failed=red passed=green canceled=darkgray > "./final/${APP_VERSION}/images/pipeline.svg" anybadge --label pipeline --value "passed" failed=red passed=green canceled=darkgray > "./final/${DOC_VERSION}/images/pipeline.svg"
PIPELINE_COVERAGE=$(curl -fsSL -H "PRIVATE-TOKEN: ${CI_TOKEN}" "${GITLAB_URL}/api/v4/projects/450/pipelines/latest?ref=${CI_COMMIT_BRANCH}" | jq --raw-output .coverage) PIPELINE_COVERAGE=$(curl -fsSL -H "PRIVATE-TOKEN: ${CI_TOKEN}" "${GITLAB_URL}/api/v4/projects/450/pipelines/latest?ref=${CI_COMMIT_BRANCH}" | jq --raw-output .coverage)
echo "[INFO] pipeline coverage: ${PIPELINE_COVERAGE}" echo "[INFO] pipeline coverage: ${PIPELINE_COVERAGE}"
if [ "${PIPELINE_COVERAGE}" != "null" ]; then if [ "${PIPELINE_COVERAGE}" != "null" ]; then
anybadge --label coverage --value "${PIPELINE_COVERAGE}" coverage > "./final/${APP_VERSION}/images/coverage.svg" anybadge --label coverage --value "${PIPELINE_COVERAGE}" coverage > "./final/${DOC_VERSION}/images/coverage.svg"
else else
echo "[WARNING] Skipping badge generation, displaying default badge text: unknown" echo "[WARNING] Skipping badge generation, displaying default badge text: unknown"
fi fi
curl "${SONARQUBE_URL}/api/project_badges/measure?project=fair-data-austria-db-repository_fda-services_a57fa043-ab99-4cdd-a721-162d9a916d77&metric=sqale_rating&token=${CI_SONAR_TOKEN}" > "./final/${DOC_VERSION}/images/maintainability.svg"
curl "${SONARQUBE_URL}/api/project_badges/measure?project=fair-data-austria-db-repository_fda-services_a57fa043-ab99-4cdd-a721-162d9a916d77&metric=security_rating&token=${CI_SONAR_TOKEN}" > "./final/${DOC_VERSION}/images/security.svg"
echo "[INFO] retrieved SonarQube badges"
\ No newline at end of file
![Java 21](https://img.shields.io/badge/Java-21-white?style=flat) [![CI/CD Status](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/badges/master/pipeline.svg)](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services)
![Python 3.11](https://img.shields.io/badge/Python-3.11-white?style=flat) [![CI/CD Coverage](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/badges/master/coverage.svg)](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services)
![RabbitMQ 3.12](https://img.shields.io/badge/RabbitMQ-3.12-white?style=flat) [![Latest Release](https://img.shields.io/gitlab/v/release/fair-data-austria-db-repository%2Ffda-services?gitlab_url=https%3A%2F%2Fgitlab.phaidra.org&display_name=release&style=flat)](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services)
![MariaDB 11.2](https://img.shields.io/badge/MariaDB-11.2-white?style=flat) [![PyPI Library version](https://img.shields.io/pypi/v/dbrepo)](https://pypi.org/project/dbrepo/)
![OpenSearch 2.10](https://img.shields.io/badge/OpenSearch-2.10-white?style=flat) [![Image Pulls](https://img.shields.io/docker/pulls/dbrepo/data-service?style=flat)](https://hub.docker.com/u/dbrepo)
![SeaweedFS 3.59](https://img.shields.io/badge/SeaweedFS-3.59-white?style=flat) [![Helm Chart version](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/dbrepo)](https://artifacthub.io/packages/helm/dbrepo/dbrepo)
![OpenLDAP 2.6](https://img.shields.io/badge/OpenLDAP-2.6-white?style=flat) [![GitLab License](https://img.shields.io/gitlab/license/fair-data-austria-db-repository%2Ffda-services?gitlab_url=https%3A%2F%2Fgitlab.phaidra.org%2F&style=flat&cacheSeconds=3600)](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services)
![Spark 3.4](https://img.shields.io/badge/Spark-3.4-white?style=flat)
![Keycloak 24.0](https://img.shields.io/badge/Keycloak-24.0-white?style=flat)
<img src="./dbrepo-ui/public/logo.png" width="200" alt="DBRepo &mdash; Repository for Data in Databases" /> <img src="./dbrepo-ui/public/logo.png" width="200" alt="DBRepo &mdash; Repository for Data in Databases" />
......
...@@ -44,7 +44,6 @@ class ColumnAnalysisDto(BaseModel): ...@@ -44,7 +44,6 @@ class ColumnAnalysisDto(BaseModel):
null_allowed: bool null_allowed: bool
size: Optional[int] = None size: Optional[int] = None
d: Optional[int] = None d: Optional[int] = None
dfid: Optional[int] = None
enums: Optional[list] = None enums: Optional[list] = None
sets: Optional[list] = None sets: Optional[list] = None
......
...@@ -74,6 +74,8 @@ def determine_datatypes(filename, enum=False, enum_tol=0.0001, separator=',') -> ...@@ -74,6 +74,8 @@ def determine_datatypes(filename, enum=False, enum_tol=0.0001, separator=',') ->
if pandas.to_numeric(df[name], errors='coerce').notnull().all(): if pandas.to_numeric(df[name], errors='coerce').notnull().all():
logging.debug(f"mapped column {name} from float64 to decimal") logging.debug(f"mapped column {name} from float64 to decimal")
col.type = DataTypeDto.DECIMAL col.type = DataTypeDto.DECIMAL
col.size = 40
col.d = 20
else: else:
logging.debug(f"mapped column {name} from float64 to text") logging.debug(f"mapped column {name} from float64 to text")
col.type = DataTypeDto.TEXT col.type = DataTypeDto.TEXT
......
...@@ -36,6 +36,8 @@ class DetermineDatatypesTest(unittest.TestCase): ...@@ -36,6 +36,8 @@ class DetermineDatatypesTest(unittest.TestCase):
}, },
"Wert": { "Wert": {
"type": "decimal", "type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False, "null_allowed": False,
}, },
"Status": { "Status": {
...@@ -81,6 +83,8 @@ class DetermineDatatypesTest(unittest.TestCase): ...@@ -81,6 +83,8 @@ class DetermineDatatypesTest(unittest.TestCase):
}, },
"Wert": { "Wert": {
"type": "decimal", "type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False, "null_allowed": False,
}, },
"Status": { "Status": {
...@@ -125,6 +129,8 @@ class DetermineDatatypesTest(unittest.TestCase): ...@@ -125,6 +129,8 @@ class DetermineDatatypesTest(unittest.TestCase):
}, },
"Wert": { "Wert": {
"type": "decimal", "type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False, "null_allowed": False,
}, },
"Status": { "Status": {
...@@ -149,6 +155,8 @@ class DetermineDatatypesTest(unittest.TestCase): ...@@ -149,6 +155,8 @@ class DetermineDatatypesTest(unittest.TestCase):
}, },
"float": { "float": {
"type": "decimal", "type": "decimal",
"size": 40,
"d": 20,
"null_allowed": False, "null_allowed": False,
}, },
"string": { "string": {
......
No preview for this file type
...@@ -4,6 +4,16 @@ ...@@ -4,6 +4,16 @@
ref="form" ref="form"
v-model="valid" v-model="valid"
:disabled="disabled"> :disabled="disabled">
<v-row
v-if="showPrimaryKeyWarning">
<v-col md="8">
<v-alert
border="start"
color="warning">
{{ $t('pages.table.subpages.import.schema.primary.warn') }}
</v-alert>
</v-col>
</v-row>
<v-row <v-row
v-for="(c, idx) in columns" v-for="(c, idx) in columns"
:key="`r-${idx}`" :key="`r-${idx}`"
...@@ -79,7 +89,6 @@ ...@@ -79,7 +89,6 @@
:min="columnType(c).size_min" :min="columnType(c).size_min"
:max="columnType(c).size_max" :max="columnType(c).size_max"
:step="columnType(c).size_step" :step="columnType(c).size_step"
:value="columnType(c).size_required === true ? columnType(c).size_default : null"
:hint="sizeHint(c)" :hint="sizeHint(c)"
:clearable="!columnType(c).size_required" :clearable="!columnType(c).size_required"
persistent-hint persistent-hint
...@@ -163,16 +172,6 @@ ...@@ -163,16 +172,6 @@
@click="addColumn()" /> @click="addColumn()" />
</v-col> </v-col>
</v-row> </v-row>
<v-row
v-if="showPrimaryKeyWarning">
<v-col md="8">
<v-alert
border="start"
color="warning">
{{ $t('pages.table.subpages.import.schema.primary.warn') }}
</v-alert>
</v-col>
</v-row>
<v-row> <v-row>
<v-col> <v-col>
<v-btn <v-btn
...@@ -300,7 +299,7 @@ export default { ...@@ -300,7 +299,7 @@ export default {
this.columns.splice(idx, 1) this.columns.splice(idx, 1)
}, },
addColumn (name = '', type = null, null_allowed = true, primary_key = false, unique = false) { addColumn (name = '', type = null, null_allowed = true, primary_key = false, unique = false) {
this.columns.push({ const column = {
name, name,
type, type,
null_allowed, null_allowed,
...@@ -309,9 +308,10 @@ export default { ...@@ -309,9 +308,10 @@ export default {
sets_values: null, sets_values: null,
enums: [], enums: [],
enums_values: null, enums_values: null,
size: 0,
d: 0 d: 0
}) }
column.size = this.columnType(column).size_required === true ? this.columnType(column).size_default : null
this.columns.push()
this.$refs.form.validate() this.$refs.form.validate()
}, },
formatValues (column) { formatValues (column) {
......
...@@ -370,7 +370,7 @@ ...@@ -370,7 +370,7 @@
"hint": "Required. First line contains only data" "hint": "Required. First line contains only data"
}, },
"storage": { "storage": {
"text": "Dataset from Storage Service" "text": "Uploaded Dataset"
}, },
"quote": { "quote": {
"label": "Quote Encoding", "label": "Quote Encoding",
......
import {transformAssetUrls} from 'vite-plugin-vuetify' import {transformAssetUrls} from 'vite-plugin-vuetify'
import vuetify from 'vite-plugin-vuetify'
const proxy: any = {} const proxy: any = {}
...@@ -117,7 +118,12 @@ export default defineNuxtConfig({ ...@@ -117,7 +118,12 @@ export default defineNuxtConfig({
'@artmizu/nuxt-prometheus', '@artmizu/nuxt-prometheus',
'@nuxtjs/i18n', '@nuxtjs/i18n',
'@pinia/nuxt', '@pinia/nuxt',
'@pinia-plugin-persistedstate/nuxt' '@pinia-plugin-persistedstate/nuxt',
async (options, nuxt) => {
nuxt.hooks.hook('vite:extendConfig', config => config.plugins.push(
vuetify()
))
},
], ],
pinia: { pinia: {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
"@pinia-plugin-persistedstate/nuxt": "^1.2.0", "@pinia-plugin-persistedstate/nuxt": "^1.2.0",
"@types/qs": "^6.9.12", "@types/qs": "^6.9.12",
"sass": "^1.71.0", "sass": "^1.71.0",
"vite-plugin-vuetify": "^2.0.1" "vite-plugin-vuetify": "^2.0.4"
}, },
"browserslist": [ "browserslist": [
"defaults and fully supports es6-module", "defaults and fully supports es6-module",
......
...@@ -137,18 +137,12 @@ export default { ...@@ -137,18 +137,12 @@ export default {
}) })
.catch(({code}) => { .catch(({code}) => {
const toast = useToastInstance() const toast = useToastInstance()
if (typeof code !== 'string') {
return
}
toast.error(this.$t(code)) toast.error(this.$t(code))
}) })
}) })
.catch(({code}) => { .catch(({code}) => {
this.loading = false this.loading = false
const toast = useToastInstance() const toast = useToastInstance()
if (typeof code !== 'string') {
return
}
toast.error(this.$t(code)) toast.error(this.$t(code))
}) })
.finally(() => { .finally(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment