Skip to content

Scopes#179

Open
philocalyst wants to merge 31 commits into
cococonscious:mainfrom
philocalyst:scopes
Open

Scopes#179
philocalyst wants to merge 31 commits into
cococonscious:mainfrom
philocalyst:scopes

Conversation

@philocalyst
Copy link
Copy Markdown
Contributor

No description provided.

philocalyst and others added 18 commits December 10, 2025 10:13
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/cache](https://redirect.github.com/actions/cache) | action |
major | `v4.3.0` -> `v5.0.1` |

---

### Release Notes

<details>
<summary>actions/cache (actions/cache)</summary>

###
[`v5.0.1`](https://redirect.github.com/actions/cache/compare/v5.0.0...v5.0.1)

[Compare
Source](https://redirect.github.com/actions/cache/compare/v5.0.0...v5.0.1)

###
[`v5.0.0`](https://redirect.github.com/actions/cache/compare/v4.3.0...v5.0.0)

[Compare
Source](https://redirect.github.com/actions/cache/compare/v4.3.0...v5.0.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on
Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule
defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/cococonscious/koji).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi40Mi4yIiwidXBkYXRlZEluVmVyIjoiNDIuNDIuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…us#165)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[codecov/codecov-action](https://redirect.github.com/codecov/codecov-action)
| action | patch | `v5.5.1` -> `v5.5.2` |

---

### Release Notes

<details>
<summary>codecov/codecov-action (codecov/codecov-action)</summary>

###
[`v5.5.2`](https://redirect.github.com/codecov/codecov-action/blob/HEAD/CHANGELOG.md#v552)

[Compare
Source](https://redirect.github.com/codecov/codecov-action/compare/v5.5.1...v5.5.2)

##### What's Changed

**Full Changelog**:
<https://github.com/codecov/codecov-action/compare/v5.5.1..v5.5.2>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on
Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule
defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/cococonscious/koji).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi40Mi4yIiwidXBkYXRlZEluVmVyIjoiNDIuNDIuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/checkout](https://redirect.github.com/actions/checkout) |
action | patch | `v6.0.0` -> `v6.0.1` |

---

### Release Notes

<details>
<summary>actions/checkout (actions/checkout)</summary>

###
[`v6.0.1`](https://redirect.github.com/actions/checkout/compare/v6.0.0...v6.0.1)

[Compare
Source](https://redirect.github.com/actions/checkout/compare/v6.0.0...v6.0.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on
Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule
defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/cococonscious/koji).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4zMi4yIiwidXBkYXRlZEluVmVyIjoiNDIuMzIuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Multiple macOS versions as a requirement to eventually have koji in
homebrew-core
Keeping cocogitto for the commits for now but uses Gix for traversal, etc., and at some point, when Gix is ready, replace cocogitto with it.
@cococonscious
Copy link
Copy Markdown
Owner

cococonscious commented Feb 25, 2026

Besides the conflicts, make sure to consider my comment in the previous PR: #161 (comment) and imo it should also be possible to configure to force the use of the configured scopes or not (and with that if an empty scope is allowed or not)

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/lib/questions.rs 84.44% 14 Missing ⚠️
src/lib/scope.rs 91.89% 9 Missing ⚠️
src/lib/config.rs 90.90% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/lib/config.rs 95.52% <90.90%> (-4.48%) ⬇️
src/lib/scope.rs 91.89% <91.89%> (ø)
src/lib/questions.rs 92.09% <84.44%> (-5.25%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Owner

@cococonscious cococonscious left a comment

Choose a reason for hiding this comment

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

Looks good besides the review comment, also, I have two other points to consider:

  • The force_scope config key naming is a bit misleading, I think a more accurate name would be force_config_scopes
  • We should show the configured scope description in the selection prompt, not only because it's otherwise obsolete but also to differentiate from the detected scopes

Comment thread src/lib/questions.rs Outdated
@philocalyst
Copy link
Copy Markdown
Contributor Author

philocalyst commented Mar 11, 2026 via email

@cococonscious
Copy link
Copy Markdown
Owner

I understand your point about the scoping of the config property, and it does make sense, but it's a bit confusing because "force scope" could be misunderstood as "you must specify a scope" (which the other variable is for so it is understandable, yes, but it does require an extra thinking step).

Thanks for the changes. I did find a bug though, when setting the following: force_scope = false and allow_empty_scope = false, hitting <Esc> will just continue instead of throwing like when force_scope = true.

Also, I find it hard to justify adding another error handling dependency, could we not either replace everything with thiserror or implement your changes in anyhow?

Lastly, the descriptions of the commit scopes defined in the config are still not visible.

Thanks,
Finley

@philocalyst
Copy link
Copy Markdown
Contributor Author

philocalyst commented Mar 14, 2026 via email

@cococonscious
Copy link
Copy Markdown
Owner

I think if we want to move to stronger error handling, the answer is 100% thiserror!! ... I could start a separate PR that adds that to merge before this one so consistency stays.

Yes, please! That would be great.

The other thing we could consider is Ariadne or Miette, ...

While they look great, I think they're overkill for the simple errors that are common in koji, unless you disagree...

I also was thinking that globbing would pair nicely with this scope configuration, ...

Sorry, I'm a bit lost on what exactly you mean by this, could you give me a concrete example?

@philocalyst
Copy link
Copy Markdown
Contributor Author

philocalyst commented Mar 17, 2026 via email

@philocalyst
Copy link
Copy Markdown
Contributor Author

Following up @cococonscious

@cococonscious
Copy link
Copy Markdown
Owner

Sorry @philocalyst for the delayed answer.

I think that's a great idea, especially if we use a regex implementation instead of arrays.

How would we handle precedence? In your example, if both "flake.nix" and "build.rs" are modified, would "flakes" or "build" be the chosen scope (if any)?

@philocalyst
Copy link
Copy Markdown
Contributor Author

The thing about working on a tool for commits is that you develop standards just by making ergonomic decisions like this. I personally lean towards the atomic commit model, so my answer is "neither" as I believe any situation where you need to make that cross cutting change should be grouped into a PR.

If that's something you agree with, that can be the stance, but long-term we may need to adopt a particular committing philosphy as to not grow too complex.

@philocalyst
Copy link
Copy Markdown
Contributor Author

Regex is also a great idea, in that we could use the implementation of ast-grep to both match on filenames and on code structure. Then you could do things like "if this modified function holds the test annotation, mark its scope as test".

Which is very exciting and a fair bit more technical, but I believe personally do-able. I volunteer it really because it differentiates Koji and uses ast-grep in a creative way (I find it difficult to use practically otherwise, despite how capable it is)

@philocalyst
Copy link
Copy Markdown
Contributor Author

We could use ast_greps YAML input (Appropriated to TOML of course), which I found when researching -- it makes incorporating this feel very "right" with the current config structure :)))

@cococonscious
Copy link
Copy Markdown
Owner

I agree with you on the atomic commits, although I suspect that in reality most people using koji will not fully adopt that philosophy, so your (great) idea about using ast-grep might not work as expected for everyone. I think it would be an awesome addition, but it should be gated behind a feature flag for now, until we get some experience and user reports about how they use and like it. The regex config approach can be in the default feature-set though. If you're willing to, please do implement both 🥇
I'll try to review it faster than I've been replying in this thread, promise :)

@philocalyst
Copy link
Copy Markdown
Contributor Author

Feeling a lot better about this! @cococonscious

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