Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Fix ai agent generation issues#1312

Open
chent00ng wants to merge 53 commits intodevfrom
feature/fix-ai-agent-generation-issues
Open

Fix ai agent generation issues#1312
chent00ng wants to merge 53 commits intodevfrom
feature/fix-ai-agent-generation-issues

Conversation

@chent00ng
Copy link
Copy Markdown
Contributor

No description provided.

… - Domain names auto-generated from project names with collision handling - V1 API remains unchanged for backward compatibility - V2 API at /api/app/project/v2 with auto-generation support - Simple collision resolution with numeric suffixes - Complete integration test framework for V2 endpoints
…and implementing logic directly in ProjectService
…oint to use professional naming conventions - Replace v2 naming with auto to better reflect auto-domain generation functionality - Update all references including interfaces, services, controllers and tests - Change endpoint from /v2 to /auto for better semantic meaning
…eature - Rename test class from ProjectServiceV2Tests to ProjectAutoCreationTests - Update all V2 references to Auto for better semantic meaning - Maintain consistency with professional naming conventions across the codebase
…y - Auto-generated domain names now throw UserFriendlyException for conflicts instead of adding suffixes - Update test cases to verify exception throwing behavior for domain conflicts - Maintain consistency with existing CreateAsync error handling approach
…internal method - Extract CreateProjectInternalAsync as private method containing core project creation logic - Simplify CreateAsync to delegate to internal method - Simplify CreateProjectAsync with inline domain generation and delegation - Remove unnecessary NormalizeProjectNameToDomain method - Achieve DRY principle and improved maintainability
…d] attribute - Framework's model validation already handles DisplayName null check via [Required] in CreateOrganizationDto - Remove duplicate string.IsNullOrWhiteSpace validation - Keep only domain generation logic validation - Cleaner and more maintainable code following DRY principle
- Add structured logging at key checkpoints in project creation process
- Include method entry/exit logs with input parameters and results
- Add debug logs for domain uniqueness checks and organization retrieval
- Log project entity creation, domain record insertion, and role creation
- Track OrganizationUnitManager project creation and developer service calls
- Implement proper exception handling with error logging
- Use parameterized logging for performance and security
- Provide detailed observability for project creation workflow debugging
…logs

- Remove Debug level logs that provide excessive detail during normal operation
- Maintain only critical Information level logs for key project creation milestones
- Keep Warning level logs for business logic conflicts (domain exists, duplicate project name)
- Keep Error level logs for unexpected failures
- Improve log noise reduction while preserving essential observability
- Follows user feedback to reduce log verbosity
…dency injection

- Replace inherited Logger property with private readonly ILogger<ProjectService> field
- Add ILogger<ProjectService> parameter to constructor for explicit dependency injection
- Update all Logger.LogXxx() calls to use _logger.LogXxx() for better type safety
- Follow .NET Core dependency injection best practices
- Improve testability and debugging capability with specific logger type
- Maintain all existing logging functionality with enhanced type safety
- Change generic 'dto' variable name to more descriptive 'projectDto' in CreateProjectInternalAsync
- Improves code readability and follows descriptive naming conventions
- Maintains all existing functionality with clearer intent
- Related to the user feedback on improving variable naming practices
…y targeted exception handling for OrganizationUnitManager.CreateAsync
…etters, digits, and hyphens for domain names - Replace ArgumentException with UserFriendlyException - Remove duplicate validation logic - Update test cases to match new validation rules
- Add validation method ValidateUserGoal checking 15-250 character limits
- Throw UserFriendlyException for invalid input (empty, too short, too long)
- Allow UserFriendlyException to bubble up through error handling
- Add comprehensive unit tests for all validation scenarios
- All tests passing (12/12)
- Remove duplicate validation success logging
- Keep essential info logging for request processing
- Fix CreateProjectDto usage in ProjectService.cs and ProjectServiceTests.cs
- Remove DomainName property usage, use CreateProjectAsync method instead
- All compilation errors resolved, project builds successfully
- Update input validation tests to use detailed descriptions instead of short inputs
- Fix NodeId assertions to validate GUID format instead of fixed strings
- Adjust return value expectations for empty workflow generation
- All 32 tests now passing (previously 6 failed, 26 passed)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant