Skip to content

Commit d221b4f

Browse files
Merge branch 'feature/TED-1168' into feature/TED-1191
2 parents 029ab73 + 835e706 commit d221b4f

60 files changed

Lines changed: 1039 additions & 416 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:

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/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"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
uvicorn[standard]
1+
uvicorn[standard]

infra/fuseki/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ services:
99
- ADMIN_PASSWORD=${FUSEKI_ADMIN_PASSWORD}
1010
- FUSEKI_DATASET_1=mydataset
1111
volumes:
12-
- fuseki-data:/fuseki-data/databases
12+
- fuseki-data:/fuseki-base/databases
13+
- fuseki-data:/fuseki-base/configuration
1314
networks:
1415
- fuseki-net
1516
- proxy-net

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ deepdiff~=5.7.0
55
jinja2~=3.1.2
66
python-dotenv~=0.19.2
77
pymongo~=4.0.1
8-
apache-airflow==2.4.3
8+
apache-airflow~=2.5.1
99
hvac==0.11.2
1010
SPARQLWrapper==1.8.5
1111
pandas==1.5.1
@@ -25,4 +25,5 @@ ordered-set~=4.0.2
2525
json2html~=1.3.0
2626
minio~=7.1.1
2727
certifi
28-
networkx~=2.8.8
28+
networkx~=2.8.8
29+
shortuuid~=1.0.11

sonar-project.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ sonar.links.scm=https://github.com/OP-TED/ted-rdf-conversion-pipeline
2323
sonar.links.issue=https://github.com/OP-TED/ted-rdf-conversion-pipeline/issues
2424

2525
sonar.tests=tests
26-
# sonar.login=67bcbf1aefb992993fdd45b78fb4977a05be39b9
2726
# sonar.host.url=https://sonarcloud.io
2827

2928
sonar.python.pylint=/usr/local/bin/pylint

ted_sws/core/model/lazy_object.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import abc
2+
from typing import Optional, Any
3+
4+
5+
class LazyObjectFieldsLoaderABC(abc.ABC):
6+
7+
@abc.abstractmethod
8+
def load_lazy_field(self, source_object: Any, property_field: property) -> Any:
9+
"""
10+
11+
:param source_object:
12+
:param property_field:
13+
:return:
14+
"""
15+
16+
@abc.abstractmethod
17+
def remove_lazy_field(self, source_object: Any, property_field: property):
18+
"""
19+
20+
:param source_object:
21+
:param property_field:
22+
:return:
23+
"""
24+
25+
26+
class LazyObjectABC(abc.ABC):
27+
28+
@abc.abstractmethod
29+
def set_lazy_object_fields_loader(self, lazy_object_fields_loader: LazyObjectFieldsLoaderABC):
30+
"""
31+
32+
:param lazy_object_fields_loader:
33+
:return:
34+
"""
35+
36+
@abc.abstractmethod
37+
def get_lazy_object_fields_loader(self) -> Optional[LazyObjectFieldsLoaderABC]:
38+
"""
39+
40+
:return:
41+
"""
42+
43+
def load_lazy_field(self, property_field: property):
44+
"""
45+
46+
:param property_field:
47+
:return:
48+
"""
49+
if self.get_lazy_object_fields_loader():
50+
return self.get_lazy_object_fields_loader().load_lazy_field(source_object=self,
51+
property_field=property_field)
52+
return None
53+
54+
def remove_lazy_field(self, property_field: property):
55+
"""
56+
57+
:param property_field:
58+
:return:
59+
"""
60+
if self.get_lazy_object_fields_loader():
61+
self.get_lazy_object_fields_loader().remove_lazy_field(source_object=self,
62+
property_field=property_field)

ted_sws/core/model/metadata.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,31 @@ class NormalisedMetadata(Metadata):
8282
xsd_version: str
8383

8484

85+
class NormalisedMetadataView(Metadata):
86+
title: str
87+
long_title: str
88+
notice_publication_number: str
89+
publication_date: str
90+
ojs_issue_number: str
91+
ojs_type: str
92+
city_of_buyer: Optional[str]
93+
name_of_buyer: Optional[str]
94+
original_language: Optional[str]
95+
country_of_buyer: Optional[str]
96+
eu_institution: Optional[bool]
97+
document_sent_date: Optional[str]
98+
deadline_for_submission: Optional[str]
99+
notice_type: str
100+
form_type: str
101+
place_of_performance: Optional[List[str]]
102+
extracted_legal_basis_directive: Optional[str]
103+
legal_basis_directive: str
104+
form_number: str
105+
eforms_subtype: str
106+
xsd_version: str
107+
108+
109+
85110
class TEDMetadata(Metadata):
86111
"""
87112
Stores notice original metadata

0 commit comments

Comments
 (0)