feat: add project lifecycle status management - #574
Open
ReinaMaze wants to merge 1 commit into
Open
Conversation
Add comprehensive lifecycle status tracking for projects with five states: - Active: regularly maintained - Beta: not yet stable for production - Paused: temporarily not maintained - Deprecated: no longer recommended - Sunset: officially discontinued ## Changes **New Type:** - ProjectLifecycleStatus enum with 5 variants **Project struct updates:** - Add lifecycle_status field (defaults to Active) **API Methods:** - set_project_lifecycle_status(project_id, caller, status) - owner-only status changes - list_projects_by_lifecycle_status(status, start_id, limit) - filter by status with pagination **Events:** - ProjectLifecycleStatusUpdatedEvent emitted on status changes - Captures previous_status and new_status for audit trails **Storage:** - ProjectLifecycleStatus storage key added **Tests (20 test cases):** - Valid status transitions - All 5 status values - Unauthorized update prevention - Event emission verification - Multiple sequential transitions - List filtering by status - List pagination - Archived project exclusion - Non-owner rejection - Struct field verification ## Acceptance Criteria Met ✅ Project status enum with 5 lifecycle states ✅ Project owner can update status ✅ List APIs can filter by status with pagination ✅ Status changes emit events (with previous/new states) ✅ Comprehensive test coverage including: - Valid statuses - Status transitions - Filtering and pagination - Authorization enforcement - Event emission
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.
close #155
Add Project Lifecycle Status Management
Feature Description:
Implement comprehensive lifecycle status tracking for projects, allowing owners to signal project maturity, stability, and maintenance status beyond verification status. Projects now have five distinct lifecycle states reflecting their real-world status.
Motivation:
Projects evolve through different phases from active development through sunset. Verification status alone doesn't capture this lifecycle information. Lifecycle status allows:
Implementation:
New Types
ProjectLifecycleStatusenum with 5 variants:Core Changes
Types (
src/types.rs):ProjectLifecycleStatusenum with Clone, Copy, Debug, Eq, PartialEqlifecycle_status: ProjectLifecycleStatusfield toProjectstruct (defaults to Active)lifecycle_status: Option<ProjectLifecycleStatus>toProjectUpdateParamsStorage (
src/storage_keys.rs):ProjectLifecycleStatus(u64)storage key variantEvents (
src/events.rs):ProjectLifecycleStatusUpdatedEventstruct with:publish_project_lifecycle_status_updated_event()functionContract Interface (
src/lib.rs):set_project_lifecycle_status(project_id, caller, status)- owner-onlylist_projects_by_lifecycle_status(status, start_id, limit)- filters + paginationRegistry Logic (
src/project_registry.rs):API Methods
set_project_lifecycle_status(project_id, caller, status) → Project
list_projects_by_lifecycle_status(status, start_id, limit) → Vec
Test Coverage (20 test cases)
Backward Compatibility
Acceptance Criteria Met
Related Documentation: