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 all 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
51 changes: 12 additions & 39 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,48 +41,21 @@ as well), especially if you set up a local X-Road ecosystem.
```
* The build scripts assumes the above directory structure.

## Build X-Road Catalog Collector
## Build

See [xroad-catalog-collector/README.md](xroad-catalog-collector/README.md#build) for details.
To build all modules, run the following command in the root directory:

## Build X-Road Catalog Lister
```bash
./gradlew clean build
```

See [xroad-catalog-lister/README.md](xroad-catalog-lister/README.md#build) for details.

## Build X-Road Catalog Persistence

See [xroad-catalog-persistence/README.md](xroad-catalog-persistence/README.md#build) for details.

## Profiles

Profiles can be used to configure different features in X-Road Catalog. By default, X-Road Catalog includes four different
profiles:
To build a specific module:

* `default` - a profile used for default operation of X-Road Catalog, without any country-specific features.
* The default profile can be set with `spring.profiles.active=`.
* `fi` - an extra profile used in addition to the default profile, which has country-specific (Finland) features, e.g.,
fetching additional data from a national business registry. Other country-specific profiles can be added if needed.
* The profile can be set with `spring.profiles.active=fi`.
* `production` - a profile used in the production deployment.
* The profile can be set with `spring.profiles.active=production`.
* `sshtest` - a profile used to test SSH tunneling with X-Road Catalog.
* The profile can be set with `spring.profiles.active=sshtest`.
* **Build X-Road Catalog Collector**
See [xroad-catalog-collector/README.md](xroad-catalog-collector/README.md#build) for details.

Multiple profiles can be activated at the same time by separating them with a comma, e.g., `spring.profiles.active=production,fi`.

X-Road Catalog supports adding new profiles. For example, new country-specific features should be added by creating a
new country-specific profile.

### How Profiles Are Used During the Build?
* **Build X-Road Catalog Lister**
See [xroad-catalog-lister/README.md](xroad-catalog-lister/README.md#build) for details.

* First, a Docker image for building the X-Road Catalog rpm packages is built.
* For X-Road Catalog Collector:
```bash
docker build -t collector-rpm packages/xroad-catalog-collector/docker --build-arg CATALOG_PROFILE=fi
```
* For X-Road Catalog Lister:
```bash
docker build -t lister-rpm packages/xroad-catalog-lister/docker --build-arg CATALOG_PROFILE=fi
```
* Profile value is provided to the respective `Dockerfile` with an argument `--build-arg CATALOG_PROFILE=fi`. Then within
the `Dockerfile` an environment variable `CATALOG_PROFILE` is initalized with that profile value.
* **Build X-Road Catalog Persistence**
See [xroad-catalog-persistence/README.md](xroad-catalog-persistence/README.md#build) for details.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ext {


allprojects {
group = 'fi.vrk.xroad'
group = 'org.niis.xroad'
version = project_version

tasks.withType(JavaCompile).configureEach {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/groovy/catalogservice.java-checks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ licenseFormatMain.source = fileTree('src/main')
licenseFormatTest.source = fileTree('src/test')

checkstyle {
toolVersion = "10.12.6"
toolVersion = "10.17.0"
configDirectory = file("${project.rootDir}/config/checkstyle")
ignoreFailures = false
showViolations = false
Expand All @@ -28,7 +28,7 @@ checkstyleMain {

checkstyleTest {
source = fileTree('src/test/java')
configFile = file("${project.rootDir}/config/checkstyle/checkstyle-test.xml")
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
}

configurations.checkstyle {
Expand Down
141 changes: 0 additions & 141 deletions config/checkstyle/checkstyle-common.xml

This file was deleted.

23 changes: 0 additions & 23 deletions config/checkstyle/checkstyle-test.xml

This file was deleted.

9 changes: 6 additions & 3 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="SuppressWarningsFilter" />
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>

<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>
Expand Down Expand Up @@ -135,9 +139,7 @@
<module name="InterfaceIsType"/>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="TodoComment">
<property name="severity" value="warning"/>
</module>
<module name="TodoComment"/>
<module name="UpperEll"/>
<module name="AvoidStarImport">
<property name="severity" value="error"/>
Expand All @@ -147,6 +149,7 @@
<property name="basicOffset" value="4"/>
<property name="lineWrappingIndentation" value="8"/>
</module>
<module name="ConstructorsDeclarationGrouping"/>
</module>
<!-- Some checks are disabled for specific source sets (i.e. tests)-->
<module name="SuppressionFilter">
Expand Down
Loading
Loading