Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .amazonq/rules/architecture-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# .gitlab/duo/architecture-context.yaml
instructions: |
System architecture:
- books-service: FastAPI application exposing REST endpoints
- books-database: SQLite database with book records
- frontend: React SPA with component-based UI
- robot-tests: Browser automation tests using Robot Framework

Data flows:
- Frontend makes API calls to backend for CRUD operations
- Backend validates requests and interacts with database
- Changes are reflected immediately in the UI
16 changes: 16 additions & 0 deletions .amazonq/rules/code-standards.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# .gitlab/duo/code-standards.yaml
instructions: |
When reviewing or generating code:
- Python code follows PEP 8 with 4-space indentation
- JavaScript uses ES6+ features and follows Airbnb style guide
- API endpoints follow RESTful conventions
- Tests are required for all new features
- Error handling must be comprehensive
- Use meaningful variable and function names
- Comments should explain the "why" not the "what"
- Commit messages should be concise and descriptive
- Ensure code is modular and reusable
- Use type hints in Python for better clarity
- Frontend components should be functional and use hooks
- CSS should follow BEM naming conventions
- Regularly run linters and formatters before committing
70 changes: 70 additions & 0 deletions .amazonq/rules/mr-review-instructions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# mr-review-instructions.yaml
# Instructions for reviewing Python code and Robot Framework tests

review:
python:
general:
- Check for PEP 8 compliance (line length, naming conventions, indentation)
- Ensure proper docstrings for modules, classes, and functions
- Verify error handling with appropriate try/except blocks
- Check for proper logging instead of print statements
- Confirm no hardcoded credentials or sensitive information
- Verify imports are organized and unnecessary imports removed

performance:
- Look for inefficient algorithms or data structures
- Check for unnecessary database queries or API calls
- Verify proper use of list/dict comprehensions where appropriate
- Ensure large data processing uses generators where applicable

testing:
- Verify unit tests cover new functionality
- Check test coverage for edge cases
- Ensure mocks are used appropriately for external dependencies
- Confirm tests are isolated and don't depend on external state

security:
- Check for SQL injection vulnerabilities
- Verify input validation for user-provided data
- Ensure proper authentication and authorization checks
- Look for potential information disclosure issues

robot_framework:
general:
- Ensure test cases follow a clear, descriptive naming convention
- Use gherkin-style Given/When/Then structure in test cases
- Do not use gherkin-style structure in keywords
- Verify keywords are properly documented
- Check for proper use of tags for test categorization
- Confirm test setup and teardown procedures are appropriate
- Verify variables are properly defined and used

structure:
- Check for proper test case organization
- Ensure reusable keywords are in resource files
- Verify test suites are logically organized
- Check for proper use of test templates where applicable

reliability:
- Look for proper wait conditions instead of fixed sleeps
- Verify error handling in test cases
- Check for proper cleanup in teardown procedures
- Ensure tests are not dependent on specific test data

best_practices:
- Verify page object pattern is used for UI tests
- Check for proper separation of concerns in keywords
- Ensure test data is properly isolated or generated
- Verify tests are not overly complex or brittle

ci_checks:
- Ensure all CI pipeline stages pass
- Verify code quality tools (pylint, flake8) report no issues
- Check test coverage meets minimum threshold
- Confirm no security vulnerabilities reported by security scanners

documentation:
- Verify README is updated if necessary
- Check for updated API documentation if applicable
- Ensure changelog is updated with new features or fixes
- Confirm any configuration changes are documented
47 changes: 47 additions & 0 deletions .amazonq/rules/project-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# .gitlab/duo/project-context.yaml
instructions: |
This project is a books database service with the following components:
- FastAPI backend service for book management
- SQLite database for data storage
- React frontend for user interaction
- Robot Framework for UI testing

Key domain concepts:
- Books have properties: title, author, pages, category, favorite status
- Users can add, edit, delete, search, and favorite books
- Categories are used for filtering books

Technical constraints:
- We use Docker for containerization
- CI/CD pipeline runs tests on each commit
- Frontend communicates with backend via REST API
- Backend uses SQLite for simplicity
- Robot Framework is used for end-to-end UI testing

robot_framework:
general:
- Ensure test cases follow a clear, descriptive naming convention
- Use gherkin-style Given/When/Then structure in test cases
- Do not use gherkin-style structure in keywords
- Verify keywords are properly documented
- Check for proper use of tags for test categorization
- Confirm test setup and teardown procedures are appropriate
- Verify variables are properly defined and used

structure:
- Check for proper test case organization
- Ensure reusable keywords are in resource files
- Verify test suites are logically organized
- Check for proper use of test templates where applicable

reliability:
- Look for proper wait conditions instead of fixed sleeps
- Verify error handling in test cases
- Check for proper cleanup in teardown procedures
- Ensure tests are not dependent on specific test data

best_practices:
- Verify page object pattern is used for UI tests
- Check for proper separation of concerns in keywords
- Ensure test data is properly isolated or generated
- Verify tests are not overly complex or brittle
11 changes: 11 additions & 0 deletions .amazonq/rules/terminology.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# .gitlab/duo/terminology.yaml
instructions: |
Glossary of terms:
- Book: Main entity with title, author, etc.
- Category: Classification for books (Fiction, Non-Fiction, etc.)
- Favorite: Boolean flag indicating user preference
- Filter: UI mechanism to show subset of books
- Sort: UI mechanism to order books by specific properties
- CRUD: Create, Read, Update, Delete operations on books
- API: Application Programming Interface for backend communication
- MR: Merge Request for code changes
16 changes: 16 additions & 0 deletions .amazonq/rules/workflow-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# .gitlab/duo/workflow-context.yaml
instructions: |
Our development workflow:
- Feature branches are created from main
- MRs require passing CI pipeline and code review
- UI changes need screenshots in MR description
- Database changes require migration scripts
- API changes must be documented in OpenAPI spec
- Robot Framework tests cover critical user flows
- Regularly update dependencies and address security alerts
- Merge to main triggers deployment to staging
- Manual testing in staging before production deployment
- Hotfixes are done directly on main with MR
- Use semantic commit messages (feat, fix, docs, style, refactor, test, chore)
- Tag releases with version numbers (vX.Y.Z)

Loading
Loading