Skip to content

fix: ProcedureViewlet crashing when procedure_ts token is no longer i…#81

Merged
remdub merged 1 commit intomainfrom
WEB-4414
Apr 29, 2026
Merged

fix: ProcedureViewlet crashing when procedure_ts token is no longer i…#81
remdub merged 1 commit intomainfrom
WEB-4414

Conversation

@remdub
Copy link
Copy Markdown
Member

@remdub remdub commented Apr 29, 2026

…n vocabulary

WEB-4414

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved handling of unrecognized procedure tokens to prevent errors and gracefully return no value when applicable.
  • Tests

    • Added test coverage for unknown procedure token scenarios.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b1669aca-cbc8-4f4c-a6fa-d370f46ef6d3

📥 Commits

Reviewing files that changed from the base of the PR and between 3b6d433 and 2768560.

📒 Files selected for processing (3)
  • CHANGES.rst
  • src/imio/smartweb/core/tests/test_procedure.py
  • src/imio/smartweb/core/viewlets/procedure.py

📝 Walkthrough

Walkthrough

A changelog entry for WEB-4414 is added, error handling is introduced to the get_selected_procedure_title() method to gracefully return None when a vocabulary term lookup fails, and a corresponding unit test verifies this behavior with an unknown token.

Changes

Cohort / File(s) Summary
Changelog Update
CHANGES.rst
Version 1.4.45 changelog updated with specific WEB-4414 entry and contributor attribution, replacing placeholder text.
Error Handling and Testing
src/imio/smartweb/core/viewlets/procedure.py, src/imio/smartweb/core/tests/test_procedure.py
Production code adds LookupError exception handling to get_selected_procedure_title() to return None on unknown vocabulary terms; new test validates this behavior with an unrecognized token URL.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A token unknown? No need to despair,
We catch the lookup error with utmost care,
The procedure gracefully returns None today,
While tests ensure bugs won't come out to play! 🎯

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main fix: handling a crash in ProcedureViewlet when a procedure_ts token is no longer in the vocabulary, which aligns directly with the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch WEB-4414

Review rate limit: 4/5 reviews remaining, refill in 12 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@remdub remdub merged commit b3582d7 into main Apr 29, 2026
9 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.

1 participant