Skip to content

Commit

Permalink
Feat gradle version update (#2)
Browse files Browse the repository at this point in the history
* new grgit version

* finishing update in build.gradle in relation to upgrade

* expect build to be run from main directory

* a kinda weird hack to enable running from war, missing libs

* updated myaddons.xml

* altered building of war due to new gradle version

* fixed stupid mistake

* update do Dockerfile

* remove unused scripts, bitronix config features parameterized

* upgrading logging lib

* EntityBulk importer class - a helper class to utilize work already done on entities handling, but bring efficiency of working in batches (especially when importing)

* New components added

* remove dependency on Mongo in Moqui

* small refactor

* customized handling of update for flexible-schema based entities

* test purpose comment added

* revert

* another test

* revert

* test framework upgraded to JUnit 5, new edpoint service handler that will serve all entity based REST calls

* need to run all tests

* edited 2x .yml to compy with standard, use network in correct way and make generateDatabaseDumb functional

* searching for entities fixed, moved QueryHelpers to new package, checking PrimaryKey field now supports checking for field name

* endpoint service enhancement, limiting fields added to output

* renaming handlers

* extending single entity-based endpoint manipulation service - delete entity

* new endpoint service handler functionality - deleting

* refactored class, to accomodate both delete and fetch methods

* Same arguments check added to all service calls

* supporting different operators for constructing queries

* check list sizes

* timestamps not in response by default

* forbidden fields

* migrated all CRUD operations to EndpointServiceHandler

* ignore temp directory

* need some debug info when running EndpointHandler

* small fix

* logging added

* checks

* missed boolean switch

* removes switch in entity find

* println added

* enhanced

* duplicate strategy setup

* is this it?

* do not return directly

* fixed error when loading entity definition

* new feature to disallow primaryKey creation, once the ID is provided

* Condition field load term field from columnKey

* changed columnKey to field

* changes related to Mongo updates

* Supporting both array/map when running create service via EndpointServiceHandler

* not returning list of created entities if more than one is being created

* derive group name from entity definition

* Fixed removing of item

* fix loading special entity using EndpointServiceHandler

* changes related to JSON support, when writing and reading from H2 database; not only Postgres is supported; all is configurable

* solving JSON handling

* JSON handling

* run tests, run

* introduce default error-response-generation

* New unit test added to make sure dates can be added when inserted as string

* changed versions of SnakeYAML and grgit-gradle

* fix endpoint-service handler

* removed gradle.properties

* removed gradle.properties from framework as well

* docker-compose file upgrade

* docker-compose file upgrade

* volume mount change

* separate scripts for WIN and LINUX

* changed file mod

* invalid slash

* copy syntax fixed

* pass environment variable value

* env not build

* fixed way args are passed

* env

* set as ENV

* correct network alias

* resolving docker's issue

* using docker-host

* really?

* more suitable to have this container along with the running server

* container name set correctly

* reverted

* replaced fixed IP with logical value

* IP of docker host

* desperate use of HTTP_PROXY

* HTTP_PROXY passing

* removed wget from building file

* volume's not accessible in build time

* local files dir

* clearing up not script not working in Linux

* correct configuration

* Revert "correct configuration"

This reverts commit 6ffd2979eafd480b79436ee422e85fede6db0a98.

* should work

* unnecessary

* cleanups, healthcheck removed

* restore database script does not need to deal with users + database dump now does it into two files, so that we can manipulate user password more easily

* typos

* log dump file name

* back to single dump

* error in sql

* eol fix

* reset password mail template fixed

* file name fix

* download gradle, rather than copying it manually

* Support for handling attachments included in moqui base

* unsupported calls removed

* support for overwriting data when creating data, if switched on. by default - it's turned off

* enhanced response handling for updating, new method to convert string to LocalDate

* small test + enhancements into EndpointServiceHandler to support table name provisioning only

* returning array is more useful

* fix fillResultset method to support converting Document into HashMap

* removed service wrapper, now using direct call instead

* rendering template and returning html in EndpointServiceHandler

* moqui now using WAIT tool to run and wait for specific services, appended build ARG

* cleanups

* first version, ping-pong not working

* new stomp-client for managing communication with JMS, introduction of new tooling for providing access to communication, logging instead of sending useless message

* cleanup + fixing log4j2 + slf4j2 logging

* logging update

* JMS login fix

* StompClient login fix

* new feature for flattening map when populating data using EndpointEntityHandler, along with tests

* renamed methods, now is more readable, removed check that was useless for our purpose

* new tests for utilities, new features to EndpointServiceHandler to allow customized query handling with conditions being allowed to be constructed dynamically

* added functionality for complex query composition when using EndpointServiceHandler - now all it takes to compose query is to pass `complexCondition` in args

* functionality of entity-wise cache introduced, must be used with great caution

* reactivity enhanced, no need to use EECAS

* allow only fields that are set in entity definition

* endpoint prepared for being used for cache loading, SynchroMaster now supports temporarily disabling cache monitoring, new test added

* create EECA rule in a single hop, without need to generate three rules

* tests extended, now we handle most of the expected exceptions

* querying cache now works in basic functionality

* New test scenario added

* new cached search query tests

* new operators supported - like and not-like when searching in cache, condition-evaluation moved to condition file

* added support for `IN` and `NOT-IN` conditions

* LT, LTE, GT, GTE operators introduced

* new test prepared to benchmark execution of queries, little helper method to make it easier to debug to file

* new conditions for cache-query, debug tools enhancements, comparison-based test + new test scenarios

* use EntityDefinition instead of pure entity name

* support for reading bytes to JSON when working with cache

* just for the sake of testing

* small method for cleaning up pycalc properties being handed over to PY-CALC

* implementing complex queries was fortunately quite easy, just had to use mapMatches method of EntityConditionImplBase

* handling ID in situations when ID column is different compared to field value

* refactored checking ID column

* changed debug level and error message

* tidying up

* missing important keyword in ConditionHandler

* generic functionality of parsing ID

* cleanup

Co-authored-by: Michal Rovnanik on WS <michal@rovnanik.sk>
Co-authored-by: MajoBerger <marian.berger@dataquest.sk>
Co-authored-by: MajoBerger <88670521+MajoBerger@users.noreply.github.com>
Co-authored-by: MilanMajchrák <milan.majchak@dataquest.sk>
Co-authored-by: root <root@mtx-mis.05mcc1ykttze5kdqijngmdk4qa.ax.internal.cloudapp.net>
  • Loading branch information
6 people authored Jan 5, 2023
1 parent 4e2df8b commit 8b9bf0a
Show file tree
Hide file tree
Showing 103 changed files with 12,616 additions and 793 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# local files
__*

# files directory
/files

# db dumps
*.sql
*.zip
Expand All @@ -15,6 +18,7 @@ __*
build
.gradle
.shelf
gradle.properties
/framework/dependencies

# build generated files
Expand All @@ -24,6 +28,7 @@ build
# runtime directory (separate repository so ignore directory entirely)
/runtime
/execwartmp
/wartemp
/docker/runtime

# IntelliJ IDEA files
Expand Down
2 changes: 0 additions & 2 deletions build-utils/db/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion build-utils/db/RecreateDatabase.bat

This file was deleted.

11 changes: 0 additions & 11 deletions build-utils/db/RecreateDatabase.sql.rename

This file was deleted.

3 changes: 0 additions & 3 deletions build-utils/db/readme.txt

This file was deleted.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies { classpath 'org.ajoberstar.grgit:grgit-gradle:4.1.1' }
dependencies { classpath 'org.ajoberstar.grgit:grgit-gradle:4.1.0-rc.1' }
}
// Not needed for explicit use, causes problems when not from git repo: plugins { id 'org.ajoberstar.grgit' version 'x.y.z' }

