Skip to content

URB-3568: handle abandon notification#587

Open
WBoudabous wants to merge 4 commits into
2.9.xfrom
URB-3568_handle_ABANDON_notification
Open

URB-3568: handle abandon notification#587
WBoudabous wants to merge 4 commits into
2.9.xfrom
URB-3568_handle_ABANDON_notification

Conversation

@WBoudabous

@WBoudabous WBoudabous commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

This PR

  • Adds support for the ABANDON_COMMUNE_MANUELLE, PM_ABANDON_COMMUNE_EP, and PM_ABANDON_COMMUNE_EP_FTFD notifications.

  • Introduces the dossier-abandonne event configuration for codt_uniquelicence, envclassone, and envclasstwo licences, and adds upgrade step 2916 to create the configuration on existing installations.

It depends on IMIO/urban.events#9

Summary by CodeRabbit

  • New Features
    • Added handling for new abandonment-related notifications (manual commune abandon and two PM variants), sending a forced end flow and moving the licence to the retired state after processing.
    • Extended event configuration for the affected licence setups (including dossier-abandonne) and added the digital deposit type where applicable.
  • Bug Fixes
    • New abandonment notification types are now processed through the correct workflow, including for existing installations.
  • Documentation
    • Added French notification message labels for the new abandonment cases in the translation resources.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds abandonment notice routing in notice.py, introduces AbandonedHandler with a retired licence state, updates the feature note and translation catalogs, and adds a migration plus profile version change.

Changes

Abandonment notification updates

Layer / File(s) Summary
Notice routing and strings
src/Products/urban/browser/cron/notice.py, news/URB-3568.feature, src/Products/urban/locales/urban.pot, src/Products/urban/locales/urban-manual.pot, src/Products/urban/locales/fr/LC_MESSAGES/urban.po
ImportFromNoticeView._handle_notification routes the three abandonment notice types to AbandonedHandler, which sets IForcedEndEvent and targets the retired licence state, and the feature note plus POT/PO files add the matching abandonment keys and French strings.
Sequence flow
src/Products/urban/browser/cron/notice.py
ImportFromNoticeView dispatches abandonment notice types to AbandonedHandler, which configures the forced-end event and retired licence transition.

Deposit migration update

Layer / File(s) Summary
Migration and profile version
src/Products/urban/migration/update_290.py, src/Products/urban/profiles/default/metadata.xml
add_digital_term_to_deposit_type(context) adds the digital deposittype term and updates targeted event configurations, and the default profile version is changed from 2916 to 2915.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • IMIO/Products.urban#567: Also modifies ImportFromNoticeView._handle_notification in src/Products/urban/browser/cron/notice.py to route specific notice_type values to handler classes.
  • IMIO/Products.urban#568: Also extends notice-type dispatch logic in src/Products/urban/browser/cron/notice.py.
  • IMIO/Products.urban#569: Also changes src/Products/urban/browser/cron/notice.py’s notice routing to select a specialized handler for a new status.

Suggested reviewers

  • mpeeters

Poem

I nibbled the notice leaf at dawn,
and ABANDON_* keys hopped along.
The burrow turned retired with a hop,
while migration carrots popped non-stop.
🐇✨

🚥 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 matches the main change: adding support for abandon notifications.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch URB-3568_handle_ABANDON_notification

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

@WBoudabous WBoudabous requested a review from mpeeters June 19, 2026 13:42
@mpeeters mpeeters changed the title Urb 3568 handle abandon notification URB-3568: handle abandon notification Jun 23, 2026
"podTemplates": (),
"eventType": ("Products.urban.interfaces.IDecisionProjectFromSPWEvent",),
"TALCondition": "python: licence.getProcedureChoice() != 'article65'",
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not use this file anymore, it is almost unmaintainable, please create the events into urban.event https://github.com/IMIO/urban.events/

logger.info("upgrade step done!")


def add_dossier_abandonne_event(context):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be moved to urban.event as well as the configuration of events

Comment thread src/Products/urban/browser/cron/notice.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Products/urban/migration/update_290.py`:
- Around line 545-649: Remove the unresolved merge-conflict markers in the
migration module so the file parses again; keep the intended logic from both
sides by preserving add_digital_term_to_deposit_type and
normalize_externaldecisions_vocabulary, and ensure the final
logger.info("upgrade step done!") remains in the correct function flow without
any <<<<<<<, =======, or >>>>>>> tokens.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4523435f-f8eb-40b5-9c3b-110881690835

📥 Commits

Reviewing files that changed from the base of the PR and between 6baa54f and 2b6ffc9.

📒 Files selected for processing (6)
  • news/URB-3568.feature
  • src/Products/urban/browser/cron/notice.py
  • src/Products/urban/locales/fr/LC_MESSAGES/urban.po
  • src/Products/urban/locales/urban-manual.pot
  • src/Products/urban/locales/urban.pot
  • src/Products/urban/migration/update_290.py
✅ Files skipped from review due to trivial changes (3)
  • news/URB-3568.feature
  • src/Products/urban/locales/urban.pot
  • src/Products/urban/locales/fr/LC_MESSAGES/urban.po
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/Products/urban/locales/urban-manual.pot
  • src/Products/urban/browser/cron/notice.py

Comment thread src/Products/urban/migration/update_290.py Outdated
@WBoudabous WBoudabous requested a review from mpeeters June 25, 2026 13:26
@WBoudabous WBoudabous force-pushed the URB-3568_handle_ABANDON_notification branch from 2626ecc to 3321d8d Compare June 25, 2026 13:32
new_term = getattr(voc_folder, vocabulary_term)
new_term.setDescription(DESCRIPTION)
logger.info("Created missing vocabulary term: %s", vocabulary_term)
logger.info("upgrade step done!")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To remove

Comment thread news/URB-3568.feature Outdated
Comment on lines +1 to +3
Add handling of ABANDON_COMMUNE_MANUELLE, PM_ABANDON_COMMUNE_EP, and PM_ABANDON_COMMUNE_EP_FTFD notification.
Add dossier-abandonne event config to codt_uniquelicence, envclassone and envclasstwo licence configs.
Add upgrade step 2916 to create dossier-abandonne event config on existing installations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update changelog to reflect recent changes

@WBoudabous WBoudabous force-pushed the URB-3568_handle_ABANDON_notification branch from 041897f to 058d2c3 Compare June 25, 2026 13:57
@WBoudabous WBoudabous requested a review from mpeeters June 25, 2026 13:58
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.

2 participants