Skip to content

Conversation

@PaulAnnekov
Copy link
Contributor

Breaking change

On Nov, 7 the API provider behind Ukraine Alarm integration sent an email that state (область) alarms won't trigger anymore and suggested to use district (район) and community-level (громада) alarms instead.
This change won't allow you to choose states anymore. It will also fail to load the entries which had state selected. You will need to remove them manually.
I still see that at least for "Автономна Республіка Крим" alarm is still triggered, so decided to allow to choose states which has no districts. That's the only exception.

Proposed change

As was written in "Breaking change" section, entries where state chosen won't be marked as triggered from API provider side anymore.

image

This change creates a migration for existing entries and forbids to choose states w/ districts. Tests and strings are also updated.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a migration from version 1 to version 2 of the Ukraine Alarm integration's config flow. The main change prevents users from monitoring state-level regions that contain districts, requiring them to select specific districts or communities instead. States without districts remain supported.

Key Changes

  • Added migration logic that validates v1 entries and creates repair issues for unsupported state-level regions
  • Updated config flow to version 2 with modified district selection behavior
  • Refactored test data structure to share common region fixtures across test files
  • Updated user-facing descriptions in config flow steps

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
homeassistant/components/ukraine_alarm/__init__.py Adds async_migrate_entry function to handle v1→v2 migration with API calls, validation logic, and repair issue creation for deprecated state-level regions
homeassistant/components/ukraine_alarm/config_flow.py Bumps VERSION to 2 and modifies district step logic to prevent selecting parent state as an option
homeassistant/components/ukraine_alarm/strings.json Updates config flow step descriptions and adds repair issue translation for deprecated state regions
tests/components/ukraine_alarm/__init__.py Extracts _region helper function and REGIONS fixture to shared test module for reuse
tests/components/ukraine_alarm/test_config_flow.py Removes tests for deprecated state-level selection behavior and imports shared test fixtures
tests/components/ukraine_alarm/test_init.py Adds new migration tests covering successful migration and failure cases with repair issue creation

@PaulAnnekov
Copy link
Contributor Author

I quite don't understand whether I must increase test coverage...

@myroslav
Copy link

myroslav commented Nov 9, 2025

I had been monitoring 5 regions and would be monitoring more than 5 if quota would allow me to do that. What maximum number of Districts would I be able to monitor with this change?

@PaulAnnekov
Copy link
Contributor Author

@myroslav limit is the same, 5 entries. So 5 districts.

Can you explain me your use case?

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft November 10, 2025 15:05
@PaulAnnekov PaulAnnekov marked this pull request as ready for review November 10, 2025 22:10
@home-assistant home-assistant bot requested a review from joostlek November 10, 2025 22:10
@joostlek joostlek merged commit dcec6c3 into home-assistant:dev Nov 11, 2025
35 of 36 checks passed
@joostlek joostlek added this to the 2025.11.2 milestone Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ukraine Alarm integration stops working

3 participants