palantir / palantir/go-githubapp

PrepareRepoContext should take an interface

Open
#75 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
450
Forks
70
Avg merge
14h 23m
Merged PRs (30d)
26

Description

https://github.com/palantir/go-githubapp/blob/e6f4865447e65335e1cb8787d1d25db843e0a14f/githubapp/context.go#L35

go-github has a variety of repository-like objects, notably Repository and PushEventRepository. Since PrepareRepoContext only cares about a few fields accessed via getters, we should define an interface to accommodate the various repository objects.

We should use the same interface in PreparePRContext.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in githubapp/context.go at PrepareRepoContext and inspect the getters it uses, then compare PreparePRContext. Define the shared repository interface requested by the issue and update both helpers so they accept repository-like objects such as Repository and PushEventRepository; run the project tests to confirm the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend-api-design
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.