Skip to content

Increment logdetective-mcp dependency and revise uv caching - #732

Merged
jpodivin merged 2 commits into
packit:mainfrom
jpodivin:inc_ld_mcp
Aug 11, 2026
Merged

Increment logdetective-mcp dependency and revise uv caching#732
jpodivin merged 2 commits into
packit:mainfrom
jpodivin:inc_ld_mcp

Conversation

@jpodivin

@jpodivin jpodivin commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

While setting logdetective-mcp version to 0.5.0 I've noticed that the cache uv uses for builds may be left in invalid state as the configuration doesn't explicitly consider all requirements files..

By setting the cache-dir value explicitly, we can make sure that uv always picks up changes in global-requirements.txt and other requirements files, preventing dependency conflicts.

PS: I do realize that updating constraint on logdetective-mcp is not strictly necessary, it's just that I like to keep these things explicit.

@qodo-for-packit

Copy link
Copy Markdown

PR Summary by Qodo

Bump logdetective-mcp to 0.5.0 and tie uv cache to requirements

✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Bump logdetective-mcp minimum version to >=0.5.0 across build/test environments.
• Configure uv cache keys to include all requirements files to avoid stale dependency caches.
• Reduce risk of conflicting dependencies when requirements files change.
Diagram

graph TD
  CI["CI / Container build"] --> UV["uv / pip install"] --> Cache[("uv build cache")]
  PyProj["pyproject.toml (uv cache-keys)"] --> UV
  ReqGlobal["requirements-global.txt"] --> UV
  ReqMain["requirements.txt"] --> UV
  ReqCommon["ymir/common/requirements.txt"] --> UV
  ReqTools["ymir/tools/requirements.txt"] --> UV
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Adopt a lockfile-driven workflow (uv.lock / pinned resolutions)
  • ➕ Stronger reproducibility across machines/CI and across time
  • ➕ Reduces dependency drift beyond caching concerns
  • ➖ Higher process overhead (lock updates/reviews) and potential tooling changes in CI
  • ➖ May be a larger change than warranted for this issue
2. Set uv cache behavior via CI/env (e.g., explicit cache dir or disable cache)
  • ➕ Does not require repository config changes
  • ➕ Can be tuned per CI pipeline
  • ➖ More CI-specific and less discoverable than repo configuration
  • ➖ Disabling cache can slow builds; cache-dir alone may not cover invalidation semantics

Recommendation: The chosen approach (declaring uv cache-keys for all requirements files) is the best low-impact fix: it directly addresses stale cache invalidation without changing the dependency workflow. A lockfile-based approach would be more robust long-term, but is a broader decision than this PR’s targeted goal.

Files changed (5) +12 / -4

Other (5) +12 / -4
Containerfile.c9s-testsBump logdetective-mcp minimum version in c9s test image +1/-1

Bump logdetective-mcp minimum version in c9s test image

• Updates the container test environment dependency constraint from logdetective-mcp>=0.2.0 to >=0.5.0 to align with the desired baseline.

Containerfile.c9s-tests

Containerfile.testsBump logdetective-mcp minimum version in tests image +1/-1

Bump logdetective-mcp minimum version in tests image

• Raises the minimum logdetective-mcp version used during test image builds from >=0.2.0 to >=0.5.0.

Containerfile.tests

pyproject.tomlConfigure uv cache keys for all requirements inputs +8/-0

Configure uv cache keys for all requirements inputs

• Adds a [tool.uv] section defining cache-keys for requirements-global.txt and all workspace requirements files. This ensures uv invalidates its cache when any of these inputs change.

pyproject.toml

requirements.txtBump logdetective-mcp minimum version in main requirements +1/-1

Bump logdetective-mcp minimum version in main requirements

• Updates the project dependency constraint to require logdetective-mcp>=0.5.0 instead of >=0.2.0.

requirements.txt

requirements.txtBump logdetective-mcp minimum version in tools requirements +1/-1

Bump logdetective-mcp minimum version in tools requirements

• Aligns tools dependencies by raising the logdetective-mcp constraint from >=0.2.0 to >=0.5.0.

ymir/tools/requirements.txt

@qodo-for-packit

qodo-for-packit Bot commented Aug 4, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Invalid TOML table order ✓ Resolved 🐞 Bug ≡ Correctness
Description
pyproject.toml declares [tool.uv] after [tool.uv.workspace], which is an invalid TOML table
re-declaration pattern and can cause TOML parsers to fail parsing the file. This can break tooling
that reads pyproject.toml (e.g., scripts/autobump-version.py uses tomlkit to load it).
Code

pyproject.toml[R39-41]

+[tool.uv]
+cache-keys = [
+    { file = "requirements-global.txt" },
Relevance

●●● Strong

Likely treated as real breakage risk: invalid config ordering can make tooling fail to parse
pyproject.toml.

PR-#671
PR-#488

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The file declares [tool.uv.workspace] first and then adds a new [tool.uv] table, which is the
invalid parent-after-child pattern. The repo contains automation that parses pyproject.toml using
tomlkit.loads, so a TOML parse error would break that workflow.

pyproject.toml[36-49]
scripts/autobump-version.py[65-75]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`pyproject.toml` currently declares the subtable `[tool.uv.workspace]` and then later declares the parent table `[tool.uv]`. In TOML, declaring a subtable implicitly creates its parent, so later declaring the parent table is treated as a re-declaration and can fail parsing.

## Issue Context
This can break any tooling that parses `pyproject.toml` with a standards-compliant TOML parser (including repo automation like `scripts/autobump-version.py`, which calls `tomlkit.loads(...)` on the file).

## Fix
Move the `[tool.uv]` table (and its `cache-keys`) to appear *before* any `[tool.uv.*]` subtables (e.g., above `[tool.uv.workspace]`). Keep `[tool.uv.workspace]` and `[tool.uv.sources]` as subtables after the parent.

## Fix Focus Areas
- pyproject.toml[36-49]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 7 rules

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread pyproject.toml
@jpodivin
jpodivin force-pushed the inc_ld_mcp branch 2 times, most recently from 35c61c5 to 89f3dde Compare August 4, 2026 10:59

@majamassarini majamassarini left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
@jpodivin
jpodivin merged commit b2db1d4 into packit:main Aug 11, 2026
11 checks passed
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.

3 participants