Expand Down
4 changes: 2 additions & 2 deletions docker/build-scripts/gs-generate-pg-dump.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ docker-compose ^
-p moqui-fill ^
-f fill-database.yml ^
build ^
--no-cache
--no-cache ^
--build-arg PG_LOAD_SERVER=host.docker.internal

REM run DUMP script
type DumpDatabase.sql | docker exec -i dev-postgres su postgres

REM kill 'em
docker-compose -p moqui-fill -f fill-database.yml down --rmi local -v
docker-compose -p pg-dump -f create-database.yml down --rmi local -v

REM return back to original dir
Expand Down
26 changes: 26 additions & 0 deletions docker/build-scripts/gs-generate-pg-dump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#! /bin/bash

# "Creating database dump for purpose of having a clear and filled database"
# get into the simple-build directory
# shellcheck disable=SC2164
pushd ../gradle-tasks/fill-database

# 1. create database server (inside separate component) and fill it
docker-compose -p pg-dump -f create-database.yml build --no-cache
docker-compose -p pg-dump -f create-database.yml up -d

# store IP of host in order to use it for db import later on
ip4=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)

# 2. run application component (inside separate component as well) - this is the component that is being built
# this will actually initialize the database, without running the component
docker-compose -p moqui-fill -f fill-database.yml build --no-cache --build-arg PG_LOAD_SERVER="$ip4"

# run DUMP script
cat ./DumpDatabase.sql | docker exec -i dev-postgres su root

# kill containers
docker-compose -p pg-dump -f create-database.yml down --rmi local -v

# return back to original dir
popd
10 changes: 2 additions & 8 deletions docker/db/initialize.moqui.db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,13 @@ EOSQL

function restore_data() {
local database=$1
local user=$2
echo " Restoring from backup '$database', granting access to '$user'"
echo " Restoring '$database' from fixed backup '/dumps/moqui-dump.sql'"
psql $database < /dumps/moqui-dump.sql

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname $database <<-EOSQL
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO $user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO $user;
EOSQL
}

# create_user postgres postgres
create_user moqui postgres

# create database and restore
create_database moqui_db moqui
restore_data moqui_db moqui
restore_data moqui_db
96 changes: 0 additions & 96 deletions docker/elasticsearch/config/elasticsearch.yml

This file was deleted.

1 change: 0 additions & 1 deletion docker/elasticsearch/data/README

This file was deleted.

120 changes: 0 additions & 120 deletions docker/elasticsearch/moquiconfig/elasticsearch.yml

This file was deleted.

Loading

0 comments on commit 8b9bf0a

Please sign in to comment.