3.1 KiB
3.1 KiB
Story 4: Environment Management (Enhancement)
Story Overview
As a system administrator
I want to enhance environment management
So that I can better organize and categorize deployment targets
Story Type: Enhancement
Priority: Medium
Estimated Effort: 2-3 days
Dependencies: Story 0 (Foundation - basic Environment CRUD exists)
Business Value
Story 0 created basic Environment CRUD. This story enhances it with:
- Better organization and categorization
- Production environment safety controls
- Criticality-based filtering and alerts
- Foundation for environment-specific permissions
Scope
In Scope (Enhancements to Story 0)
✅ Add environment categorization/tags
✅ Add environment deactivation (soft delete)
✅ Add production environment warnings
✅ Add environment groups (e.g., "Production EU", "Development")
✅ Enhanced search and filtering
Out of Scope
❌ Environment-specific user permissions (future)
❌ Environment health monitoring (future)
Database Migration
-- Add new columns to existing environment table
ALTER TABLE environment
ADD COLUMN is_active BOOLEAN NOT NULL DEFAULT true,
ADD COLUMN environment_group VARCHAR(100),
ADD COLUMN tags VARCHAR(255);
-- Index for filtering
CREATE INDEX idx_environment_active ON environment(is_active);
CREATE INDEX idx_environment_group ON environment(environment_group);
Key Enhancements
Backend
- Add
isActivefield to Environment entity (soft delete) - Add
environmentGroupfield (e.g., "Production", "Non-Production") - Add
tagsfield (comma-separated or JSON array) - Update
EnvironmentRepositorywith new queries:findByIsActive(boolean)findByEnvironmentGroup(String)findByIsProductionAndIsActive(boolean, boolean)
- Add deactivate/reactivate methods to service
- Update DTOs with new fields
Frontend
- Add "Active/Inactive" filter toggle
- Add "Group" filter dropdown
- Show warning dialog when creating/editing production environments
- Show "Deactivate" instead of "Delete" (with reactivate option)
- Add visual indicators for inactive environments (grayed out)
- Add environment group badges
Acceptance Criteria
- Environments can be deactivated (soft delete)
- Inactive environments are hidden by default
- User can view inactive environments via filter
- Inactive environments can be reactivated
- Production environments show warning before modifications
- Environments can be organized into groups
- Environments can be tagged
- Search includes tags and groups
Testing Scenarios
- Deactivate Environment: Deactivate an environment, verify it's hidden from default list
- Reactivate Environment: Reactivate an environment, verify it appears again
- Production Warning: Attempt to edit production environment, verify warning shown
- Group Filtering: Filter by environment group, verify correct results
- Tag Search: Search by tag, verify matching environments shown
Story Status: Ready for Development
Estimated Completion: 2-3 days