Skip to content

Conversation

decyjphr
Copy link
Collaborator

@decyjphr decyjphr commented Oct 3, 2025

This pull request refactors the way repository and sub-organization settings are synchronized, improving clarity and maintainability by consolidating logic and introducing a new method for handling multiple changes at once. The changes also update how file changes are detected in pull requests, aligning with GitHub's API best practices.

@Copilot Copilot AI review requested due to automatic review settings October 3, 2025 21:05
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 pull request refactors the synchronization logic for repository and sub-organization settings by consolidating duplicate code into batch processing functions. The main goal is to handle multiple configuration changes from PR or push events more efficiently by processing them as a batch rather than individually.

Key changes:

  • Introduced syncSelectedRepos method to handle batching of repository and sub-organization synchronization
  • Consolidated duplicate sync logic by creating a unified syncSelectedSettings function
  • Updated pull request file change detection to use GitHub's pull request files API instead of commit comparison

Reviewed Changes

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

File Description
lib/settings.js Added new syncSelectedRepos batch processing method and extracted checkAndProcessRepo helper
index.js Refactored sync functions to use batch processing and updated PR file detection logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

decyjphr and others added 2 commits October 3, 2025 17:07
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
@decyjphr decyjphr requested a review from Copilot October 3, 2025 21:16
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +569 to +571
params = Object.assign(context.repo(), { pull_number: pull_request.number })

const changes = await context.octokit.pulls.listFiles(params)
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The variable params is being reused for different purposes. Consider using a more descriptive variable name like pullRequestParams to improve code clarity and avoid confusion with the previous check run parameters.

Copilot uses AI. Check for mistakes.

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.

Handle Push and Pull Request events having multiple config file changes.
1 participant