-
Notifications
You must be signed in to change notification settings - Fork 4
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
EVA-3275: Improvements to validation report #9
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# PyCharm | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,73 @@ | ||
|
||
{% macro file_validation_report(validation_results, file_name) -%} | ||
<ul> | ||
{% for check_type, check_per_file in validation_results.items() %} | ||
{% set result = check_per_file.get(file_name, {}) %} | ||
{% if check_type == "assembly_check" %} | ||
{% set nb_match = result.get("match", 0) %} | ||
{% set nb_total = result.get("total", 0) %} | ||
{% set match_percentage = nb_match / nb_total * 100 %} | ||
{% if result.get("nb_mismatch", 0) > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "fail collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "pass" %} | ||
{% endif %} | ||
<li class='{{ row_class }}'>{{ icon }} Assembly check: {{ nb_match }}/{{ nb_total }} ({{ match_percentage|round(2) }}%)</li> | ||
{% set mismatch_list = result.get("mismatch_list") %} | ||
{% if mismatch_list %} | ||
<div class='error-list'> | ||
<ul> | ||
{% for error in mismatch_list %} | ||
<li><strong>{{ check_type }} error:</strong> {{ error }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
{% elif check_type == "vcf_check" %} | ||
{% set critical_count = result.get("critical_count", 0) %} | ||
{% set error_count = result.get("error_count", 0) %} | ||
{% set warning_count = result.get("warning_count", 0) %} | ||
{% if critical_count > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "fail collapsible" %} | ||
{% elif error_count > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "warn collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "pass" %} | ||
{% endif %} | ||
<li class='{{ row_class }}'>{{ icon }} VCF check: {{ critical_count }} critical errors {{ error_count }} non critical error {{ warning_count }} warning </li> | ||
{% set critical_list = result.get("critical_list") %} | ||
{% set error_list = result.get("error_list") %} | ||
{% for check_type, check_per_file in validation_results.items() %} | ||
{% set result = check_per_file.get(file_name, {}) %} | ||
{% if check_type == "assembly_check" %} | ||
{% set nb_match = result.get("match", 0) %} | ||
{% set nb_total = result.get("total", 0) %} | ||
{% set match_percentage = nb_match / nb_total * 100 %} | ||
{% if result.get("nb_mismatch", 0) > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "report-section fail collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "report-section pass" %} | ||
{% endif %} | ||
<div class='{{ row_class }}'>{{ icon }} Assembly check: {{ nb_match }}/{{ nb_total }} ({{ match_percentage|round(2) }}%)</div> | ||
{% set mismatch_list = result.get("mismatch_list") %} | ||
{% if mismatch_list %} | ||
<div class="error-list"> | ||
<div class="error-description">First 10 errors per category are below. <strong>Full report:</strong> {{ result.get('report_path', '') }}</div> | ||
<table> | ||
<tr> | ||
<th>Category</th><th>Error</th> | ||
</tr> | ||
{% for error in mismatch_list[:10] %} | ||
<tr> | ||
<td><strong>mismatch error</strong></td><td> {{ error }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
{% endif %} | ||
{% elif check_type == "vcf_check" %} | ||
{% set critical_count = result.get("critical_count", 0) %} | ||
{% set error_count = result.get("error_count", 0) %} | ||
{% set warning_count = result.get("warning_count", 0) %} | ||
{% if critical_count > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "report-section fail collapsible" %} | ||
{% elif error_count > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "report-section warn collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "report-section pass" %} | ||
{% endif %} | ||
<div class='{{ row_class }}'>{{ icon }} VCF check: {{ critical_count }} critical errors, {{ error_count }} non-critical errors, {{ warning_count }} warnings </div> | ||
{% set critical_list = result.get("critical_list") %} | ||
{% set error_list = result.get("error_list") %} | ||
|
||
{% if critical_list or error_list %} | ||
<div class='error-list'> | ||
<ul> | ||
{% for error in critical_list %} | ||
<li><strong>{{ check_type }} error:</strong> {{ error }}</li> | ||
{% endfor %} | ||
{% for error in error_list %} | ||
<li><strong>{{ check_type }} error:</strong> {{ error }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
{% if critical_list or error_list%} | ||
<div class="error-list"> | ||
<div class="error-description">First 10 errors per category are below. <strong>Full report:</strong> {{ result.get('report_path', '') }}</div> | ||
<table> | ||
<tr> | ||
<th>Category</th><th>Error</th> | ||
</tr> | ||
{% for error in critical_list[:10] %} | ||
<tr> | ||
<td><strong>critical error</strong></td><td> {{ error }}</td> | ||
</tr> | ||
{% endfor %} | ||
{% for error in error_list[:10] %} | ||
<tr> | ||
<td><strong>non-critical error</strong></td><td> {{ error }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endfor %} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
|
||
{% macro metadata_validation_report(validation_results) -%} | ||
{% set json_errors = validation_results.get('metadata_check', {}).get('json_errors', []) %} | ||
{% set results = validation_results.get('metadata_check', {}) %} | ||
{% set json_errors = results.get('json_errors', []) %} | ||
{% if json_errors %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "fail collapsible" %} | ||
{% set row_class = "report-section fail collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "pass" %} | ||
{% set row_class = "report-section pass" %} | ||
{% endif %} | ||
<li class='{{ row_class }}'>{{ icon }} Metadata validation check </li> | ||
<div class='{{ row_class }}'>{{ icon }} Metadata validation check </div> | ||
{% if json_errors %} | ||
<div class='error-list'> | ||
<ul> | ||
{% for error in json_errors %} | ||
<li><strong> {{ error.get('property') }} : {{ error.get('description') }} </strong></li> | ||
{% endfor %} | ||
</ul> | ||
<div class="error-list"> | ||
<div class="error-description"><strong>Full report:</strong> {{ results.get('report_path', '') }}</div> | ||
<table> | ||
<tr> | ||
<th>Property</th><th>Error</th> | ||
</tr> | ||
{% for error in json_errors %} | ||
<tr> | ||
<td><strong>{{ error.get('property') }}</strong></td><td> {{ error.get('description') }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
{% endif %} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.