Skip to content

fix: preserve QWeather allergen index defaults - #47

Merged
IceCodeNew merged 1 commit into
masterfrom
codex/fix-qweather-example-indices
Jul 16, 2026
Merged

fix: preserve QWeather allergen index defaults#47
IceCodeNew merged 1 commit into
masterfrom
codex/fix-qweather-example-indices

Conversation

@IceCodeNew

@IceCodeNew IceCodeNew commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • include QWeather lifestyle index type 7 in env.example
  • verify the public environment example preserves the reference-data defaults

Why

Copying the previous example overrode the application default and silently removed the QWeather allergen index used by forecast advice.

Validation

  • mise exec -- uv run pytest tests/test_config.py -q (103 passed)
  • mise exec -- uv run --with pytest --with pytest-cov -- pytest --cov --cov-branch --cov-report=xml (592 passed; 15 misses, 7 partial branches)
  • prek run --all-files

Summary by CodeRabbit

  • Configuration

    • Updated the default weather index configuration to include an additional index type.
  • Tests

    • Added coverage to verify that the example environment configuration preserves the expected default weather index values.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ee11c2b5-e8e1-4e40-b077-907341ec7700

📥 Commits

Reviewing files that changed from the base of the PR and between 44248a3 and 9340bc8.

📒 Files selected for processing (2)
  • env.example
  • tests/test_config.py

📝 Walkthrough

Walkthrough

The example environment adds QWeather index type 7. A configuration test now verifies that the comma-separated environment value matches the corresponding provider defaults.

Changes

QWeather index defaults

Layer / File(s) Summary
Update and validate QWeather index defaults
env.example, tests/test_config.py
QWEATHER_INDEX_TYPES includes 7, and a test parses the value and compares it with the provider_defaults.json default tuple.

Estimated code review effort: 2 (Simple) | ~5 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-qweather-example-indices

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@IceCodeNew
IceCodeNew requested a review from Copilot July 16, 2026 18:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.64%. Comparing base (44248a3) to head (9340bc8).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #47   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files          38       38           
  Lines        6210     6216    +6     
  Branches      341      341           
=======================================
+ Hits         6188     6194    +6     
  Misses         15       15           
  Partials        7        7           

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

@IceCodeNew

Copy link
Copy Markdown
Owner Author

/agentic_review

1 similar comment
@IceCodeNew

Copy link
Copy Markdown
Owner Author

/agentic_review

@IceCodeNew
IceCodeNew marked this pull request as ready for review July 16, 2026 18:26
@IceCodeNew
IceCodeNew merged commit 3c5e47f into master Jul 16, 2026
23 of 24 checks passed
@IceCodeNew
IceCodeNew deleted the codex/fix-qweather-example-indices branch July 16, 2026 18:26
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Preserve QWeather allergen index defaults in env.example

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Add QWeather lifestyle index type 7 to the public env.example.
• Add a regression test ensuring env.example matches reference default indices.
• Prevent env.example from silently overriding the app’s provider defaults.
Diagram

graph TD
  A["env.example"] --> B["Settings loader"] --> C[("Provider defaults")]
  B --> D["QWeather indices"] --> E["Forecast advice"]
  F["tests/test_config.py"] --> G["Regression test"] --> A
  G --> C

  subgraph Legend
    direction LR
    _file["File"] ~~~ _code["Code"] ~~~ _db[("Reference data")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Remove QWEATHER_INDEX_TYPES from env.example
  • ➕ Avoids any chance of env.example overriding app defaults
  • ➕ Reduces the need to keep example values in sync with reference data
  • ➖ Less discoverable for users who want to explicitly configure index types
  • ➖ Example becomes less illustrative of supported configuration
2. Generate env.example from reference defaults (script/CI check)
  • ➕ Eliminates drift between example config and reference-data defaults
  • ➕ Makes future default changes automatically reflected in env.example
  • ➖ Adds tooling/CI complexity for a small repository surface area
  • ➖ Requires deciding how to merge generated vs hand-written commentary

Recommendation: Current approach is appropriate: keep env.example explicit and add a regression test that enforces parity with reference defaults. If drift becomes a recurring issue, consider generating env.example (or at least CI-validating it) from provider_defaults.json.

Files changed (2) +13 / -1

Bug fix (1) +1 / -1
env.exampleAdd QWeather lifestyle index type 7 to default example indices +1/-1

Add QWeather lifestyle index type 7 to default example indices

• Updates QWEATHER_INDEX_TYPES to include type 7 so the example configuration preserves the allergen index relied on by forecast advice. Prevents the example file from unintentionally overriding the application’s reference defaults.

env.example

Tests (1) +12 / -0
test_config.pyRegression test: env.example must match reference default QWeather indices +12/-0

Regression test: env.example must match reference default QWeather indices

• Adds a test that loads env.example via dotenv and asserts QWEATHER_INDEX_TYPES equals the reference-data default tuple. This guards against future example edits silently changing provider defaults.

tests/test_config.py

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants