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

Release/24.10 #305

Merged
merged 45 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9b697e8
release/24.10
delcroip Sep 10, 2024
9619a14
Update openimis.json
delcroip Sep 10, 2024
dfa5b2b
Merge pull request #291 from openimis/develop
delcroip Sep 19, 2024
0888f0a
Merge remote-tracking branch 'origin/develop' into release/24.10
delcroip Sep 19, 2024
00cc9ad
using empty db
delcroip Sep 19, 2024
c166e9a
use empty for ci
delcroip Sep 19, 2024
7809cec
reveret empty
delcroip Sep 19, 2024
782478c
better pull
delcroip Sep 23, 2024
c4ccfe5
Update openimis.json (#292)
delcroip Sep 23, 2024
a2e0833
correct http code in case of error
delcroip Oct 3, 2024
13a65b7
use right gettext in calcrule template
delcroip Oct 15, 2024
feca4bd
add calcrule_validations
delcroip Oct 15, 2024
d9fd172
correct http code in case of error
delcroip Oct 17, 2024
f4851a0
add cache for coverage and locations
delcroip Oct 21, 2024
b3ab3a5
Merge branch 'release/24.10' into feature/add_calcrule_validations
delcroip Oct 22, 2024
34c617c
Merge pull request #295 from openimis/feature/add_calcrule_validations
delcroip Oct 22, 2024
2832841
add error logging for graphen
delcroip Oct 23, 2024
f1ca8c5
added etl api module
sniedzielski Oct 23, 2024
ab5e49e
added etl
sniedzielski Oct 23, 2024
d996a42
Merge pull request #297 from openimis/add-etl-module
delcroip Oct 24, 2024
56cb3d8
hotfix: added missing opensearch dsl config
sniedzielski Oct 28, 2024
fe78be7
Merge pull request #301 from openimis/hotfix-opensearch
delcroip Oct 28, 2024
beb4157
adding opensearch service to CI
delcroip Oct 28, 2024
831b53f
adding OS credentials
delcroip Oct 28, 2024
703674e
using default pass
delcroip Oct 28, 2024
4a01433
enforce pasword
delcroip Oct 28, 2024
bd2567e
right URL
delcroip Oct 28, 2024
d7b2d33
quoting urls
delcroip Oct 28, 2024
df17618
fixing health checks
delcroip Oct 28, 2024
7a7c378
fixing indent
delcroip Oct 28, 2024
143cf06
default pass
delcroip Oct 28, 2024
54e5c78
test new pass
delcroip Oct 28, 2024
bd25730
wait longer
delcroip Oct 28, 2024
0f62075
fixing health check
delcroip Oct 28, 2024
15a3dc4
change os host
delcroip Oct 28, 2024
07c71df
Merge pull request #302 from openimis/feature/adding-os-to-ci
delcroip Oct 28, 2024
ce41b9e
test CI on release branch
delcroip Oct 30, 2024
5875193
Update openimis.json
delcroip Oct 31, 2024
6b5ccd3
Update openimis.json
delcroip Oct 31, 2024
b57581a
Update openimis.json
delcroip Oct 31, 2024
9309f7c
Merge pull request #304 from openimis/feature/pip
delcroip Oct 31, 2024
73b992d
split setting and update prod
delcroip Nov 1, 2024
f4f0ffa
update env vars
delcroip Nov 1, 2024
3517475
add async in settings
delcroip Nov 1, 2024
d2326c8
update opensearch config
delcroip Nov 1, 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
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ RATELIMIT_RATE=150/m # Rate limit (150 requests per minute)
RATELIMIT_METHOD=ALL # HTTP methods to rate limit; 'ALL' means all methods
RATELIMIT_GROUP=graphql # Group name for the rate limit
RATELIMIT_SKIP_TIMEOUT=False # Whether to skip rate limiting during c


OPENSEARCH_ADMIN=admin
OPENSEARCH_PASSWORD=B9wc9VrqX7pY
31 changes: 27 additions & 4 deletions .github/workflows/ci_assembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 10
opensearch:
image: opensearchproject/opensearch:latest
ports:
- 9200:9200
env:
discovery.type: single-node
cluster.name: my_opensearch_local
http.port: 9200
plugins.security.ssl.http.enabled: false
OPENSEARCH_INITIAL_ADMIN_PASSWORD: B9wc9VrqX7pY
options: >-
--health-cmd "curl -f -u admin:${OPENSEARCH_INITIAL_ADMIN_PASSWORD} http://localhost:9200/_cluster/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -145,8 +160,8 @@ jobs:
SECRET_KEY: secret
MODE: DEV
DB_DEFAULT: postgresql
CELERY_BROKER_URL": "memory://openIMIS-test//"
CELERY_RESULT_BACKEND": "cache+memory://openIMIS-test//"
CELERY_BROKER_URL: "memory://openIMIS-test//"
CELERY_RESULT_BACKEND: "cache+memory://openIMIS-test//"
#DJANGO_SETTINGS_MODULE: hat.settings
DB_HOST: localhost
DB_PORT: 5432
Expand All @@ -156,6 +171,10 @@ jobs:
#DEV_SERVER: true
SITE_ROOT: api
CI_EXCLUDED_MODULE: ${{ vars.CI_EXCLUDED_MODULE }}
OPENSEARCH_ADMIN: admin
OPENSEARCH_PASSWORD: B9wc9VrqX7pY
OPEN_SEARCH_HTTP_PORT: 9200
OPENSEARCH_HOSTS: "localhost:9200"

- name: Django tests MSSQL
working-directory: ./openIMIS
Expand All @@ -171,8 +190,8 @@ jobs:
SECRET_KEY: secret
MODE: DEV
DB_DEFAULT: mssql
CELERY_BROKER_URL": "memory://openIMIS-test//"
CELERY_RESULT_BACKEND": "cache+memory://openIMIS-test//"
CELERY_BROKER_URL: "memory://openIMIS-test//"
CELERY_RESULT_BACKEND: "cache+memory://openIMIS-test//"
#DJANGO_SETTINGS_MODULE: hat.settings
DB_HOST: localhost
DB_PORT: 1433
Expand All @@ -183,3 +202,7 @@ jobs:
SITE_ROOT: api
#REMOTE_USER_AUTHENTICATION: False
CI_EXCLUDED_MODULE: ${{ vars.CI_EXCLUDED_MODULE }}
OPENSEARCH_ADMIN: admin
OPENSEARCH_PASSWORD: B9wc9VrqX7pY
OPEN_SEARCH_HTTP_PORT: 9200
OPENSEARCH_HOSTS: "localhost:9200"
88 changes: 85 additions & 3 deletions .github/workflows/ci_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,32 @@ jobs:

- name: Pull openIMIS Backend
run: |
rm ./openimis -rf
git clone --depth=1 --branch=${{ inputs.branchName }} https://github.com/openimis/openimis-be_py.git ./openimis
# Determine the target branch
if [ "${{ github.event_name }}" == "pull_request" ]; then
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
else
TARGET_BRANCH="${{ github.event.ref }}"
TARGET_BRANCH=${TARGET_BRANCH#refs/heads/}
fi

# Use 'develop' as fallback if TARGET_BRANCH is empty or not a release branch
if [[ -z "$TARGET_BRANCH" ]]; then
TARGET_BRANCH="develop"
fi

echo "Target branch: $TARGET_BRANCH"

# Clone the repository
rm -rf ./openimis
git clone --depth=1 --branch=$TARGET_BRANCH https://github.com/openimis/openimis-be_py.git ./openimis || {
echo "Failed to clone $TARGET_BRANCH, falling back to develop"
git clone --depth=1 --branch=develop https://github.com/openimis/openimis-be_py.git ./openimis
}

# Verify the cloned branch
cd ./openimis
CLONED_BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "Cloned branch: $CLONED_BRANCH"

- name: Copy Current branch
uses: actions/checkout@v2
Expand Down Expand Up @@ -124,6 +148,22 @@ jobs:
runs-on: ubuntu-20.04
needs: build_backend
services:
opensearch:
image: opensearchproject/opensearch:latest
ports:
- 9200:9200
env:
discovery.type: single-node
cluster.name: my_opensearch_local
http.port: 9200
plugins.security.ssl.http.enabled: false
OPENSEARCH_INITIAL_ADMIN_PASSWORD: B9wc9VrqX7pY
options: >-
--health-cmd "curl -f -u admin:${OPENSEARCH_INITIAL_ADMIN_PASSWORD} http://localhost:9200/_cluster/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 10

mssql:
image: mcr.microsoft.com/mssql/server:2017-latest
env:
Expand Down Expand Up @@ -228,11 +268,30 @@ jobs:
#REMOTE_USER_AUTHENTICATION: False
CI_EXCLUDED_MODULE: ${{ vars.CI_EXCLUDED_MODULE }}
MODE: DEV
OPENSEARCH_ADMIN: admin
OPENSEARCH_PASSWORD: B9wc9VrqX7pY
ci_module_psql_test_module_only:
name: Run Module Tests (PSQL)
runs-on: ubuntu-20.04
needs: build_backend
services:
opensearch:
image: opensearchproject/opensearch:latest
ports:
- 9200:9200
env:
discovery.type: single-node
cluster.name: my_opensearch_local
http.port: 9200
plugins.security.ssl.http.enabled: false
OPENSEARCH_INITIAL_ADMIN_PASSWORD: B9wc9VrqX7pY
options: >-
--health-cmd "curl -f -u admin:${OPENSEARCH_INITIAL_ADMIN_PASSWORD} http://localhost:9200/_cluster/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 10


pgsql:
image: postgres
env:
Expand Down Expand Up @@ -332,11 +391,31 @@ jobs:
SITE_ROOT: api
CI_EXCLUDED_MODULE: ${{ vars.CI_EXCLUDED_MODULE }}
MODE: DEV
OPENSEARCH_ADMIN: admin
OPENSEARCH_PASSWORD: B9wc9VrqX7pY
OPENSEARCH_HOSTS: "localhost:9200"
ci_module_psql_test:
name: Run All Tests (PSQL)
runs-on: ubuntu-20.04
needs: build_backend
services:
opensearch:
image: opensearchproject/opensearch:latest
ports:
- 9200:9200
env:
discovery.type: single-node
cluster.name: my_opensearch_local
http.port: 9200
plugins.security.ssl.http.enabled: false
OPENSEARCH_INITIAL_ADMIN_PASSWORD: B9wc9VrqX7pY
options: >-
--health-cmd "curl -f -u admin:${OPENSEARCH_INITIAL_ADMIN_PASSWORD} http://localhost:9200/_cluster/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 10


pgsql:
image: postgres
env:
Expand Down Expand Up @@ -435,6 +514,9 @@ jobs:
SITE_ROOT: api
CI_EXCLUDED_MODULE: ${{ vars.CI_EXCLUDED_MODULE }}
MODE: DEV
OPENSEARCH_ADMIN: admin
OPENSEARCH_PASSWORD: B9wc9VrqX7pY
OPENSEARCH_HOSTS: "localhost:9200"
- name: Generate Coverage Report
if: always()
working-directory: ./openimis/openIMIS
Expand Down Expand Up @@ -492,7 +574,7 @@ jobs:
# Flake8 Report
export MODULE_NAME="$(echo $GITHUB_REPOSITORY | sed 's#^openimis/openimis-be-\(.*\)_py$#\1#')"
MOD_DIR="../current-module/$MODULE_NAME"
python -m flake8 --output-file=flake8-report.txt $MOD_DIR --exit-zero
python -m flake8 --output-file=flake8-report.txt $MOD_DIR --exit-zero --ignore W503
sed -i 's|\.\./current-module/||g' flake8-report.txt

python -m flake8 $MOD_DIR
Expand Down
2 changes: 2 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"product",
"insuree",
"policy",
"calcrule_validations",
"contribution",
"payer",
"payment",
Expand Down Expand Up @@ -213,6 +214,7 @@
"opensearch_reports",
"payment_cycle",
"calcrule_social_protection",
"calcrule_validations",
"payroll"
],
"django": true,
Expand Down
Loading
Loading