Skip to content

feat(sqlite): Use new SQLite Database #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 70 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
f06fd9b
update function to get ahb table from database
hf-krechan Apr 15, 2025
44b313e
update function to get all format versions
hf-krechan Apr 15, 2025
d68d4be
WIP to update get all known prüfis
hf-krechan Apr 15, 2025
1a1f0fc
fix query for pruefis
hf-krechan Apr 15, 2025
1e92055
remove D_ from Dataelements
hf-krechan Apr 15, 2025
ac78483
update ahb line entity
hf-krechan Apr 15, 2025
236be3c
add conditions in table view
hf-krechan Apr 15, 2025
379dd87
remove duplicate SG
hf-krechan Apr 22, 2025
81f2d61
update ahb.db
hf-krechan Apr 22, 2025
981b207
put mapping into two functions
hf-krechan Apr 22, 2025
f8de608
add line_type in orm model
hf-krechan Apr 22, 2025
3a3cb86
remove unused import
hf-krechan Apr 22, 2025
1fd7262
fix segment name
hf-krechan Apr 22, 2025
c7387b8
wip column mapping
hf-krechan Apr 22, 2025
2e24554
add line_type to openapi sepc
hf-krechan Apr 22, 2025
7921fbb
remove unused import
hf-krechan Apr 22, 2025
32d2b47
generate code from openapi spec
hf-krechan Apr 22, 2025
1b7b70f
add line_type
hf-krechan Apr 22, 2025
984be3f
use line type to define border style
hf-krechan Apr 22, 2025
354befe
getting closer
hf-krechan Apr 22, 2025
7e57afd
even closer
hf-krechan Apr 22, 2025
800dd98
remove unused code sections
hf-krechan Apr 22, 2025
50fb57a
use isSegmentGroup
hf-krechan Apr 22, 2025
98b4a69
Change from data_element to data_element: thin line
hf-krechan Apr 22, 2025
10b66ca
refactor broder style matching
hf-krechan Apr 22, 2025
f6509db
use git lfs
hf-krechan Apr 22, 2025
09e84b6
change filter for lfs to *.db
hf-krechan Apr 22, 2025
7a0e44e
add fernet dependency
hf-krechan Apr 22, 2025
03af52a
use encrypted database
hf-krechan Apr 22, 2025
4fa12c3
add encrypted sqlite
hf-krechan Apr 22, 2025
8e0bbb4
ignore ahb.db
hf-krechan Apr 22, 2025
47bbe0d
use lfs true for checkouts in github actions
hf-krechan Apr 22, 2025
c98243a
ignore 7z files
hf-krechan Apr 22, 2025
2042f09
add fenret key to dev and prod stacks
hf-krechan Apr 22, 2025
e01b19f
read and set fenret key
hf-krechan Apr 22, 2025
de7d0d9
remove unused import
hf-krechan Apr 22, 2025
ffddaf4
fix linter warnings by running `ng lint --fix`
hf-krechan Apr 22, 2025
f41ab5a
set fernet key env var
hf-krechan Apr 22, 2025
057d0ca
use 7z
hf-krechan Apr 23, 2025
4311ebe
working approach 7z approach
hf-krechan Apr 23, 2025
9adfb0d
remove duplicate code
hf-krechan Apr 23, 2025
f4fff67
remove fernet encrypted ahb db
hf-krechan Apr 23, 2025
011a9a3
use new env var name to clarify
hf-krechan Apr 23, 2025
be9c5d7
remove fernet dependencies
hf-krechan Apr 23, 2025
ec6ff1f
update environment variable in pulumi
hf-krechan Apr 23, 2025
2bb2ee3
update secret for 7z archive
hf-krechan Apr 23, 2025
0c4fcc4
add environment variable for 7z archive password
hf-krechan Apr 23, 2025
955312f
update environment variable in test ci
hf-krechan Apr 23, 2025
e13dbbe
add link to secret
hf-krechan Apr 23, 2025
6ad1dd7
update file name for encrypted database
hf-krechan Apr 23, 2025
cf710ae
use 7zip-min
hf-krechan Apr 24, 2025
3271e10
feat(7z-decrypt): Use 7z in Dockerfile (#554)
hf-krechan Apr 24, 2025
a5587bc
remove 7zip-min dependency
hf-krechan Apr 24, 2025
a3b6a4f
remove gitattributes for LFS
hf-krechan Apr 24, 2025
2cb58e1
remove lfs
hf-krechan Apr 24, 2025
7a3c92c
allow 7z files again
hf-krechan Apr 24, 2025
df81e86
add 7z sqlite database
hf-krechan Apr 24, 2025
a867a83
use most recent sqlite db (contains even more segment, doesn't have t…
Apr 24, 2025
0ab90de
chore: Upgrade to Node 23.11 (#555)
hf-krechan Apr 25, 2025
265b011
clean dockerignore
hf-krechan Apr 25, 2025
d2ccb38
improve dockerfile
hf-krechan Apr 25, 2025
05614c8
add section to tell contributors that they need a password
hf-krechan Apr 25, 2025
2636e3c
update docker-compose
hf-krechan Apr 25, 2025
cf0e0d9
update example env
hf-krechan Apr 25, 2025
b73f85b
add docker environment
hf-krechan Apr 25, 2025
405baec
add docker env in bruno
hf-krechan Apr 25, 2025
28a86e4
update companystylesheet
hf-krechan Apr 25, 2025
7182cc2
add hint where the sqlite comes from
hf-krechan Apr 25, 2025
635f862
remove deprecated code lines
hf-krechan Apr 25, 2025
d8afeee
remove 7z relict
hf-krechan Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.db filter=lfs diff=lfs merge=lfs -text
4 changes: 3 additions & 1 deletion .github/workflows/action_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

lfs: true
- uses: actions/setup-node@v4
with:
node-version: '20.13'
Expand All @@ -35,6 +35,8 @@ jobs:

- name: Unit tests
run: npm test
env:
FERNET_KEY: ${{ secrets.SQLITE_AHB_DB_FERNET_KEY }} # secret is set in organization settings

- name: Build frontend
run: npm run ng:build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
lfs: true
- name: Set build and release information
id: build_release_info
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ Thumbs.db
.nx/cache
.nx/workspace-data


src/server/data/ahb.db
*.7z
4 changes: 4 additions & 0 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ components:
value_pool_entry:
type: string
example: 'Entry1'
line_type:
type: string
example: 'segment'
required:
- ahb_expression
- data_element
Expand All @@ -178,6 +181,7 @@ components:
- segment_code
- segment_group_key
- value_pool_entry
- line_type
meta:
type: object
properties:
Expand Down
34 changes: 34 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
"@auth0/auth0-angular": "^2.2.3",
"@azure/storage-blob": "^12.27.0",
"@mdi/font": "^7.4.47",
"@types/fernet": "^0.4.3",
"cors": "^2.8.5",
"dotenv": "^16.5.0",
"express": "^4.21.2",
"fernet": "^0.3.3",
"prettier": "^3.5.3",
"reflect-metadata": "^0.2.2",
"rxjs": "~7.8.2",
Expand Down
2 changes: 2 additions & 0 deletions pulumi/Pulumi.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ config:
pulumi:template: container-azure-python
ahb-tabellen:ohDearHealthCheckSecret:
secure: AAABAMlO2g+61udj5KO4b16Pg2ESsCmCAdj2LIvT77mrZdHkCZeANgSQz+0aBbkW
ahb-tabellen:fenret_key:
secure: AAABAPIG9l/5BbjTByzHszRR9S28m7nW0SuXYtEVFSvbFHHNntBA85FGY78zd8dJ65oWTsxLy/UV6u9P3odx0YLp9EBnVk7F/9Hsmg==
2 changes: 2 additions & 0 deletions pulumi/Pulumi.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ config:
pulumi:template: container-azure-python
ahb-tabellen:ohDearHealthCheckSecret:
secure: AAABAHVhi8bu62ZujXIZQcHtU5USavOgn5rciI24E5ahGg3CPqt3mnRktu1uovTS
ahb-tabellen:fenret_key:
secure: AAABALBNlApjPHwXyNhMbG1eNylx/OofcVMc18C9NzPSCMuTU022e/2x+NEfFzZXFqITVWepu/rLIHb6Z+rCV0xf/h4N7/zYMWK8jw==
4 changes: 4 additions & 0 deletions pulumi/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
oh_dear_health_check_secret = config.require_secret("ohDearHealthCheckSecret")
assert oh_dear_health_check_secret, "ohDearHealthCheckSecret must be set"

fernet_key = config.require_secret("fernet_key")
assert fernet_key, "fernet_key must be set"

cpu = config.get_int("cpu", 1)
memory = config.get_int("memory", 2)

Expand Down Expand Up @@ -130,6 +133,7 @@
azure_native.web.NameValuePairArgs(name="ENVIRONMENT", value=environment),
azure_native.web.NameValuePairArgs(name="WEBSITES_CONTAINER_START_TIME_LIMIT", value=websites_container_start_time_limit),
azure_native.web.NameValuePairArgs(name="OH_DEAR_HEALTH_CHECK_SECRET", value=oh_dear_health_check_secret),
azure_native.web.NameValuePairArgs(name="FERNET_KEY", value=fernet_key),
],
linux_fx_version=f"DOCKER|{image_name_with_tag}",
),
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/api/api-configuration.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

import { Injectable } from '@angular/core';
Expand Down
9 changes: 4 additions & 5 deletions src/app/core/api/api.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
Expand All @@ -8,7 +8,7 @@ import { ApiConfiguration, ApiConfigurationParams } from './api-configuration';

import { AhbService } from './services/ahb.service';
import { MaintenanceService } from './services/maintenance.service';
import { provideHttpClient } from '@angular/common/http';

/**
* Module that provides all services and configuration.
*/
Expand All @@ -19,8 +19,7 @@ import { provideHttpClient } from '@angular/common/http';
providers: [
AhbService,
MaintenanceService,
ApiConfiguration,
provideHttpClient()
ApiConfiguration
],
})
export class ApiModule {
Expand All @@ -36,7 +35,7 @@ export class ApiModule {
}
}

