Skip to content

Fix community invites and extend error handling - #88

Merged
jkalayan merged 2 commits into
mainfrom
86-bug-biosimdb-invenio-community-invitation-fails
Oct 23, 2026
Merged

jkalayan merged 2 commits into
mainfrom
86-bug-biosimdb-invenio-community-invitation-fails

Conversation

@jkalayan

Copy link
Copy Markdown
Collaborator

Summary

This pull request introduces significant improvements to error handling, configuration management, and code organization in the biosimdb_interface.form module.

BioSimDB community invitiation:

  • Fix community invitation by providing a token with correct permissions.
  • Return invitation status when data is submitted to BioSimDB (INVITE_ALREADY_MEMBER, INVITE_SENT, INVITE_FAILED, INVITE_PENDING), provide user with status where applicable.
  • Update tests for community invitation.

Error handling improvements:

  • Introduced a new errors.py module that defines custom exceptions (WebformError, ExternalAPIError, FormConversionError) and blueprint-level error handlers for more robust and user-friendly error reporting. This centralizes and standardizes error handling across the form blueprint.
  • Removed redundant or now-centralized error handling code from webform.py and updated references to use the new error classes.

Configuration management:

  • Refactored code to consistently access configuration values (such as APPLICATION_BASE, BIOSIM_SCHEMA_PATH, and ENGINE_MAPPING_SCHEMA_PATH) from app.config instead of directly from environment variables, improving clarity and testability.

Submission workflow refactoring:

  • Extracted all Invenio submission logic from webform.py into a new submission.py module, including routes for resuming, executing, canceling, and confirming submissions. This separation of concerns simplifies the webform logic and improves maintainability.

Form extraction and validation:

  • Simplified the metadata extraction and validation flow in extract.py, now raising WebformError for missing files and returning a cleaner JSON response on success.

Code cleanup and imports:

  • Removed unused imports and obsolete code from webform.py, further clarifying the module's responsibilities.

Impact

  • These changes collectively improve the user experience, error traceability, and code modularity across the form handling components.

@jkalayan jkalayan linked an issue Oct 23, 2026 that may be closed by this pull request
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 39985938156

Coverage decreased (-0.2%) to 89.51%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: 34 uncovered changes across 4 files (185 of 219 lines covered, 84.47%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
biosimdb_interface/form/submission.py 114 98 85.96%
biosimdb_interface/form/errors.py 45 34 75.56%
biosimdb_interface/login/community_invite.py 36 30 83.33%
biosimdb_interface/form/extract.py 17 16 94.12%
Total (8 files) 219 185 84.47%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
biosimdb_interface/form/utils.py 1 76.19%

Coverage Stats

Coverage Status
Relevant Lines: 858
Covered Lines: 768
Line Coverage: 89.51%
Coverage Strength: 8.06 hits per line

💛 - Coveralls

@jkalayan jkalayan added bug Something isn't working enhancement New feature or request labels Oct 23, 2026
@jkalayan
jkalayan marked this pull request as ready for review October 23, 2026 17:31
@jkalayan
jkalayan merged commit fb0a89e into main Oct 23, 2026
12 checks passed
@jkalayan
jkalayan deleted the 86-bug-biosimdb-invenio-community-invitation-fails branch October 23, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: BioSimDB Invenio community invitation fails

2 participants