Skip to content

Conversation

@sileht
Copy link
Member

@sileht sileht commented Oct 10, 2025

This change changes the configuration format to:

scopes:
  merge_queue_scope: merge-queue
  mode: parallel
  source:
    files:
      js:
        include:
          - "**/*.js"
      python:
        include:
          - "**/*.py"
      other:
        include:
          - "**/*"
        exclude:
          - "**/*.py"
          - "**/*.js"

Sources will later have value like: bazel, nx, turporepo

We will have something like:

scopes:
  merge_queue_scope: merge-queue
  mode: parallel
  source:
    nx:
      command: ["npx", "nx"]

To get the scopes, this will run: npx nx show projects --affected --base={base} --head={head}"

Copilot AI review requested due to automatic review settings October 10, 2025 19:05
@mergify mergify bot had a problem deploying to Mergify Merge Protections October 10, 2025 19:05 Failure
Copy link

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 changes the configuration file format to introduce a hierarchical structure for scopes with nested source configuration. The new format allows for different source types (starting with files) and includes additional fields like mode and merge_queue_scope at the top level of the scopes configuration.

  • Restructures configuration format to nest file-based scope definitions under scopes.source.files
  • Adds new fields mode and merge_queue_scope to the scopes configuration
  • Refactors the match_scopes function to accept file filters directly instead of the full config

Reviewed Changes

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

File Description
mergify_cli/ci/scopes/cli.py Implements new configuration structure with ScopesConfig, SourceFiles, and FileFilters models, and updates the match_scopes function signature
mergify_cli/tests/ci/scopes/test_cli.py Updates all test cases to use the new nested configuration format and adjusts function calls to match the new match_scopes signature

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

@mergify
Copy link
Contributor

mergify bot commented Oct 10, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=test (macos-15)
    • check-success=test (ubuntu-24.04)
    • check-success=test (windows-2025)

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

@mergify
Copy link
Contributor

mergify bot commented Oct 10, 2025

🧪 CI Insights

Here's what we observed from your CI run for c370582.

🟢 All jobs passed!

But CI Insights is watching 👀

@jd
Copy link
Member

jd commented Oct 11, 2025

The format since to implies you could have multiple source which is weird?

@sileht
Copy link
Member Author

sileht commented Oct 13, 2025

The format since to implies you could have multiple source which is weird?

pydantic ensure you can only have one of them.

I struggle to find something where you define the "source" and the source configuration. An alternative would:

mode: serial
source: files
files:
  python:
    include: ["**/*.py"]
    exclude: ["**/autogenerated/*.py"]
    
    
mode: serial
source: nx
nx:
  command: ...

@jd
Copy link
Member

jd commented Oct 13, 2025

The format since to implies you could have multiple source which is weird?

pydantic ensure you can only have one of them.

I struggle to find something where you define the "source" and the source configuration. An alternative would:

mode: serial
source: files
files:
  python:
    include: ["**/*.py"]
    exclude: ["**/autogenerated/*.py"]
    
    
mode: serial
source: nx
nx:
  command: ...

Nevermind, let's keep it that way.

jd
jd previously approved these changes Oct 13, 2025
Copy link
Member

@jd jd left a comment

Choose a reason for hiding this comment

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

Can we default include to *?

JulianMaurin
JulianMaurin previously approved these changes Oct 13, 2025
This change changes the configuration format to:

```
scopes:
  merge_queue_scope: merge-queue
  mode: parallel
  source:
    files:
      js:
        include:
          - "**/*.js"
      python:
        include:
          - "**/*.py"
      other:
        include:
          - "**/*"
        exclude:
          - "**/*.py"
          - "**/*.js"
```

Sources will later have value like: `bazel`, `nx`, `turporepo`

We will have something like:
```
scopes:
  merge_queue_scope: merge-queue
  mode: parallel
  source:
    nx:
      command: ["npx", "nx"]
```

To get the scopes, this will run: `npx nx show projects --affected --base={base} --head={head}"`

Change-Id: I2e4195e7fc8ce38325b618573456d26b05a57b56
@sileht sileht force-pushed the devs/sileht/scope-config/I2e4195e7fc8ce38325b618573456d26b05a57b56 branch from 661a16e to c370582 Compare October 13, 2025 09:23
@mergify mergify bot dismissed stale reviews from JulianMaurin and jd October 13, 2025 09:24

Pull request has been modified.

@mergify mergify bot deployed to Mergify Merge Protections October 13, 2025 09:24 Active
@mergify mergify bot requested a review from a team October 13, 2025 09:26
@mergify mergify bot merged commit b634077 into main Oct 13, 2025
8 checks passed
@mergify mergify bot deleted the devs/sileht/scope-config/I2e4195e7fc8ce38325b618573456d26b05a57b56 branch October 13, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants