diff --git a/.gitignore b/.gitignore index 5ad1149..51416ca 100644 --- a/.gitignore +++ b/.gitignore @@ -136,4 +136,7 @@ uv.lock .python-version # Testing directory thats named results_XXX, for example results_widoco since this is for testing purposes -results_*/ \ No newline at end of file +results_*/ + +# Backup directory +BACKUP/ \ No newline at end of file diff --git a/docs/catalog.html b/docs/catalog.html new file mode 100644 index 0000000..7f92439 --- /dev/null +++ b/docs/catalog.html @@ -0,0 +1,155 @@ + + + + + RsMetaCheck Catalog + + + + + + + + + + + + + + +

Metadata Pitfalls & Warnings Catalog

+ +
+

+ This is a catalog of the pitfalls and warnings we have come across during our research on software metadata quality. + Based on these findings, we at Ontology Engineering Group (OEG) + have developed our tool RSMetaCheck to automatically diagnose and identify these common issues in software metadata files. + Warnings do not have a severity level because originally they were opted due to their low severity and classified as "Warnings" instead of "Pitfalls" +

+
+ + +
+ + + + + + + + + + + + + + + +
IdentifierSourcePitfallDescriptionSuggestionExamplesImportance
+
+ + + + diff --git a/docs/ground_truth/charts.html b/docs/ground_truth/charts.html index aaa408f..e40ad61 100644 --- a/docs/ground_truth/charts.html +++ b/docs/ground_truth/charts.html @@ -70,7 +70,7 @@ diff --git a/docs/ground_truth/comparison.html b/docs/ground_truth/comparison.html index 202265c..b8c547e 100644 --- a/docs/ground_truth/comparison.html +++ b/docs/ground_truth/comparison.html @@ -116,7 +116,7 @@ diff --git a/docs/ground_truth/home.html b/docs/ground_truth/home.html deleted file mode 100644 index e0ab6ad..0000000 --- a/docs/ground_truth/home.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - RsMetaCheck Ground Truth - - - -
-

RsMetaCheck Study

-

- This is an automated tool to detect metadata quality pitfalls in software repositories, - from version mismatches, license issues, broken URLs. To verify the performance of our tool - we made this study we are building a ground truth dataset that was manually annotated from evaluating a sample of 150 repositories - from InnovationSprint2025 and - a small sample of openAIRE, then had RSMetaCheck tested across versions 0.3.0 and 0.3.3 with comparison to the ground truth that we have established. -

-
- -

Ground Truth Report

-

Full pitfall and warning detection results from manual annotation across all 150 evaluated repositories.

- → View Report -
- -

Version Comparison

-

Side-by-side repository-level comparison of pitfall and warning detection between 0.3.0 and 0.3.3.

- → View Comparison -
- -

Charts

-

Distribution charts and grouped comparison of pitfall and warning detection across 0.3.0 and 0.3.3.

- → View Charts -
-
-
- - diff --git a/docs/ground_truth/index.html b/docs/ground_truth/index.html index c48e961..b000a8b 100644 --- a/docs/ground_truth/index.html +++ b/docs/ground_truth/index.html @@ -122,7 +122,7 @@ diff --git a/docs/index.html b/docs/index.html index 7f92439..368f99c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,155 +1,131 @@ - - RsMetaCheck Catalog - - - - - - - - - - - + + + RsMetaCheck + - -

Metadata Pitfalls & Warnings Catalog

- -
-

- This is a catalog of the pitfalls and warnings we have come across during our research on software metadata quality. - Based on these findings, we at Ontology Engineering Group (OEG) - have developed our tool RSMetaCheck to automatically diagnose and identify these common issues in software metadata files. - Warnings do not have a severity level because originally they were opted due to their low severity and classified as "Warnings" instead of "Pitfalls" -

-
- - -
- - - - - - - - - - - - - - - -
IdentifierSourcePitfallDescriptionSuggestionExamplesImportance
-
- - + })(); + +
+

RsMetaCheck Study

+

+ This is an automated tool to detect metadata quality pitfalls in software repositories, + from version mismatches, license issues, broken URLs. To verify the performance of our tool + we made this study we are building a ground truth dataset that was manually annotated from evaluating a sample of 150 repositories + from InnovationSprint2025 and + a small sample of openAIRE, then had RSMetaCheck tested across versions 0.3.0 and 0.3.3 with comparison to the ground truth that we have established. +

+
+ +

Ground Truth Report

+

Full pitfall and warning detection results from manual annotation across all 150 evaluated repositories.

+ → View Report +
+ +

Version Comparison

+

Side-by-side repository-level comparison of pitfall and warning detection between 0.3.0 and 0.3.3.

+ → View Comparison +
+ +

Charts

+

Distribution charts and grouped comparison of pitfall and warning detection across 0.3.0 and 0.3.3.

+ → View Charts +
+ +

Pitfalls & Warnings Catalog

+

Complete catalog of all detected metadata pitfalls and warnings with descriptions, suggestions, and examples.

+ → View Catalog +
+
+
diff --git a/src/rsmetacheck/utils/json_ld_utils.py b/src/rsmetacheck/utils/json_ld_utils.py index 0d0192e..b993621 100644 --- a/src/rsmetacheck/utils/json_ld_utils.py +++ b/src/rsmetacheck/utils/json_ld_utils.py @@ -26,8 +26,7 @@ def _fetch_gitlab_commit_id(host: str, project_path: str) -> str: data = json.loads(response.read().decode("utf-8")) if isinstance(data, list) and len(data) > 0: return data[0].get("id", "Unknown") - except (URLError, HTTPError, json.JSONDecodeError): - pass + except (URLError, HTTPError, json.JSONDecodeError, TimeoutError): pass return "Unknown" @@ -56,8 +55,7 @@ def fetch_latest_commit_id(repo_url: str) -> str: with urllib.request.urlopen(req, timeout=10) as response: data = json.loads(response.read().decode('utf-8')) return data.get('sha', 'Unknown') - except (URLError, HTTPError, json.JSONDecodeError): - pass + except (URLError, HTTPError, json.JSONDecodeError, TimeoutError): pass elif repo_url.startswith("https://"): # Handles gitlab.com and any self-hosted GitLab instance. diff --git a/tests/test_e2e.py b/tests/test_e2e.py index f70949c..3fe1460 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -2,6 +2,9 @@ import json from pathlib import Path +from unittest.mock import patch + +import pytest from rsmetacheck.config import AnalysisConfig from rsmetacheck.detect_pitfalls_main import detect_all_pitfalls @@ -43,6 +46,15 @@ def _find_issue_count(summary_data, code): raise AssertionError(f"Code not found in summary: {code}") +@pytest.fixture(autouse=True) +def _mock_commit_id(): + with patch( + "rsmetacheck.utils.json_ld_utils.fetch_latest_commit_id", + return_value="abc123", + ): + yield + + class TestSingleRepoPipeline: """Tests with a single SoMEF input file."""