Skip to content

MINOR CONTROLLERS: Repository InvalidReference Post-Put#333

Open
glhays wants to merge 3 commits into
mainfrom
users/glhays/minorcontrollers-invalidreference-post
Open

MINOR CONTROLLERS: Repository InvalidReference Post-Put#333
glhays wants to merge 3 commits into
mainfrom
users/glhays/minorcontrollers-invalidreference-post

Conversation

@glhays

@glhays glhays commented Jun 14, 2025

Copy link
Copy Markdown
Collaborator

@glhays glhays requested review from aosunlana, cjdutoit and Copilot June 14, 2025 22:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

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.

MINOR CONTROLLERS: Repository InvalidReference Post-Put

3 participants