馃毀Create service to get PR branch info #22
Labels
high priority
High Priority
鉁╪ew feature
New feature that does not exist
preview
Done while in preview
Milestone
Complete The Item Below
Description
Problem:
Currently, getting pull request branch information will only work by using the
GitHubActions.HeadRef
orGitHubActions.BaseRef
. Using this is only good in the GitHub environment because that is the only time theGitHubActions
instance is NOT NULL.This means that running pull request-related stuff locally becomes an issue because the object instance is null.
Solution:
To allow this functionality to work, create a service that will detect if the build is a server build or a local build. If it is a server build, use the
GitHubActions
instance, if it is a local build, use theGitHubClient
to interact with the API to be able to get the branch information required.To maximize the testability of the new service, create a thin wrapper around the
GitHubActions
object that can be injected into the new service for use. This way we are not found to server only state and can easily maximize our testability.Once the new service is complete, refactor the use cases throughout the code base to use the new service instead of the
GitHubActions
object.Acceptance Criteria
GitRepoService
- 鉁╪ew featureCommit
property addedBranch
property addedGitHubActions
object created - 鉁╪ew featureGitHubActionsService
.Token
property added.Actor
property added.GitHubActions
object. If local, use the currently logged in user name.Ref
property added.BaseRef
property added.HeadRef
property added.GitHubActions.HeadRef
. If local, use the current branch.PullRequestNumber
property added.GitHubActions
object.ToDo Items
Issue Dependencies
No response
Related Work
No response
Additional Information:
Change Type Labels
馃悰bug
馃Жbreaking changes
鉁╪ew feature
workflow
馃棐锔廳ocumentation/code
馃摑documentation/product
Priority Type Labels
low priority
medium priority
high priority
Code of Conduct
The text was updated successfully, but these errors were encountered: