Skip to content

fix(project-backup): validate repository before restore#19061

Merged
nijel merged 1 commit intoWeblateOrg:mainfrom
nijel:restore-vcs
Apr 17, 2026
Merged

fix(project-backup): validate repository before restore#19061
nijel merged 1 commit intoWeblateOrg:mainfrom
nijel:restore-vcs

Conversation

@nijel
Copy link
Copy Markdown
Member

@nijel nijel commented Apr 17, 2026

No description provided.

@nijel nijel added this to the 5.17.1 milestone Apr 17, 2026
@nijel nijel requested a review from Copilot April 17, 2026 10:02
@nijel nijel self-assigned this Apr 17, 2026
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

This PR strengthens project backup imports by revalidating component VCS URLs (repository + push) during backup validation, preventing restores from introducing components pointing at prohibited/private targets.

Changes:

  • Revalidate component repo and push URLs during ProjectBackup.validate() by applying validate_repo_url.
  • Add regression tests ensuring restore validation rejects internal/non-public repo and push URLs.
  • Document the behavior change in the 5.17.1 changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
weblate/trans/backups.py Validates component repo/push URLs while loading component metadata from the backup archive.
weblate/trans/tests/test_backups.py Adds tests that tamper a backup’s component JSON and assert validate() rejects prohibited URLs.
docs/changes.rst Notes the new revalidation step during project backup import.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@argos-ci
Copy link
Copy Markdown

argos-ci bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 12 changed Apr 17, 2026, 11:15 AM

@nijel nijel enabled auto-merge (rebase) April 17, 2026 11:45
@nijel nijel merged commit e4b67a7 into WeblateOrg:main Apr 17, 2026
51 of 53 checks passed
@nijel nijel deleted the restore-vcs branch April 17, 2026 11:46
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