Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement auto-deletion and protection for branches#265

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
NikolayS wants to merge3 commits intomaster
base:master
Choose a base branch
Loading
fromclaude/auto-delete-branch-protection-01KiaxrtL1Bh3LzPYAJSQ4Bi

Conversation

@NikolayS
Copy link
Contributor

Implement auto-deletion modes and deletion protection for branches and snapshots, similar to existing clone features:

  • Add AutoDeleteMode type with three modes:

    • Off (0): auto-deletion disabled
    • Soft (1): auto-delete only if no dependencies
    • Force (2): auto-delete with recursive destroy
  • Update models (Branch, Snapshot, Clone) with:

    • Protected: boolean to prevent deletion
    • DeleteAt: scheduled deletion timestamp
    • AutoDeleteMode: auto-deletion behavior
  • Add API endpoints:

    • PATCH /branch/{branchName}: update branch metadata
    • PATCH /snapshot/{id}: update snapshot metadata
  • Add protection checks to delete operations:

    • Branches cannot be deleted if protected
    • Snapshots cannot be deleted if protected
  • Add background auto-deletion job that:

    • Checks for expired clones, branches, and snapshots
    • Respects auto-delete mode when handling dependencies
    • Force mode deletes dependent entities recursively
    • Soft mode skips if dependencies exist
  • Add entity storage for persisting branch/snapshot metadata

Implement auto-deletion modes and deletion protection for branches andsnapshots, similar to existing clone features:- Add AutoDeleteMode type with three modes:  - Off (0): auto-deletion disabled  - Soft (1): auto-delete only if no dependencies  - Force (2): auto-delete with recursive destroy- Update models (Branch, Snapshot, Clone) with:  - Protected: boolean to prevent deletion  - DeleteAt: scheduled deletion timestamp  - AutoDeleteMode: auto-deletion behavior- Add API endpoints:  - PATCH /branch/{branchName}: update branch metadata  - PATCH /snapshot/{id}: update snapshot metadata- Add protection checks to delete operations:  - Branches cannot be deleted if protected  - Snapshots cannot be deleted if protected- Add background auto-deletion job that:  - Checks for expired clones, branches, and snapshots  - Respects auto-delete mode when handling dependencies  - Force mode deletes dependent entities recursively  - Soft mode skips if dependencies exist- Add entity storage for persisting branch/snapshot metadata
- Fix LocalTime conversion in base.go and entity_storage.go (use .Time field)- Fix CLI actions.go to use pointer for Protected field- Fix routes.go to use updatedClone.Protected for telemetry event- Add thinclones import and DestroyOptions parameter in auto_delete.go- Fix clone_test.go to handle Protected pointer properly
- Break long function signatures into multiple lines (base.go, entity_storage.go)- Fix wsl issues by adding blank lines before if statements- Pre-allocate slices in canDeleteSnapshot
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@NikolayS@claude

[8]ページ先頭

©2009-2025 Movatter.jp