Skip to content

Extend Mythologies#1

Open
aatmmr wants to merge 2 commits intomainfrom
extend-mythologies
Open

Extend Mythologies#1
aatmmr wants to merge 2 commits intomainfrom
extend-mythologies

Conversation

@aatmmr
Copy link
Contributor

@aatmmr aatmmr commented Feb 19, 2026

This pull request introduces a new API endpoint to fetch a specific mythology by its ID, along with updates to the repository interface and implementation. Additionally, it adds new prompt files to guide implementation and planning, and removes the old Copilot instructions document.

API Enhancements

  • Added a new GET /api/v1/mythologies/{id} endpoint in Mythologies.cs to retrieve a single mythology by its ID, returning a 404 if not found.
  • Updated the IMythologyRepository interface to include GetMythologyByIdAsync(int id).
  • Implemented the GetMythologyByIdAsync method in MythologyRepository.cs, including related Gods data in the result.

Developer Workflow Improvements

  • Added .github/prompts/implementation.prompt.md to define a structured implementation workflow, emphasizing atomic commits and meaningful commit messages.
  • Added .github/prompts/planning.prompt.md to guide step-by-step planning for new features or fixes.

Documentation Cleanup

  • Removed the outdated .github/instructions/copilot-instructions.md file, which contained Copilot and project guidelines.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request extends the Mythologies API by adding a new endpoint to fetch a single mythology by ID, following the repository pattern established in the codebase. It also adds developer workflow guidance through prompt files and removes outdated documentation.

Changes:

  • Added GET /api/v1/mythologies/{id} endpoint with proper 404 handling for non-existent mythologies
  • Extended repository interface and implementation to support fetching mythology by ID with related Gods data
  • Added structured prompt files for implementation and planning workflows

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Mythologies/Interfaces/IMythologyRepository.cs Added GetMythologyByIdAsync method signature returning nullable Mythology
src/Mythologies/DBRepository/MythologyRepository.cs Implemented GetMythologyByIdAsync using Include to load related Gods
src/Endpoints/v1/Mythologies.cs Added GET {id} endpoint with 404 handling for non-existent resources
.github/prompts/planning.prompt.md Added planning workflow guidance for atomic commits
.github/prompts/implementation.prompt.md Added implementation workflow with commit message guidelines (contains typo)
.github/instructions/copilot-instructions.md Removed outdated Copilot instructions document

---

Implement the planned steps and following:
- Add the changes in smalle steps as atomic commits
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "smalle" should be "small".

Suggested change
- Add the changes in smalle steps as atomic commits
- Add the changes in small steps as atomic commits

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +15
mythologies.MapGet("{id}", async (int id, IMythologyRepository repository) =>
{
var mythology = await repository.GetMythologyByIdAsync(id);
return mythology is null ? Results.NotFound() : Results.Ok(mythology);
});
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new GetMythologyByIdAsync endpoint lacks test coverage. The codebase follows a comprehensive testing strategy with both unit tests and integration tests (see tests/UnitTests/GodEndpointsTests.cs and tests/IntegrationTests/GodsEndpointTests.cs). This new endpoint should have:

  1. Unit tests that mock the IMythologyRepository and test the endpoint logic
  2. Integration tests that verify the full HTTP request/response cycle, including the 404 response when a mythology is not found

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add the missing tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add the missing tests

Copy link

Copilot AI commented Feb 19, 2026

@aatmmr I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you.

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

Comments