Skip to content

fix(config): support runok.yaml for global config file discovery#141

Merged
fohte merged 2 commits intomainfrom
fohte/fix-runok-yaml-support
Mar 2, 2026
Merged

fix(config): support runok.yaml for global config file discovery#141
fohte merged 2 commits intomainfrom
fohte/fix-runok-yaml-support

Conversation

@fohte
Copy link
Copy Markdown
Owner

@fohte fohte commented Mar 2, 2026

Why

  • Global config path resolution was hardcoded to runok.yml, preventing runok.yaml from being used
    • Project config, local override, and global local override all supported both .yml and .yaml via find_config, but the global main config was inconsistent

What

  • Unify file discovery logic across all four config scopes so global config also falls back to runok.yaml
  • Cover .yml / .yaml support and priority for all scopes in tests

Open with Devin

Global config was hardcoded to `runok.yml` while all other scopes
(project, local override, global local override) supported both
`.yml` and `.yaml` extensions via `find_config`. Unify the file
discovery logic so all four config layers use the same approach.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an inconsistency in how global configuration files are discovered, previously limited to only runok.yml. By unifying the file discovery logic, the system now correctly identifies and prioritizes both .yml and .yaml extensions across all configuration scopes, including global, global local override, project, and project local override. This change enhances flexibility and predictability in configuration management.

Highlights

  • Unified Global Config File Discovery: The configuration loader now consistently supports both runok.yml and runok.yaml for global configuration files, aligning with existing support for other config scopes.
  • Refactored Configuration Loading Logic: The DefaultConfigLoader was refactored to simplify global path handling and introduce a new find_and_parse method, consolidating file discovery and parsing across all configuration layers.
  • Expanded Test Coverage: New and updated test cases explicitly verify .yml and .yaml support and priority for global, global local override, project, and project local override configurations, ensuring robust behavior.
Changelog
  • src/config/loader.rs
    • Refactored DefaultConfigLoader struct to use a single global_dir field, simplifying global path management.
    • Introduced CONFIG_FILENAMES and LOCAL_OVERRIDE_FILENAMES constants to define priority order for config file extensions (.yml then .yaml).
    • Consolidated file finding and parsing into a new find_and_parse helper function.
    • Updated the load method to utilize the new find_and_parse function for all configuration scopes (global, global local override, project, project local override).
    • Modified the TestEnv structure and associated methods to reflect changes in DefaultConfigLoader and simplify test setup.
    • Expanded test suite with rstest cases to thoroughly cover .yml and .yaml support and priority for all config types.
    • Reorganized and updated parse error tests to align with the new loading logic.
Activity
  • fohte created this pull request to address an inconsistency in global configuration file discovery.
  • The pull request includes refactoring of the configuration loader and comprehensive test updates.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively unifies the configuration file discovery logic to support both runok.yml and runok.yaml for the global configuration, making it consistent with other configuration scopes. The refactoring in DefaultConfigLoader simplifies the loading logic by introducing constants for filenames and a new find_and_parse helper function. The test suite has been significantly improved with better organization and expanded coverage for .yml/.yaml variants using rstest, which is great to see.

I have a few suggestions, primarily focused on further improving the tests by reducing duplication, in alignment with the repository's style guide. These changes should enhance the maintainability of the test suite.

Comment thread src/config/loader.rs Outdated
Comment thread src/config/loader.rs Outdated
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

The yml-takes-priority-over-yaml tests for global and project scopes
were duplicated across main config and local override variants.
Combine each pair into a single parameterized test to reduce
duplication, following the project's test style guide.
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.86%. Comparing base (f9d0a5e) to head (1c969ff).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
- Coverage   89.98%   89.86%   -0.13%     
==========================================
  Files          31       31              
  Lines        6469     6391      -78     
==========================================
- Hits         5821     5743      -78     
  Misses        648      648              
Flag Coverage Δ
Linux 89.66% <100.00%> (-0.13%) ⬇️
macOS 91.83% <100.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fohte fohte merged commit b338d30 into main Mar 2, 2026
6 checks passed
@fohte fohte deleted the fohte/fix-runok-yaml-support branch March 2, 2026 15:45
@fohte-bot fohte-bot Bot mentioned this pull request Mar 2, 2026
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.

1 participant