Skip to content
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

Use default profile and switch country-specific profiles into a feature flag #39

Merged
merged 114 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
5026ee6
refactor: Move common entities to org.niis...entity package
melbeltagy Jul 27, 2024
7a3489f
refactor: Move common repositories to org.niis...repository package
melbeltagy Jul 27, 2024
3ba25f1
refactor: Move DTOs from persistence module to lister module (splitti…
melbeltagy Jul 27, 2024
053eb3d
refactor: Move services from persistence module to collector module (…
melbeltagy Jul 27, 2024
0c8af98
refactor: Move lister's controllers into own (common/fi) controller p…
melbeltagy Jul 27, 2024
76b8e45
refactor: Move lister's endpoints into own (common/fi) endpoint package
melbeltagy Jul 27, 2024
b867bf1
refactor: Move lister's services into own (common/fi) service package
melbeltagy Jul 27, 2024
7fbb455
refactor: Move lister's converters into own (common/fi) converter pac…
melbeltagy Jul 27, 2024
63cabbe
refactor: Move lister's interceptors into own common interceptor package
melbeltagy Jul 27, 2024
23c1bea
refactor: Move lister's configurations into own common configuration …
melbeltagy Jul 27, 2024
dbc526e
refactor: Move lister's exception into own common exception package
melbeltagy Jul 27, 2024
e0b8483
refactor: Split CatalogService into two (one for each lister/collecto…
melbeltagy Jul 27, 2024
94c1b99
refactor: Split CompanyService into two (one for each lister/collecto…
melbeltagy Jul 27, 2024
0acc838
refactor: Split OrganizationService into two (one for each lister/col…
melbeltagy Jul 27, 2024
bd1b146
fix: Fix imports after refactorings
melbeltagy Jul 27, 2024
e741346
refactor: Move repositories' tests into corresponding (common/fi) ser…
melbeltagy Jul 28, 2024
7c65983
refactor: Remove persistence' Application class and keep it for tests…
melbeltagy Jul 28, 2024
39b7b46
fix: Add/fix tests initialization by scanning required packages
melbeltagy Jul 28, 2024
8a185f0
chore: Cleanup/remove unused code and SQL files from persistence's tests
melbeltagy Jul 28, 2024
0d8657d
refactor: Split collector's classes into default/vrk packages, add ap…
melbeltagy Jul 30, 2024
509a59b
refactor: Split collector's tests into default/vrk packages, fix newl…
melbeltagy Jul 30, 2024
e131ce8
refactor: Move main classes to org.niis package
melbeltagy Jul 30, 2024
4c96cd5
chore: Remove redundant dependencies
melbeltagy Jul 30, 2024
df32580
refactor: switch to application.properties
melbeltagy Jul 30, 2024
b22ae48
fix: Fix license
melbeltagy Jul 30, 2024
fde9ac8
refactor: Modify generation of classes from WSDL into package org.nii…
melbeltagy Jul 30, 2024
c9bdbac
refactor: Move ListerApplication into org.niis package
melbeltagy Jul 30, 2024
7f396ad
refactor: combine all properties into application.properties (default…
melbeltagy Jul 30, 2024
a4dade5
refactor: combine all properties into application.properties (default…
melbeltagy Jul 30, 2024
ad87b0e
refactor: Split lister service's classes into (default/Finland) speci…
melbeltagy Jul 30, 2024
e489b77
refactor: Undo moving repository tests to lister service (moved by mi…
melbeltagy Jul 30, 2024
f7f253a
chore: Clean-up unused DTO and corresponding tests
melbeltagy Jul 30, 2024
7e143d2
refactor: split lister's tests into default/Finland packages and fix …
melbeltagy Jul 30, 2024
600a001
refactor: expose postgres port in docker compose (at port 4910) for u…
melbeltagy Jul 30, 2024
05bc9fd
refactor: Update package from fi.vrk.* to fi.dvv.*.
melbeltagy Jul 30, 2024
de879ce
refactor: Update gradle's group's name to use org.niis prefix
melbeltagy Jul 30, 2024
cc708a7
refactor: Rename *VrkConfiguration (classes' names) to *FinlandConfig…
melbeltagy Jul 30, 2024
b926355
fix: Fix gradle build command for persistence (set build.gradle as a …
melbeltagy Jul 30, 2024
6b081fe
chore: Organize imports
melbeltagy Jul 30, 2024
3d4a939
fix: Fix typo
melbeltagy Jul 30, 2024
dd7e58a
doc: Fix JavaDoc
melbeltagy Jul 30, 2024
5e70047
fix: Fix dependency
melbeltagy Jul 30, 2024
fbe0fb3
fix: Fix failing pipeline (handle different timezone for some/failing…
melbeltagy Jul 30, 2024
89cd741
refactor: Unify checkstyle rules for main and test code, and upgrade …
melbeltagy Jul 30, 2024
554e29a
fix: Fix checkstyle issues
melbeltagy Jul 30, 2024
5e55ada
fix: Switch to string block to fix checkstyle error with string operator
melbeltagy Jul 30, 2024
2371f88
fix: Fix checkstyle issues
melbeltagy Jul 31, 2024
7f8cb89
chore: add application-dev.properties for both services with values f…
melbeltagy Jul 31, 2024
06eb416
chore: Increase log level for tests and local dev environments for ea…
melbeltagy Jul 31, 2024
b73fc02
chore: Clean up SSH-Test profile related settings
melbeltagy Jul 31, 2024
24fb180
chore: Fix pipeline's failing tests (change open_api fetched date to …
melbeltagy Jul 31, 2024
2506aaa
chore: Fix pipeline's failing tests (change organization fetched date…
melbeltagy Jul 31, 2024
6c069c8
chore: Fix pipeline's failing tests (change organization fetched date…
melbeltagy Jul 31, 2024
e896ce1
chore: Fix pipeline's failing tests (change organization fetched date…
melbeltagy Jul 31, 2024
e6053ba
refactor: Allow components scanning based on feature flag, and simpli…
melbeltagy Aug 1, 2024
059cb84
refactor: Allow components scanning based on feature flag, and simpli…
melbeltagy Aug 1, 2024
6d3082d
refactor: Remove usage of "fi" profile in lister service (feature fla…
melbeltagy Aug 1, 2024
b4fc857
chore: add missing datasource.url for lister's dev profile
melbeltagy Aug 1, 2024
3d780d0
chore: cleanup
melbeltagy Aug 1, 2024
0b10636
chore: don't use componse's name in services implementation
melbeltagy Aug 1, 2024
6082f03
refactor: rename main class to CollectorApplication
melbeltagy Aug 1, 2024
91e0dd8
refactor: Add a NewMembersEvent with listener and publisher component…
melbeltagy Aug 3, 2024
7223a2f
chore: don't use component's name in services implementation
melbeltagy Aug 3, 2024
da69e95
refactor: Refactor tasks initialization into using Spring components …
melbeltagy Aug 3, 2024
c3d005b
chore: add license header to new classes
melbeltagy Aug 3, 2024
b1131a9
chore: remove finland profile
melbeltagy Aug 3, 2024
280f2e6
chore: add missing property for catalog service for local dev env
melbeltagy Aug 3, 2024
56fa576
refactor: convert properties files into yaml files (for better suppor…
melbeltagy Aug 3, 2024
b4ec4ef
chore: sort properties alphabetical in each group, and the groups int…
melbeltagy Aug 3, 2024
1b8164e
chore: cleanup unused properties
melbeltagy Aug 3, 2024
6d843e1
chore: cleanup unused properties
melbeltagy Aug 3, 2024
6622e06
refactor: Load Finland specific properties into via its own FinlandTa…
melbeltagy Aug 3, 2024
750de0f
refactor: Group Finland specific properties into a nested properties …
melbeltagy Aug 3, 2024
a8d726f
refactor: Merge Finland's feature flag into Finland group
melbeltagy Aug 3, 2024
37ed0cf
chore: remove duplicate properties from application-dev.yaml
melbeltagy Aug 3, 2024
9462334
refactor: Merge Finland's feature flag into Finland group
melbeltagy Aug 3, 2024
424d902
refactor: Refactor properties into sub-hierarchy
melbeltagy Aug 5, 2024
f3b6922
Merge branch 'refs/heads/develop' into XRDCAT-8-clearer-profiles
melbeltagy Aug 5, 2024
0705fe8
fix: Fix persistence tests (add fi feature flag)
melbeltagy Aug 5, 2024
10c9f54
refactor: Convert to properties into yaml format
melbeltagy Aug 5, 2024
844fbf4
chore: cleanup persistence
melbeltagy Aug 5, 2024
e3317ee
fix: remove unused imports (fix checkstyle)
melbeltagy Aug 5, 2024
4e7dd64
fix: Fix collector tests after recent refactorings
melbeltagy Aug 5, 2024
2e43b60
fix: Fix checkstyle's issues
melbeltagy Aug 5, 2024
6f153e2
refactor: Rename DevelopmentConfiguration to TestingConfiguration
melbeltagy Aug 5, 2024
e97e75a
chore: cleanup unused exceptions from throws statement
melbeltagy Aug 5, 2024
82bdbf2
Merge branch 'refs/heads/develop' into XRDCAT-8-clearer-profiles
melbeltagy Aug 6, 2024
c353072
refactor: Use test profile in tests and remove redundant properties f…
melbeltagy Aug 7, 2024
acab65c
refactor: Use test profile in tests and remove redundant properties f…
melbeltagy Aug 7, 2024
e9de536
refactor: Use test profile in tests and remove redundant properties f…
melbeltagy Aug 7, 2024
936079c
doc: update comment regarding fi enable/disable flag
melbeltagy Aug 7, 2024
1c69deb
chore: clean and format application yaml files
melbeltagy Aug 7, 2024
c3c0249
chore: order application properties into logical order (instead of al…
melbeltagy Aug 7, 2024
3187355
chore: order application properties into logical order (instead of al…
melbeltagy Aug 7, 2024
faad9c7
chore: remove unused liquibase dependency from lister service
melbeltagy Aug 7, 2024
8b39132
chore: Update docker compose, switch to application.yaml for compose,…
melbeltagy Aug 8, 2024
7740cde
docs: update README(s)
melbeltagy Aug 8, 2024
693ce4e
chore: update yaml files
melbeltagy Aug 8, 2024
13a4a0d
docs: remove profiles related documentation from BUILD.md and replace…
melbeltagy Aug 8, 2024
3cb821a
docs: Add configurations section to collector's module README
melbeltagy Aug 8, 2024
eb984ee
docs: Add configurations section to collector's module README
melbeltagy Aug 8, 2024
77691ce
chore: update application.yaml
melbeltagy Aug 8, 2024
2d8c6fa
Merge branch 'refs/heads/develop' into XRDCAT-8-clearer-profiles
melbeltagy Aug 9, 2024
f6923b2
docs: update docs and comments to reference Finland feature flag inst…
melbeltagy Aug 9, 2024
5566596
docs: update docs to mention that postgre is the only supported RDBMS
melbeltagy Aug 9, 2024
30e87fc
chore: fix names
melbeltagy Aug 9, 2024
83f40f8
chore: publish list of new members' code as a set, instead of list
melbeltagy Aug 9, 2024
4e51492
chore: gitignore any file other than the sample yamls
melbeltagy Aug 9, 2024
2a50dd0
docs: update parameters paths
melbeltagy Aug 9, 2024
087280a
docs: Update configurations sections in READMEs
melbeltagy Aug 13, 2024
dc3ad90
docs: Update configurations sections in READMEs
melbeltagy Aug 13, 2024
bcb5027
docs: Update configurations sections in documentations
melbeltagy Aug 14, 2024
5c7aada
docs: Update list styles in READMEs
melbeltagy Aug 15, 2024
7495a16
docs: Remove "Required" column from configurations sections in READMEs
melbeltagy Aug 15, 2024
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
8 changes: 3 additions & 5 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ See [xroad-catalog-persistence/README.md](xroad-catalog-persistence/README.md#bu
Profiles can be used to configure different features in X-Road Catalog. By default, X-Road Catalog supports 1 profile,
the `default` profile with all configurations in place.
melbeltagy marked this conversation as resolved.
Show resolved Hide resolved

For Finland's national business registry, a feature flag is used to enable fetching additional data from the registry.
The flag is `xroad-catalog.country.fi.enabled` and it is set to `false` by default. When the flag is set to `true`,
corresponding features will be enabled.
Fetching additional data from the Finnish Business Registry and the Suomi.fi Finnish Service Catalogue can enabled
using the `xroad-catalog.country.fi.enabled` flag. When the flag is set to `true`, fetching the data is enabled.
The default value is `false`.

X-Road Catalog supports adding new profiles. For example, new country-specific features should be added by creating a
new country-specific profile.
57 changes: 29 additions & 28 deletions doc/xroad_catalog_installation_guide.md
melbeltagy marked this conversation as resolved.
Show resolved Hide resolved
melbeltagy marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -156,38 +156,38 @@ The following parameters must be manually configured in `/etc/xroad/xroad-catalo
especially X-Road instance information and URL of Security Server.

```properties
xroad-catalog.xroad-instance=<XROAD_INSTANCE>
xroad-catalog.member-class=<MEMBER_CLASS>
xroad-catalog.member-code=<MEMBER_CODE>
xroad-catalog.subsystem-code=<SUBSYSTEM_CODE>
xroad-catalog.security-server-host=<SECURITY_SERVER_HOST>
xroad-catalog.target.xroad-instance=<XROAD_INSTANCE>
xroad-catalog.target.member-class=<MEMBER_CLASS>
xroad-catalog.target.member-code=<MEMBER_CODE>
xroad-catalog.target.subsystem-code=<SUBSYSTEM_CODE>
xroad-catalog.urls.security-server-host=<SECURITY_SERVER_HOST>
```

When using the `xroad-catalog-collector` module with the `FI` profile, the following additional parameters must be
configured in the same file:
When using the `xroad-catalog-collector` module with the `xroad-catalog.country.fi.enabled` feature flag set to `true`,
the following additional parameters must be configured:

```properties
xroad-catalog.fetch-organizations-url=<ORGANIZATIONS_API_URL>
xroad-catalog.fetch-companies-url=<COMPANIES_API_URL>
xroad-catalog.country.fi.fetch.organizations.url=<ORGANIZATIONS_API_URL>
xroad-catalog.country.fi.fetch.companies.url=<COMPANIES_API_URL>
```

Optional parameters which can be configured in the same file are described below along with their default values:

| Parameter | Defaults | Description |
|--------------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `xroad-catalog.fetch-run-unlimited` | false | A parameter for setting whether the X-Road Catalog Collector should try to fetch data from Security Server continuously during a day or only between certain hours, e.g. value `true` means `continously`. |
| `xroad-catalog.fetch-time-after-hour` | 3 | A parameter for setting the start of time interval during which the X-Road Catalog Collector should try to fetch data from Security Server continuously (this parameter will be ignored if the parameter `xroad-catalog.fetch-run-unlimited` is set to `true`), e.g. value `18` means starting from `18:00`. |
| `xroad-catalog.fetch-time-before-hour` | 4 | A parameter for setting the end of time interval during which the X-Road Catalog Collector should try to fetch data from Security Server continuously (this parameter will be ignored if the parameter `xroad-catalog.fetch-run-unlimited` is set to `true`), e.g. value `23` means ending at `23:00`. |
| `xroad-catalog.collector-interval-min` | 20 | A parameter for setting the amount of time in minutes after which the X-Road Catalog Collector should start re-fetching data from Security Server, e.g. value `20` means `every 20 minutes`. |
| `xroad-catalog.list-methods-pool-size` | 50 | A parameter for setting the amount of virtual threads in the pool for fetching methods metadata from Security Server, e.g. value `50` means `50 virtual threads`. |
| `xroad-catalog.fetch-wsdl-pool-size` | 10 | A parameter for setting the amount of virtual threads in the pool for fetching WSDLs from Security Server, e.g. value `10` means `10 virtual threads`. |
| `xroad-catalog.fetch-rest-pool-size` | 10 | A parameter for setting the amount of virtual threads in the pool for fetching REST services from Security Server, e.g. value `10` means `10 virtual threads`. |
| `xroad-catalog.fetch-openapi-pool-size` | 10 | A parameter for setting the amount of virtual threads in the pool for fetching OpenAPI services from Security Server, e.g. value `10` means `10 virtual threads`. |
| `xroad-catalog.flush-log-time-after-hour` | 3 | A parameter for setting the start of time interval during which the error logs in the db will be deleted when those exceed the amount in days set by `xroad-catalog.error-log-length-in-days` parameter, e.g. value `18` means starting from `18:00`. |
| `xroad-catalog.flush-log-time-before-hour` | 4 | A parameter for setting the end of time interval during which the error logs in the db will be deleted when those exceed the amount in days set by `xroad-catalog.error-log-length-in-days` parameter, e.g. value `23` means ending at `23:00`. |
| `xroad-catalog.error-log-length-in-days` | 90 | A parameter for setting the amount in days for how long the errors logs should be kept in the db, e.g. value `90` means `for 90 days`. |

When using the `xroad-catalog-collector` module with the `FI` profile, the following additional optional parameters are
| Parameter | Defaults | Description |
|--------------------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `xroad-catalog.tasks.fetch-run-unlimited` | false | A parameter for setting whether the X-Road Catalog Collector should try to fetch data from Security Server continuously during a day or only between certain hours, e.g. value `true` means `continously`. |
| `xroad-catalog.tasks.fetch-time-after-hour` | 3 | A parameter for setting the start of time interval during which the X-Road Catalog Collector should try to fetch data from Security Server continuously (this parameter will be ignored if the parameter `xroad-catalog.fetch-run-unlimited` is set to `true`), e.g. value `18` means starting from `18:00`. |
| `xroad-catalog.tasks.fetch-time-before-hour` | 4 | A parameter for setting the end of time interval during which the X-Road Catalog Collector should try to fetch data from Security Server continuously (this parameter will be ignored if the parameter `xroad-catalog.fetch-run-unlimited` is set to `true`), e.g. value `23` means ending at `23:00`. |
| `xroad-catalog.tasks.collector-interval-min` | 20 | A parameter for setting the amount of time in minutes after which the X-Road Catalog Collector should start re-fetching data from Security Server, e.g. value `20` means `every 20 minutes`. |
| `xroad-catalog.pool-size.list-methods` | 50 | A parameter for setting the amount of virtual threads in the pool for fetching methods metadata from Security Server, e.g. value `50` means `50 virtual threads`. |
| `xroad-catalog.pool-size.fetch-wsdl` | 10 | A parameter for setting the amount of virtual threads in the pool for fetching WSDLs from Security Server, e.g. value `10` means `10 virtual threads`. |
| `xroad-catalog.pool-size.fetch-rest` | 10 | A parameter for setting the amount of virtual threads in the pool for fetching REST services from Security Server, e.g. value `10` means `10 virtual threads`. |
| `xroad-catalog.pool-size.fetch-openapi` | 10 | A parameter for setting the amount of virtual threads in the pool for fetching OpenAPI services from Security Server, e.g. value `10` means `10 virtual threads`. |
| `xroad-catalog.log-storage.flush-log-time-after-hour` | 3 | A parameter for setting the start of time interval during which the error logs in the db will be deleted when those exceed the amount in days set by `xroad-catalog.error-log-length-in-days` parameter, e.g. value `18` means starting from `18:00`. |
| `xroad-catalog.log-storage.flush-log-time-before-hour` | 4 | A parameter for setting the end of time interval during which the error logs in the db will be deleted when those exceed the amount in days set by `xroad-catalog.error-log-length-in-days` parameter, e.g. value `23` means ending at `23:00`. |
| `xroad-catalog.log-storage.error-log-length-in-days` | 90 | A parameter for setting the amount in days for how long the errors logs should be kept in the db, e.g. value `90` means `for 90 days`. |

When using the `xroad-catalog-collector` module with the `xroad-catalog.country.fi.enabled` feature flag set to `true`, the following additional optional parameters are
in effect:

| Parameter | Defaults | Description |
Expand All @@ -203,14 +203,14 @@ in effect:
| `xroad-catalog.country.fi.fetch.external-limit` | 500 | A parameter for setting the maximum amount of Members that should be fetched per external API in one run, e.g. value `500` means `500 members`. In the current implementation the example value would fetch `500` members information from both the `company` and `organization` API. |
| `xroad-catalog.country.fi.fetch.external-update-after-days` | 7 | A parameter for setting the amount of days after which the X-Road Catalog Collector should consider Company and Organization data stale and try to fetch data from the external API again, e.g. value `7` means `after 7 days`. |

In addition, update the `xroad-catalog.shared-params-file` property value in `/etc/xroad/xroad-catalog/lister-production.properties`.
In addition, update the `xroad-catalog.shared-params-file` property value.
melbeltagy marked this conversation as resolved.
Show resolved Hide resolved
The value must point to the `/etc/xroad/globalconf/<INSTANCE_IDENTIFIER>/shared-params.xml` X-Road global configuration file:

```properties
xroad-catalog.shared-params-file=/etc/xroad/globalconf/<INSTANCE_IDENTIFIER>/shared-params.xml
```

Change also the database password in `/etc/xroad/xroad-catalog/catalogdb-production.properties`:
Change also the database password:

```properties
spring.datasource.password=password
Expand Down Expand Up @@ -254,10 +254,11 @@ keytool -keystore /etc/xroad/xroad-catalog/keystore -exportcert -rfc -alias xroa

The created `xroad-catalog.cer` file must be added to the Security Server (Through UI: Security Server Clients > SELECT SERVICE > Internal Servers > Internal TLS Certificates > ADD)

The keystore password can be configured in `/etc/xroad/xroad-catalog/collector-production.properties`.
The keystore location and password can be configured using:

```properties
xroad-catalog.ssl-keystore-password=changeit
xroad-catalog.ssl-keystore.location=/etc/xroad/xroad-catalog/keystore
xroad-catalog.ssl-keystore.password=changeit
```

## 2.7 Post-Installation Checks
Expand Down
4 changes: 4 additions & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
collector/config
lister/config
!collector/config/*.sample.yaml
!lister/config/*.sample.yaml
confclient/data/configuration-anchor.xml
Loading
Loading