You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"error": "Failed to fetch commit info: <error details>"
}
Technical Details
Use the JGit library to interact with the .git repository and retrieve the latest commit information:
commitHash: The hash of the latest commit.
commitDate: The timestamp of the latest commit, formatted as dd/MM/yyyy HH:mm:ss in the Europe/Kyiv timezone.
Introduce a service interface (CommitInfoService) with an implementation class (CommitInfoServiceImpl) to encapsulate the logic for retrieving Git information.
Define a controller (CommitInfoController) to expose the endpoint and return the appropriate response.
Use polymorphism in the response:
Create an abstract DTO (CommitInfoDto) as the base class.
Feature Request
Implement a REST endpoint to retrieve the latest Git commit details, including the commit hash and date, using the following specifications.
Requirements :
/commit-info
GET
200 OK
):500 Internal Server Error
):Technical Details
.git
repository and retrieve the latest commit information:dd/MM/yyyy HH:mm:ss
in theEurope/Kyiv
timezone.CommitInfoService
) with an implementation class (CommitInfoServiceImpl
) to encapsulate the logic for retrieving Git information.CommitInfoController
) to expose the endpoint and return the appropriate response.CommitInfoDto
) as the base class.CommitInfoSuccessDto
(fields:commitHash
,commitDate
).CommitInfoErrorDto
(field:error
).Error Handling
500
) if:.git
directory is missing.Why This Feature Is Important
The text was updated successfully, but these errors were encountered: