-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
@@ -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") |
There was a problem hiding this comment.
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()} |
There was a problem hiding this comment.
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
emf/report_publisher/QAR_v2.6.1.xsd
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schema should be put here - https://github.com/Baltic-RCC/EMF/tree/main/emf/common/schemas
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
rabbit_service = rabbit.BlockingClient() | ||
edx_service = edx.EDX() | ||
|
||
schema_xml_path = Path(__file__).parent.joinpath('QAR_v2.6.1.xsd') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add to settings
emf/report_publisher/worker.py
Outdated
# Upload external QAR report | ||
if is_valid: | ||
ba_message_id = "" | ||
process_id = str(uuid.uuid4()) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
|
||
if is_valid != 'True': | ||
with open(schema_xml_path, 'rb') as file: | ||
xsd_bytes = file.read() |
There was a problem hiding this comment.
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
emf/report_publisher/QAR_v2.6.1.xsd
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already under schemas
emf/report_publisher/worker.py
Outdated
# Upload external QAR report | ||
if is_valid: | ||
ba_message_id = "" | ||
process_id = str(uuid.uuid4()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not solved
Quality Gate passedIssues Measures |
No description provided.