Skip to content

Add Account Status Support for Managing Decommissioned Accounts #239

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jul 13, 2025

Implements support for setting accounts to "archived" or "offline" status to prevent decommissioned accounts from being included in regular backups while still allowing migration operations.

Changes

Account Status Attribute

  • Added status attribute to Account class with three possible values:
    • "active" (default) - Normal backup and migration operations
    • "archived" - Skip backups, allow migrations (for decommissioned accounts that still need data access)
    • "offline" - Skip all operations (completely disabled accounts)

Account Class Enhancements

  • New convenience methods: active?, archived?, offline?
  • Helper methods: available_for_backup?, available_for_migration?
  • Status validation ensuring only valid values are accepted
  • Status included in serialization only when non-default (maintains backward compatibility)

Setup Interface Updates

  • Added status toggle option in account configuration menu
  • Status displayed in account header when not "active"
  • Toggle cycles through: active → archived → offline → active

Operation Filtering

  • Backup operations: Only process accounts with status == "active"
  • Migration operations: Process accounts with status in ["active", "archived"]
  • Offline accounts: Excluded from all operations

Example Usage

# Set an account to archived status
account.status = "archived"
account.available_for_backup?    # => false
account.available_for_migration? # => true

# Set an account to offline status  
account.status = "offline"
account.available_for_backup?    # => false
account.available_for_migration? # => false

Backward Compatibility

  • Existing configurations without status default to "active"
  • No breaking changes to existing functionality
  • Status omitted from serialization when "active" to maintain config file compatibility

Testing

  • 170 comprehensive tests covering all new functionality
  • Manual testing verified correct behavior for all status values
  • Backward compatibility confirmed with existing configurations

Fixes #191

This pull request was created as a result of the following prompt from Copilot chat.

Add Account Status Support (Issue #191)

Implement support for setting accounts to "archived" or "offline" status to prevent decommissioned accounts from being included in regular backups while still allowing migration operations.

Requirements

  1. Add account status attribute with three possible values:

    • "active" (default) - Normal backup and migration operations
    • "archived" - Skip backups, allow migrations (for decommissioned accounts that still need data access)
    • "offline" - Skip all operations (completely disabled accounts)
  2. Modify Account class to include:

    • New status attribute with validation
    • Convenience methods (active?, archived?, offline?)
    • Helper methods (available_for_backup?, available_for_migration?)
  3. Update setup interface to include:

    • Status toggle option in account configuration menu
    • Display current status in account header
  4. Filter operations by status:

    • Backup commands should only process active accounts
    • Migration commands should process active and archived accounts
    • Offline accounts should be completely excluded
  5. Maintain backward compatibility:

    • Existing configurations without status should default to "active"
    • No breaking changes to existing functionality

Implementation Details

The implementation should follow existing codebase patterns:

  • Use the same attribute management approach as mirror_mode and folder_blacklist
  • Add to OPTIONAL_ATTRIBUTES constant
  • Include in serialization via to_h method
  • Add validation for status values
  • Update setup menu with toggle interface similar to other boolean options

This addresses the enhancement request in issue #191 for better management of decommissioned email accounts.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits July 13, 2025 20:27
… methods

Co-authored-by: joeyates <137838+joeyates@users.noreply.github.com>
… display

Co-authored-by: joeyates <137838+joeyates@users.noreply.github.com>
…on for active/archived

Co-authored-by: joeyates <137838+joeyates@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Add account status support for archived/offline accounts Add Account Status Support for Managing Decommissioned Accounts Jul 13, 2025
@Copilot Copilot AI requested a review from joeyates July 13, 2025 20:38
Copilot finished work on behalf of joeyates July 13, 2025 20:38
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.

Support for setting account (backups) to "archived" or "offline"
2 participants