Skip to content

Add Scaleway Object Storage backup integration#166868

Open
BjoernPetersen wants to merge 4 commits intohome-assistant:devfrom
BjoernPetersen:scaleway-object-storage
Open

Add Scaleway Object Storage backup integration#166868
BjoernPetersen wants to merge 4 commits intohome-assistant:devfrom
BjoernPetersen:scaleway-object-storage

Conversation

@BjoernPetersen
Copy link
Copy Markdown

@BjoernPetersen BjoernPetersen commented Mar 30, 2026

Proposed change

This PR adds a new Scaleway Object Storage integration that allows users to store Home Assistant backups in Scaleway Object Storage.

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

No AI tools were used to create this PR (except for the Copilot PR review over here).

I choose the aiohttp-s3-client package as a dependency because - other than aiobotocore - it's a fully async dependendency and offers type hints without a separate stub package.

I plan to add further improvements and achieve a higher ranking on the quality scale in the future. This PR just adds what I consider a "basic" feature set. I'm sorry it's still that large, but I guess that's unavoidable when adding a completely new integration 😅.

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.
  • (not applicable) For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI review requested due to automatic review settings March 30, 2026 12:06
Copy link
Copy Markdown

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @BjoernPetersen

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

Copy link
Copy Markdown
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

Adds a new Home Assistant integration to store backups in Scaleway Object Storage, including config flow support and initial test coverage.

Changes:

  • Introduces scaleway_object_storage integration (config flow, backup agent, exceptions, translations, quality scale metadata).
  • Adds config flow tests (user / reauth / reconfigure) and shared fixtures.
  • Registers dependency (aiohttp-s3-client), code ownership, strict typing, and generated registry updates.

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
tests/components/scaleway_object_storage/test_config_flow_step_user.py Adds user-step config flow tests.
tests/components/scaleway_object_storage/test_config_flow_step_reconfigure.py Adds reconfigure-step config flow tests.
tests/components/scaleway_object_storage/test_config_flow_step_reauth.py Adds reauth-step config flow tests.
tests/components/scaleway_object_storage/conftest.py Adds shared fixtures for Scaleway Object Storage tests.
tests/components/scaleway_object_storage/init.py Initializes the test package.
requirements_test_all.txt Adds aiohttp-s3-client to test requirements.
requirements_all.txt Adds aiohttp-s3-client to runtime requirements.
mypy.ini Enables strict mypy settings for the new integration package.
homeassistant/generated/integrations.json Registers the new integration in generated metadata.
homeassistant/generated/config_flows.py Adds the integration domain to generated config flow registry.
homeassistant/components/scaleway_object_storage/strings.json Adds config flow text, selector options, and exception translations.
homeassistant/components/scaleway_object_storage/quality_scale.yaml Declares quality scale compliance status for the integration.
homeassistant/components/scaleway_object_storage/manifest.json Defines integration metadata and dependency requirements.
homeassistant/components/scaleway_object_storage/helpers.py Adds S3 client creation, connection check, and metadata read helpers.
homeassistant/components/scaleway_object_storage/exceptions.py Adds translated, typed exception hierarchy for config/runtime errors.
homeassistant/components/scaleway_object_storage/const.py Adds integration constants (config keys, limits, headers).
homeassistant/components/scaleway_object_storage/config_flow.py Implements user / reauth / reconfigure config flow steps.
homeassistant/components/scaleway_object_storage/backup.py Implements BackupAgent against Scaleway S3-compatible object storage.
homeassistant/components/scaleway_object_storage/init.py Sets up the config entry and wires runtime client creation.
CODEOWNERS Assigns ownership for the new integration and its tests.
.strict-typing Marks the new integration for strict typing enforcement.

@BjoernPetersen BjoernPetersen force-pushed the scaleway-object-storage branch 2 times, most recently from 24c5809 to 0cd40e8 Compare March 30, 2026 12:25
Copilot AI review requested due to automatic review settings March 30, 2026 12:25
@BjoernPetersen BjoernPetersen force-pushed the scaleway-object-storage branch 2 times, most recently from cffb3f4 to f30177a Compare March 30, 2026 12:34
Copy link
Copy Markdown
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

