Files
cleveragents-core/features/project_model.feature
T
khyari hamza 676810d62b feat: Add ValidationConfig and ContextConfig models with step definitions
- Introduced ValidationConfig for project validation commands including test, lint, type-check, and build commands.
- Added ContextConfig for project context indexing and filtering, with support for ignore/include patterns and file size limits.
- Implemented step definitions for both models in project_config_model_steps.py.
- Enhanced Project model to include validation_config and context_config fields.
- Created comprehensive step definitions for Resource model, including validation and manipulation steps in resource_model_steps.py.
- Updated resource.py to define Resource model with necessary fields and validation.
- Refactored project.py to integrate new models and maintain backward compatibility.
2026-02-12 14:32:10 +00:00

125 lines
5.6 KiB
Gherkin

Feature: Project Domain Model Extensions
As a developer
I want the Project model to support ULID identifiers, namespaces, resources, and configs
So that projects can be properly categorized and managed
# B1.1a - Import Resource, verify Project has new fields
Scenario: Create a Project with new B1.1 fields
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" namespace "local"
Then the project project_id should be "01ARZ3NDEKTSV4RRFFQ69G5FAV"
And the project name should be "my-project"
And the project namespace should be "local"
# B1.1b - Identity fields
Scenario: Project has default namespace
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
Then the project namespace should be "local"
Scenario: Project description defaults to none
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
Then the project description should be none
Scenario: Create a Project with description
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" and description "A test project"
Then the project description should be "A test project"
# B1.1c - Categorization fields
Scenario: Project tags default to empty list
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
Then the project tags should be empty
Scenario: Create a Project with tags
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" and tags "python,web,api"
Then the project tags should contain "python"
And the project tags should contain "web"
And the project tags should contain "api"
Scenario: Project resources default to empty list
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
Then the project resources should be empty
Scenario: Project validation_config defaults to none
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
Then the project validation_config should be none
Scenario: Project context_config has defaults
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
Then the project context_config should not be none
# B1.1d - Timestamp fields
Scenario: Project has timestamps
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
Then the project created_at should be set
And the project updated_at should be set
# B1.1e - is_remote computed property
Scenario: Project with no resources is not remote
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
Then the project is_remote should be false
Scenario: Project with all remote resources is remote
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" and all remote resources
Then the project is_remote should be true
Scenario: Project with mixed resources is not remote
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" and mixed resources
Then the project is_remote should be false
# B1.1f - Namespace validator
Scenario: Namespace local is valid
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" namespace "local"
Then the project namespace should be "local"
Scenario: Namespace with valid pattern is accepted
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" namespace "team_alpha"
Then the project namespace should be "team_alpha"
Scenario: Namespace system is rejected
When I try to create a Project with namespace "system"
Then a namespace validation error should be raised
Scenario: Namespace with uppercase is rejected
When I try to create a Project with namespace "MyNamespace"
Then a namespace validation error should be raised
Scenario: Namespace starting with number is rejected
When I try to create a Project with namespace "1invalid"
Then a namespace validation error should be raised
# B1.1g - Helper methods
Scenario: namespaced_name returns correct format
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" namespace "team_alpha"
Then the project namespaced_name should be "team_alpha/my-project"
Scenario: namespaced_name with local namespace
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" namespace "local"
Then the project namespaced_name should be "local/my-project"
Scenario: add_resource adds a resource to the project
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
When I add a resource named "my-repo" to the project
Then the project should have 1 resource
And the project should have a resource named "my-repo"
Scenario: remove_resource removes a resource from the project
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" and a resource named "my-repo"
When I remove the resource named "my-repo" from the project
Then the project resources should be empty
Scenario: get_resource returns the correct resource
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" name "my-project" and a resource named "my-repo"
When I get the resource named "my-repo" from the project
Then the retrieved resource name should be "my-repo"
Scenario: get_resource returns none for unknown name
Given a Project with project_id "01ARZ3NDEKTSV4RRFFQ69G5FAV" and name "my-project"
When I get the resource named "nonexistent" from the project
Then the retrieved resource should be none