Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃毀Create service to get PR branch info #22

Closed
19 tasks done
CalvinWilkinson opened this issue Sep 26, 2022 · 0 comments 路 Fixed by #25
Closed
19 tasks done

馃毀Create service to get PR branch info #22

CalvinWilkinson opened this issue Sep 26, 2022 · 0 comments 路 Fixed by #25
Assignees
Labels
high priority High Priority 鉁╪ew feature New feature that does not exist preview Done while in preview

Comments

@CalvinWilkinson
Copy link
Member

CalvinWilkinson commented Sep 26, 2022

Complete The Item Below

  • I have updated the title without removing the 馃毀 emoji.

Description

Problem:
Currently, getting pull request branch information will only work by using the GitHubActions.HeadRef or GitHubActions.BaseRef. Using this is only good in the GitHub environment because that is the only time the GitHubActions 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 the GitHubClient 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

  • Create service GitRepoService - 鉁╪ew feature New feature that does not exist
    • Commit property added
    • Branch property added
  • Create service GitHubActions object created - 鉁╪ew feature New feature that does not exist
    • Name of service should be GitHubActionsService.
    • Token property added.
    • Actor property added.
      • If on the server, just GitHubActions object. If local, use the currently logged in user name.
    • Ref property added.
    • BaseRef property added.
      • Needs to be nullable as well as explain with code docs that it is only used on the server.
    • HeadRef property added.
      • If on the server, use the GitHubActions.HeadRef. If local, use the current branch.
    • PullRequestNumber property added.
      • Needs to be nullable as well as explain with code docs that it is only used on the server.
    • Refactor code throughout the code base to use the new service instead of the raw GitHubActions object.

ToDo Items

  • Change type labels added to this issue. Refer to the Change Type Labels section below.
  • Priority label added to this issue. Refer to the Priority Type Labels section below.
  • Issue linked to the correct project (if applicable).
  • Issue linked to the correct milestone (if applicable).
  • Draft pull request created and linked to this issue (only required with code changes).

Issue Dependencies

No response

Related Work

No response

Additional Information:

Change Type Labels

Change Type Label
Bug Fixes 馃悰bug
Breaking Changes 馃Жbreaking changes
New Feature 鉁╪ew feature
Workflow Changes workflow
Code Doc Changes 馃棐锔廳ocumentation/code
Product Doc Changes 馃摑documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.
@CalvinWilkinson CalvinWilkinson added high priority High Priority preview Done while in preview 鉁╪ew feature New feature that does not exist labels Sep 26, 2022
@CalvinWilkinson CalvinWilkinson self-assigned this Sep 26, 2022
@CalvinWilkinson CalvinWilkinson added this to the v1.0.0-preview.5 milestone Sep 27, 2022
CalvinWilkinson added a commit that referenced this issue Sep 27, 2022
@CalvinWilkinson CalvinWilkinson linked a pull request Sep 27, 2022 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority High Priority 鉁╪ew feature New feature that does not exist preview Done while in preview
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant