-
Notifications
You must be signed in to change notification settings - Fork 11
feat: change configuration file format #813
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
feat: change configuration file format #813
Conversation
There was a problem hiding this 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
modeandmerge_queue_scopeto the scopes configuration - Refactors the
match_scopesfunction 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.
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
|
🧪 CI InsightsHere's what we observed from your CI run for c370582. 🟢 All jobs passed!But CI Insights is watching 👀 |
|
The format since to implies you could have multiple |
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: |
Nevermind, let's keep it that way. |
jd
left a comment
There was a problem hiding this 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 *?
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
661a16e to
c370582
Compare
Pull request has been modified.
This change changes the configuration format to:
Sources will later have value like:
bazel,nx,turporepoWe will have something like:
To get the scopes, this will run:
npx nx show projects --affected --base={base} --head={head}"