Copilot reviewed 19 out of 21 changed files in this pull request and generated 9 comments.

@BjoernPetersen BjoernPetersen force-pushed the scaleway-object-storage branch from f30177a to c3bf285 Compare March 30, 2026 12:36
Copilot AI review requested due to automatic review settings March 30, 2026 12:44
Copy link
Copy Markdown
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

Copilot reviewed 19 out of 21 changed files in this pull request and generated 4 comments.

@BjoernPetersen BjoernPetersen force-pushed the scaleway-object-storage branch from 3b5b5e8 to d6972ae Compare March 30, 2026 13:19
Copilot AI review requested due to automatic review settings March 30, 2026 14:01
@BjoernPetersen BjoernPetersen force-pushed the scaleway-object-storage branch from d6972ae to b3830b6 Compare March 30, 2026 14:01
Copy link
Copy Markdown
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

Copilot reviewed 21 out of 23 changed files in this pull request and generated 4 comments.

@BjoernPetersen BjoernPetersen force-pushed the scaleway-object-storage branch from 01ee5ee to a2ac1a7 Compare March 31, 2026 16:32
Copilot AI review requested due to automatic review settings March 31, 2026 16:39
@BjoernPetersen BjoernPetersen force-pushed the scaleway-object-storage branch from a2ac1a7 to ba4d663 Compare March 31, 2026 16:39
Copy link
Copy Markdown
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

Copilot reviewed 22 out of 24 changed files in this pull request and generated 1 comment.

@BjoernPetersen BjoernPetersen force-pushed the scaleway-object-storage branch from ba4d663 to 2cd6049 Compare March 31, 2026 20:40
Copilot AI review requested due to automatic review settings March 31, 2026 21:33
@BjoernPetersen BjoernPetersen force-pushed the scaleway-object-storage branch from 2cd6049 to f6b1b3b Compare March 31, 2026 21:33
Copy link
Copy Markdown
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

Copilot reviewed 22 out of 24 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
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

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

@BjoernPetersen BjoernPetersen marked this pull request as ready for review March 31, 2026 22:03
Comment on lines +41 to +49
if bucket_scoped:
if "." in bucket_name:
# fall back to canonical path addressing
# see https://www.scaleway.com/en/docs/object-storage/faq/#is-there-a-limitation-in-the-bucket-name
endpoint_url = f"https://s3.{region}.scw.cloud/{bucket_name}"
else:
endpoint_url = f"https://{bucket_name}.s3.{region}.scw.cloud"
else:
endpoint_url = f"https://s3.{region}.scw.cloud"
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.

Isn't this something the library should handle?

(Hold off on any library changes for now, will ask someone who worked on backup integrations to have a look)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Now that you pointed it out, I at least found a way to simplify this to two cases.

As far as I saw, other S3-based backup integrations expect an endpoint URL and a bucket name and let aiobotocore auto-select the addressing style. As noted in the original PR body, I decided against aiobotocore because its asyncio support is pretty flawed. I also thought that it's more user-friendly to avoid an endpoint URL user input since Scaleway offers very few choices anyway.

Other than (aio)botocore, the aiohttp-s3-client library will not build a virtual-host style URL by itself, so further simplifying the integration code here would mean either changing the library, or always using path-style addressing. S3-API providers generally prefer it if you use virtual-host style (AWS has deprecated path-style addressing years ago). In any case, the library will never fill in Scaleway-specifics (s3.{region}.scw.cloud) for us.

@home-assistant
Copy link
Copy Markdown

home-assistant bot commented Apr 1, 2026

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 April 1, 2026 12:03
@BjoernPetersen BjoernPetersen marked this pull request as ready for review April 1, 2026 15:39
Copilot AI review requested due to automatic review settings April 1, 2026 15:39
@home-assistant home-assistant bot requested a review from joostlek April 1, 2026 15:39
@home-assistant home-assistant bot dismissed their stale review April 1, 2026 15:39

Stale

Copy link
Copy Markdown
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

Copilot reviewed 20 out of 22 changed files in this pull request and generated no new comments.

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.

3 participants