Skip to content

Commit 3f5ac47

Browse files
Merge branch 'main' into feature/TED-1156
2 parents b2a9e45 + 00c1e41 commit 3f5ac47

158 files changed

Lines changed: 1195 additions & 4210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/unit-tests-srv.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ name: Tests on srv server
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [ feature/* , main, hotfix/* ]
7-
pull_request:
8-
branches: [ main, release/* ]
6+
branches: [ feature/* , main, hotfix/*, release/* ]
7+
# pull_request:
8+
# branches: [ main, release/* ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
914
env:
1015
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
1116
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
@@ -30,11 +35,11 @@ jobs:
3035
- name: Get RML mapper
3136
run: make init-rml-mapper
3237

33-
# - name: Get Allure
34-
# run: make install-allure
38+
# - name: Get Allure
39+
# run: make install-allure
3540

36-
# - name: Start staging infra
37-
# run: make start-project-services
41+
# - name: Start staging infra
42+
# run: make start-project-services
3843

3944
- name: Run tests
4045
run: make test-all

.github/workflows/unit-tests.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,39 @@ name: Tests
22

33
on:
44
push:
5-
branches: [ feature/* , main, hotfix/* ]
6-
pull_request:
7-
branches: [ main, release/* ]
5+
branches: [ feature/* , main, hotfix/*, release/* ]
6+
# pull_request:
7+
# branches: [ main, release/* ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
812

913
jobs:
1014
build:
1115
name: pyTest
1216
runs-on: ubuntu-latest
1317

1418
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
20-
with:
21-
python-version: 3.8
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade setuptools pip wheel
25-
make install
26-
make install-dev
27-
- name: Make envfile
28-
uses: SpicyPizza/create-envfile@v1
29-
with:
30-
envkey_VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
31-
envkey_VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
32-
- name: Run unit tests
33-
run: make test
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: 3.8
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade setuptools pip wheel
29+
make install
30+
make install-dev
31+
- name: Make envfile
32+
uses: SpicyPizza/create-envfile@v1
33+
with:
34+
envkey_VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
35+
envkey_VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
36+
- name: Run unit tests
37+
run: make test
3438
# - name: Upload coverage to Codecov
3539
# uses: codecov/codecov-action@v1
3640
# with:

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ CAROOT = $(shell pwd)/infra/traefik/certs
2424
install:
2525
@ echo -e "$(BUILD_PRINT)Installing the requirements$(END_BUILD_PRINT)"
2626
@ pip install --upgrade pip
27-
@ pip install --no-cache-dir -r requirements.txt --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.3/constraints-no-providers-3.8.txt"
27+
@ pip install --no-cache-dir -r requirements.txt --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-no-providers-3.8.txt"
2828

2929
install-dev:
3030
@ echo -e "$(BUILD_PRINT)Installing the dev requirements$(END_BUILD_PRINT)"
3131
@ pip install --upgrade pip
32-
@ pip install --no-cache-dir -r requirements.dev.txt --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.3/constraints-no-providers-3.8.txt"
32+
@ pip install --no-cache-dir -r requirements.dev.txt --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-no-providers-3.8.txt"
3333

3434
test: test-unit
3535

@@ -318,9 +318,6 @@ rml-mapper-path-add-dotenv-file:
318318
@ sed -i '/^RML_MAPPER_PATH/d' .env
319319
@ echo RML_MAPPER_PATH=${RML_MAPPER_PATH} >> .env
320320

321-
refresh-mapping-files:
322-
@ python -m ted_sws.data_manager.entrypoints.cli.cmd_generate_mapping_resources
323-
324321
#clean-mongo-db:
325322
# @ export PYTHONPATH=$(PWD) && python ./tests/clean_mongo_db.py
326323

dags/dags_utils.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
from itertools import islice, chain
2-
from typing import Any, Iterable
1+
from typing import Any
32

43
from airflow.operators.python import get_current_context
54

65
TASK_INSTANCE = "ti"
76

87

9-
def chunks(iterable: Iterable, chunk_size: int):
10-
iterator = iter(iterable)
11-
for first in iterator:
12-
yield chain([first], islice(iterator, chunk_size - 1))
13-
14-
158
def select_first_non_none(data):
169
"""
1710

dags/fetch_notices_by_date.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ def validate_fetched_notices():
6464
default_value=(datetime.now() - timedelta(days=1)).strftime(
6565
"%Y%m%d*")), "%Y%m%d*")
6666
mongodb_client = MongoClient(config.MONGO_DB_AUTH_URL)
67-
validate_and_update_daily_supra_notice(notice_publication_day=publication_date,
68-
mongodb_client=mongodb_client)
67+
validate_and_update_daily_supra_notice(ted_publication_date=publication_date, mongodb_client=mongodb_client)
6968

7069
def _branch_selector():
7170
trigger_complete_workflow = get_dag_param(key=TRIGGER_COMPLETE_WORKFLOW_DAG_KEY,

dags/operators/DagBatchPipelineOperator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
from airflow.operators.trigger_dagrun import TriggerDagRunOperator
55
from pymongo import MongoClient
66

7-
from dags.dags_utils import pull_dag_upstream, push_dag_downstream, chunks, get_dag_param, smart_xcom_pull, \
7+
from dags.dags_utils import pull_dag_upstream, push_dag_downstream, get_dag_param, smart_xcom_pull, \
88
smart_xcom_push
9+
from ted_sws.core.service.batch_processing import chunks
910
from dags.pipelines.pipeline_protocols import NoticePipelineCallable
1011
from ted_sws import config
1112
from ted_sws.data_manager.adapters.notice_repository import NoticeRepository

dags/reprocess_unpublished_notices_from_backlog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
DAG_NAME = "reprocess_unpublished_notices_from_backlog"
1515

1616
RE_PUBLISH_TARGET_NOTICE_STATES = [NoticeStatus.ELIGIBLE_FOR_PUBLISHING, NoticeStatus.INELIGIBLE_FOR_PUBLISHING,
17-
NoticeStatus.PACKAGED
17+
NoticeStatus.PACKAGED, NoticeStatus.PUBLICLY_UNAVAILABLE
1818
]
1919
TRIGGER_NOTICE_PROCESS_WORKFLOW_TASK_ID = "trigger_notice_process_workflow"
2020
FORM_NUMBER_DAG_PARAM = "form_number"

infra/airflow-cluster/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/apache/airflow:2.4.3-python3.8
1+
FROM docker.io/apache/airflow:2.5.1-python3.8
22

33
# quick sudo
44
USER root
@@ -26,4 +26,4 @@ RUN wget -c https://github.com/dice-group/LIMES/releases/download/1.7.9/limes.ja
2626

2727

2828
RUN pip install --upgrade pip
29-
RUN pip install --no-cache-dir -r requirements.txt --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.3/constraints-no-providers-3.8.txt"
29+
RUN pip install --no-cache-dir -r requirements.txt --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-no-providers-3.8.txt"

infra/airflow/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/apache/airflow:2.4.3-python3.8
1+
FROM docker.io/apache/airflow:2.5.1-python3.8
22

33
# quick sudo
44
USER root
@@ -25,4 +25,4 @@ RUN wget -c https://github.com/dice-group/LIMES/releases/download/1.7.9/limes.ja
2525

2626

2727
RUN pip install --upgrade pip
28-
RUN pip install --no-cache-dir -r requirements.txt --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.3/constraints-no-providers-3.8.txt"
28+
RUN pip install --no-cache-dir -r requirements.txt --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-no-providers-3.8.txt"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
uvicorn[standard]
1+
uvicorn[standard]

0 commit comments

Comments
 (0)