Skip to content

refactor(github): extract inlined-struct into the github package #6

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 11, 2025

Conversation

nobe4
Copy link
Contributor

@nobe4 nobe4 commented Apr 11, 2025

This will make the code easier to understand and will give opportunity for further refactoring.

This will make the code easier to understand and will give opportunity
for further refactoring.
@nobe4 nobe4 requested a review from GrantBirki as a code owner April 11, 2025 08:59
GrantBirki
GrantBirki previously approved these changes Apr 11, 2025
@GrantBirki GrantBirki requested a review from Copilot April 11, 2025 19:44
Copy link
Contributor

@Copilot Copilot AI left a comment

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 refactors repository-related functionality by extracting the inline repository struct into the new github package.

  • Introduces a dedicated Repo type and associated methods (ParseRepo, String, PullsEndpoint).
  • Updates functions across the codebase to use the new Repo type and removes inline structs.
  • Refactors combine PR and repository processing code to improve clarity and maintainability.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/github/repo_test.go Adds tests for the new ParseRepo function.
internal/github/repo.go Introduces the Repo type and related functions.
internal/github/github.go Provides common GitHub entity definitions for consistency.
internal/cmd/root.go Updates repository parsing and processing to utilize the new Repo type.
internal/cmd/combine_prs.go Refactors branch and pull request operations to leverage the Repo type.
Comments suppressed due to low confidence (1)

internal/cmd/root.go:265

  • The variable 'labels' is undefined in this context. Consider using 'pull.Labels' as the second argument to PrMatchesCriteria.
if !PrMatchesCriteria(pull.Head.Ref, labels) {

@GrantBirki GrantBirki merged commit 3c94dcc into main Apr 11, 2025
7 checks passed
@GrantBirki GrantBirki deleted the github-structs branch April 11, 2025 19:49
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.

2 participants