MINOR CONTROLLERS: Repository InvalidReference Post-Put#333
Open
glhays wants to merge 3 commits into
Open
Conversation
glhays
commented
Jun 14, 2025
Collaborator
- Closes: MINOR CONTROLLERS: Repository InvalidReference Post-Put #311
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issue #311 by adding handling for invalid repository references in both the POST and PUT endpoints of the RepositoriesController, along with corresponding unit tests.
- Added catch blocks in POST and PUT endpoints to return a FailedDependency response for InvalidRepositoryReferenceException.
- Introduced unit tests in both Post and Put exception test classes to verify the new error handling.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| GitFyle.Core.Api/Controllers/RepositoriesController.cs | Added catch blocks for InvalidRepositoryReferenceException in POST and PUT actions. |
| GitFyle.Core.Api.Tests.Unit/Controllers/Repositories/RepositoriesControllerTests.Exceptions.Put.cs | Added test verifying the PUT endpoint returns FailedDependency for an invalid repository reference. |
| GitFyle.Core.Api.Tests.Unit/Controllers/Repositories/RepositoriesControllerTests.Exceptions.Post.cs | Added test verifying the POST endpoint returns FailedDependency for an invalid repository reference. |
Comments suppressed due to low confidence (1)
GitFyle.Core.Api/Controllers/RepositoriesController.cs:39
- [nitpick] The catch blocks for InvalidRepositoryReferenceException in both POST and PUT endpoints share similar logic. Consider extracting this error handling into a common helper method to reduce duplication and improve maintainability.
catch (RepositoryDependencyValidationException repositoryDependencyValidationException) when (repositoryDependencyValidationException.InnerException is InvalidRepositoryReferenceException)
cjdutoit
reviewed
Jun 17, 2025
cjdutoit
reviewed
Jun 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.