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

#65 QAS report sending #68

Merged
merged 5 commits into from
Sep 11, 2024
Merged

#65 QAS report sending #68

merged 5 commits into from
Sep 11, 2024

Conversation

gpoderys
Copy link
Collaborator

No description provided.

@@ -23,7 +29,7 @@ def do_conversion(channel, method, properties, body: str):
if 'XSD' in message_dict.keys():
is_valid = validate_xml(body, message_dict.get('XSD').encode("utf-8"))
else:
logger.warning("XSD file not found in message, report was not validated")
# logger.info("XSD file not found in message, report was not validated")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set to debug, instead of commenting out, if it is not needed for info

@@ -104,7 +103,7 @@ def validate_xml(input_xml, schema_xml):
with open('QAR_v2.6.1.xsd', 'rb') as file:
xsd_bytes = file.read()

data = {"XML": xml_bytes.decode(),"XSL": xsl_bytes.decode(), "XSD": xsd_bytes.decode()}
data = {"XML": xml_bytes.decode(), "XSL": xsl_bytes.decode(),}#"XSD": xsd_bytes.decode()}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave here working example, the referenced transformation is not present, also XSD should be under schemas folder

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This look like the old report format from Neplan, I think new one test example should be added here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This look like the old report format from Neplan, I think new one test example should be added here

emf/report_publisher/worker.py Outdated Show resolved Hide resolved
emf/report_publisher/worker.py Outdated Show resolved Hide resolved
rabbit_service = rabbit.BlockingClient()
edx_service = edx.EDX()

schema_xml_path = Path(__file__).parent.joinpath('QAR_v2.6.1.xsd')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to settings

# Upload external QAR report
if is_valid:
ba_message_id = ""
process_id = str(uuid.uuid4())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO - get this ID from the TASK

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not solved


if is_valid != 'True':
with open(schema_xml_path, 'rb') as file:
xsd_bytes = file.read()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation part is reading XSD from filesystem every time, give the XSD to the function and load it once at startup

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already under schemas

# Upload external QAR report
if is_valid:
ba_message_id = ""
process_id = str(uuid.uuid4())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not solved

emf/report_publisher/worker.py Outdated Show resolved Hide resolved
emf/report_publisher/worker.py Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Sep 6, 2024

@Haigutus Haigutus changed the base branch from main to dev September 8, 2024 07:15
@Haigutus Haigutus merged commit 2a9953d into dev Sep 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants