Repository navigation
fix(backup): Add the site name to streamed backup file names #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import fnmatch | ||
| import json | ||
| import os | ||
| import random | ||
|
|
@@ -375,6 +376,17 @@ def test_rename_site_works_for_existing_site(self): | |
| self.assertTrue(os.path.exists(os.path.join(self.sites_directory, new_name))) | ||
| self.assertFalse(os.path.exists(os.path.join(self.sites_directory, old_name))) | ||
|
|
||
| def test_streamed_backup_names_carry_site_slug_and_stay_out_of_frappe_recent_backup_glob(self): | ||
| site_name = "streamed.site.test" | ||
| self._create_test_site(site_name) | ||
| with patch.object(Site, "config"): | ||
| site = Site(site_name, self._get_test_bench()) | ||
|
|
||
| db_file = site.streamed_backup_prefix("20260929_101500") + "-database.sql.gz" | ||
|
|
||
| self.assertEqual(db_file, "20260929_101500-streamed_site_test-%stream%-database.sql.gz") | ||
| self.assertFalse(fnmatch.fnmatch(db_file, "*-streamed_site_test-database.sql.gz")) | ||
|
Comment on lines
+385
to
+388
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Prompt To Fix With AIThis is a comment left during a code review.
Path: agent/tests/test_site.py
Line: 385-388
Comment:
**S3 filename remains untested** This test checks the FIFO name but not the resulting S3 object name. Assert that the `%stream%-` marker becomes `stream-` in the object name so a regression in that conversion cannot pass unnoticed.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
|
|
||
| @unittest.skip("fails with 'Server' has no attr 'job'") | ||
| def test_valid_sites_property_of_bench_throws_if_site_config_is_corrupt( | ||
| self, | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
streamed_backup_prefixmethod has no docstring. The repository’s Frappe review guideline requires public functions to be documented; add one before merging.Context Used: Guidelines for reviewing Frappe Framework applications. (source)
Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!