Add release backups and search/sort on the Repositories page - #144
Merged
Merged
Conversation
Each repository can now also back up release files: none (default, unchanged behaviour), the latest release, the last 5 releases, or all releases. For each release the uploaded assets and the source code zip are stored in a _releases/<tag>/ folder inside the backup. Draft releases are skipped. init_db.py adds the new release_mode column to existing databases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TWkh86yGwethdcSzje555s
Repositories can be sorted by date added, repository name, owner (A-Z / Z-A) or last backup time (newest / oldest first; never backed up repositories go last). A search box filters on repository name and owner, including "owner/name". Filtering and sorting happen in the browser, and the last used sort and search are remembered. Adds a Repository.owner property derived from the URL, which is also shown on each repository card. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TWkh86yGwethdcSzje555s
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds two features:
1. Release backups
Each repository gets a new Release Files setting:
For each selected release, the backup gets
_releases/<tag>/containing:<repo>-<tag>-source.zip)This works for folder, ZIP and TAR.GZ backups. Retention cleanup is unchanged.
models.py: newRepository.release_modecolumn (none/latest/last5/all) and aRELEASE_MODESmap.init_db.py: adds the column to existing databases on container start (ALTER TABLE). Existing repositories getnone, so their behaviour doesn't change.backup_service.py:_download_releases()runs after the clone. It lists releases through the GitHub API (newest first) and streams the assets and source zips to disk. It uses the repository's stored token, which private repositories need.app.py: the add, add-by-username and edit routes save the setting. Unknown values fall back tonone.none.Behaviour choices:
2. Search and sort on the Repositories page
owner/name, soweminofinds all of that user's repositories,co-opfinds every repository with "co-op" in its name, andwemino/conarrows to both. It shows "Showing X of Y", or a "No repositories match" message.localStorage.Repository.ownerproperty, taken from the URL (HTTPS andgit@formats). Each card now shows the owner./repositoriesquery now orders byidexplicitly, so "Date added" is deterministic.Testing
init_db.py. The column was added, the existing row gotnone, and a second run did nothing.Accept: application/octet-streamsent for assets,_releases/included in the ZIP backup. The code reached the real GitHub API successfully on this repository, but the repository has no releases, so no real download was tested end-to-end. Please try one repository that has releases before merging./repositoriesthrough the Flask test client with 5 sample repositories and drove it in headless Chromium. Checked all 7 sort orders; the searcheswemino,co-op,COOP,wemino/coand a search with no matches; that the choices are restored after reload; and that there are no JavaScript errors.🤖 Generated with Claude Code
https://claude.ai/code/session_01TWkh86yGwethdcSzje555s