Add unit tests for renderCatalogStatus.py reason_to_link function
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
Start with scripts/renderCatalogStatus.py and the existing patterns in scripts/tests/, especially test_generatePluginBuildInfo.py, test_generateCatalogIndex.py, and test_plugin_utils.py. Add scripts/tests/test_renderCatalogStatus.py covering the five requested reason_to_link cases, then run pytest tests/ -v or validate-catalog-scripts.yaml. Done means the tests pass and protect the documented link-rendering paths.
Written by the indexing model from the issue text.
Description
What happened
PR #3168 modified the reason_to_link function in scripts/renderCatalogStatus.py, adding new string parsing logic that splits failure reasons into a prefix (linked to a troubleshooting anchor) and a remainder (linked to the OCI registry). The PR was self-merged in 90 seconds with zero code reviews — the review agent was triggered but could not complete before merge (run 31094385523). The function now has three code paths: prefix-only reasons, prefix-with-remainder reasons, and unrecognized reasons. None of these paths are tested.
What could go better
Eight other Python scripts in scripts/ have corresponding test files in scripts/tests/ (e.g., test_generatePluginBuildInfo.py, test_generateCatalogIndex.py, test_plugin_utils.py), but renderCatalogStatus.py has none. The CI workflow validate-catalog-scripts.yaml already runs pytest tests/ -v, so any new test file would be automatically included. The parsing logic in reason_to_link — splitting on prefix length, stripping colons, conditionally calling oci_ref_to_link — is the kind of string manipulation that benefits most from regression tests. Without tests, future changes (by humans or agents) could silently break status page link rendering on the GitHub Wiki. Confidence is high that this is a real gap: the code paths are non-trivial, the test infrastructure exists, and the script renders user-facing output.
Proposed change
Create scripts/tests/test_renderCatalogStatus.py with unit tests for reason_to_link. Cover at minimum: (1) reason with no matching prefix returns the raw string unchanged, (2) reason matching a prefix with no remainder returns a troubleshooting anchor link, (3) reason matching a prefix with a colon-separated OCI ref returns both a troubleshooting link and an OCI registry link, (4) the troubleshooting_content parameter controls whether the prefix becomes a link or stays plain text, (5) empty reason string is handled gracefully. The existing test pattern in scripts/tests/ (pytest with fixtures in scripts/tests/fixtures/) should be followed. Consider also testing render_tier integration with reason_to_link if feasible.
Validation criteria
A scripts/tests/test_renderCatalogStatus.py file exists with at least 5 test cases covering the documented code paths. The tests pass in the existing validate-catalog-scripts.yaml CI workflow without configuration changes. The next PR that modifies reason_to_link has regression protection.
Generated by retro agent from https://github.com/redhat-developer/rhdh-plugin-export-overlays/pull/3168
- Dominant language
- TypeScript
- Stars
- 9
- Forks
- 72
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 133
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from redhat-developer/rhdh-plugin-export-overlays
-
documentation non-workspace-changes ready-for-triage ready-to-code
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
redhat-developer/rhdh-plugin-export-overlays#3815 · 3 comments ·
-
documentation non-workspace-changes ready-for-triage ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
redhat-developer/rhdh-plugin-export-overlays#3810 · 3 comments ·
-
Add AGENTS.md review guidance: Prettier/ESLint/TypeScript violations in e2e-tests are CI-blocking Opendocumentation ready-for-triage ready-to-code
Difficulty 1/5 Under an hour Newbie friendliness 88/100
redhat-developer/rhdh-plugin-export-overlays#3792 · 3 comments ·
-
e2e-failure ready-to-code
Difficulty 1/5 Under an hour Newbie friendliness 88/100
redhat-developer/rhdh-plugin-export-overlays#3789 · 1 comment ·
-
e2e-failure ready-to-code
Difficulty 1/5 Under an hour Newbie friendliness 88/100
redhat-developer/rhdh-plugin-export-overlays#3788 · 1 comment ·
All issues in redhat-developer/rhdh-plugin-export-overlays
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100