constructor(
constructor(
@Optional() @SkipSelf() parentModule: ApiModule,
@Optional() http: HttpClient
) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/api/base-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

import { Injectable } from '@angular/core';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

export { ApiConfiguration } from './api-configuration';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/api/models.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

export { Ahb } from './models/ahb';
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/api/models/ahb.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

export interface Ahb {
Expand All @@ -14,6 +14,7 @@ export interface Ahb {
'segment_code': string;
'segment_group_key': string;
'value_pool_entry': string;
'line_type': string;
}>;
meta: {
'description': string;
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/api/models/format-version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

export type FormatVersion = string;
2 changes: 1 addition & 1 deletion src/app/core/api/models/version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

export interface Version {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/api/services.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

export { AhbService } from './services/ahb.service';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/api/services/ahb.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

import { HttpClient, HttpContext } from '@angular/common/http';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/api/services/maintenance.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

import { HttpClient, HttpContext } from '@angular/common/http';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/api/strict-http-response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */

import { HttpResponse } from '@angular/common/http';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
<tr [class]="getRowClass(i)">
<td
class="px-6 py-4"
[class.font-bold]="isNewSegment(i)"
[class.font-bold]="isSegmentGroup(i)"
[innerHTML]="line.segment_group_key | highlight: highlight()"></td>
<td
class="px-6 py-4"
[class.font-bold]="isNewSegment(i)"
[class.font-bold]="isSegmentGroup(i)"
[innerHTML]="line.section_name | highlight: highlight()"></td>
<td
class="px-6 py-4"
[class.font-bold]="isNewSegment(i)"
[class.font-bold]="isSegmentGroup(i)"
[innerHTML]="line.segment_code | highlight: highlight()"></td>
<td class="px-6 py-4" [innerHTML]="line.data_element | highlight: highlight()"></td>
<td class="px-6 py-4">
Expand Down
Loading
Loading