Skip to content

Conversation

@martinffx
Copy link
Owner

@martinffx martinffx commented Nov 2, 2025

Content Entities Implementation

This PR implements the content-entities specification, adding full support for issues, pull requests, comments, reactions, forks, and stars.

What's New

Entities (7 new)

  • Issues with sequential numbering and status tracking
  • Pull Requests with merge status
  • Issue & PR Comments (with file/line context for PR comments)
  • Reactions (works on issues, PRs, and comments)
  • Forks and Stars

Database Changes

  • Added GSI4 for issue status queries
  • Added Counter entity for sequential numbering

API Endpoints

  • Full REST API for all new entities
  • Comprehensive validation with Typebox schemas

martinffx and others added 13 commits November 2, 2025 12:54
Implements Phase 1-4 of content-entities feature (41% complete):

Phase 1 - Schema Foundation:
- Add GSI4 index for status-based filtering
- Support for reverse/forward chronological ordering

Phase 2 - Sequential Numbering:
- Add CounterEntity for atomic increments
- Add CounterRepository with $add operations
- Tests verify concurrent increment handling

Phase 3 - Issue Entity (COMPLETE):
- Add IssueRecord with GSI4 status queries
- Add IssueEntity with full transformations
- Add IssueRepository with CRUD + status filtering
- 15 tests covering concurrent operations

Phase 4 - PullRequest Entity (33% complete):
- Add PullRequestRecord schema with GSI1/GSI4
- Ready for PullRequest entity class implementation

Additional changes:
- Fix RepositoryRepository timestamp mapping (.entities())
- Add DynamoDB Toolbox standards documentation
- Remove manual timestamps (use DDB Toolbox auto-timestamps)
- Reorganize entity exports to wildcard pattern

Tests: 129 passing (was 109, +20 new tests)
Coverage: 100% maintained across all new code

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…I layer

- Add 6 new entities: IssueComment, PRComment, Reaction, Fork, Star + PullRequest enhancements
- Add 6 new repositories with full CRUD operations and validation
- Add IssueService and PullRequestService with business logic layer
- Add IssueRoutes and PullRequestRoutes with 10 HTTP endpoints
- Add 138 new tests (all passing, 284 total)
- Update schema: item collections, polymorphic keys, adjacency lists
- Implement transaction-based validation for referential integrity
- Complete repository layer and 40% of API layer (Phase 8: 2/5 tasks)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
This commit addresses test failures by fixing several critical issues:

- ReactionEntity: Update emoji validation regex to support variation selectors
  * Changed regex to include \p{Emoji_Component} for U+FE0F support
  * Fixes validation failures for modern emojis (👍, ❤️, 🚀)

- ReactionRoutes.test: Remove trailing undefined parameters
  * Fixed assertion mismatches in listReactions (line 162)
  * Fixed assertion mismatches in getReactionsByEmoji (line 195)

- StarRoutes.test: Correct status code expectation
  * Changed from 201 to 204 for PUT star operation
  * Removed json() assertion since 204 has no body

All 365 tests now passing (previously 118 failures).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…ork, and Star

This commit completes Phase 8 (API Layer) by implementing services and routes for the final four content entity types:

**Comment Service & Routes:**
- CommentService: 8 methods for Issue and PR comment operations
- Polymorphic routes support both /issues/:id/comments and /pulls/:id/comments
- 18 test cases covering CRUD operations

**Reaction Service & Routes:**
- ReactionService: 4 polymorphic methods supporting 4 target types
- Supports reactions on Issues, PRs, IssueComments, and PRComments
- 15 test cases covering all target types

**Fork Service & Routes:**
- ForkService: 4 methods (create, delete, list, get)
- 3 API endpoints with transaction-based validation
- 13 test cases

**Star Service & Routes:**
- StarService: 4 methods (star, unstar, listUserStars, isStarred)
- 4 API endpoints (star, unstar, list starred, list stargazers)
- 12 test cases

**API Endpoints Added:**
- 8 Comment endpoints (4 issue + 4 PR)
- 12 Reaction endpoints (polymorphic across 4 target types)
- 3 Fork endpoints
- 4 Star endpoints

**Total:** 27 new API endpoints, 58 new tests, 365 total tests passing

**Feature Status:** Phase 8 complete (5/5 tasks), all 22 tasks complete ✓

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Merged Comment, Reaction, Fork, and Star services into their parent services (Issue, PullRequest, Repository) for better cohesion. Deleted standalone services and routes, moving all functionality into the parent service layer. This reduces code duplication and creates a more intuitive API structure where child resources are managed through their parent context.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Increase zero-padding from 6 to 8 digits (supports up to 99,999,999)
- Fix product.md: Correct Issue main table PK/SK patterns
- Fix product.md: Correct GSI4 partition keys (ISSUE# not REPO#)
- Update reverse numbering: 99999999 - issue_number for open issues
- Update IssueCommentRepository and PRCommentRepository query methods
- All 353 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Update all jobs to use Node.js v24
- Remove matrix strategy (single version testing)
- Simplify test job configuration
- Update all jobs to use Node.js v24
- Update pnpm version to 10.20.0 to match package.json
- Remove matrix strategy (single version testing)
- Simplify test job configuration
Remove explicit pnpm version from CI workflow. The pnpm/action-setup@v4
action will automatically read the version from package.json's
packageManager field, ensuring they stay in sync without manual updates.

Fixes version mismatch errors and simplifies maintenance.
Add amazon/dynamodb-local container to CI test job to enable repository
integration tests. Tests connect to localhost:8000 which matches the
hardcoded endpoint in test files.

Changes:
- Add DynamoDB Local service with health checks to test job
- Configure AWS environment variables for test execution
- Service health check ensures DB is ready before tests run

Fixes 122 failing integration tests that require DynamoDB access.
Remove health check from DynamoDB Local service container as the
amazon/dynamodb-local image does not include curl. The service starts
quickly and tests handle connection retries automatically.

This fixes the "Service container dynamodb failed" error during CI runs.
@martinffx martinffx merged commit 83ad3b6 into main Nov 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants