LCORE-3141: Docs models are PHONY targets#2225
Conversation
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe Makefile marks documentation model targets and generated PlantUML/SVG files as phony, and removes ChangesDocumentation model targets
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Makefile`:
- Line 212: Update the cleanup command in the docs/models target to use forceful
removal for docs/models/packages.puml, so the target succeeds whether or not the
generated file exists.
- Around line 20-36: Update the docs/models generation targets and their
pyreverse output handling so parallel make execution cannot share or overwrite
docs/models/classes.puml. Either serialize the four .puml targets through an
explicit dependency chain or run each pyreverse invocation in an isolated
temporary directory before moving its result to the intended target, preserving
the existing generated filenames.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 76a65a0f-40ee-41f5-8e67-44af37c8696f
📒 Files selected for processing (1)
Makefile
📜 Review details
⏰ Context from checks skipped due to timeout. (20)
- GitHub Check: bandit
- GitHub Check: build-pr
- GitHub Check: integration_tests (3.13)
- GitHub Check: integration_tests (3.12)
- GitHub Check: unit_tests (3.13)
- GitHub Check: radon
- GitHub Check: unit_tests (3.12)
- GitHub Check: Pylinter
- GitHub Check: Pyright
- GitHub Check: shellcheck
- GitHub Check: spectral
- GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-7-on-pull-request
- GitHub Check: E2E: server mode / ci / group 2
- GitHub Check: check
- GitHub Check: E2E Tests for Lightspeed Evaluation job
- GitHub Check: E2E: server mode / ci / group 1
- GitHub Check: E2E: library mode / ci / group 3
- GitHub Check: E2E: library mode / ci / group 2
- GitHub Check: E2E: library mode / ci / group 1
- GitHub Check: E2E: server mode / ci / group 3
🧰 Additional context used
📓 Path-based instructions (1)
**/*
📄 CodeRabbit inference engine (Custom checks)
**/*: Flag meaningful O(n^2)+ algorithms on non-trivial inputs, including handlers and Kubernetes list operations.
Flag N+1 patterns that list items and then query once per item, including Kubernetes API and database access.
Flag expensive work inside loops, including API calls, JSON parsing, and regex compilation.
Flag unbounded growth in caches, watchers, or buffers when eviction or limits are missing.
Flag missing pagination or limits on list operations and API endpoints.
Flag secrets or tokens logged in plaintext or hardcoded in source.
Flag API endpoints missing authentication or authorization.
Flag injection vulnerabilities, including SQL injection, command injection, and path traversal.
Flag sensitive data leaked in API responses, WebSocket messages, or logs.
Flag Kubernetes Secrets and Red Hat secrets missing OwnerReferences.Never commit secrets or keys; use environment variables for sensitive data.
Files:
Makefile
🪛 checkmake (0.3.2)
Makefile
[warning] 21-21: Required target "all" is missing from the Makefile.
(minphony)
[warning] 21-21: Required target "clean" is missing from the Makefile.
(minphony)
[warning] 21-21: Required target "test" is missing from the Makefile.
(minphony)
| .PHONY: run \ | ||
| run-stack \ | ||
| build-llama-stack-image \ | ||
| remove-llama-stack-container \ | ||
| stop-llama-stack-container \ | ||
| start-llama-stack-container \ | ||
| wait-for-llama-stack-health \ | ||
| clean-llama-stack \ | ||
| docs/models \ | ||
| docs/models/requests.puml \ | ||
| docs/models/responses.puml \ | ||
| docs/models/common.puml \ | ||
| docs/models/database.puml \ | ||
| docs/models/requests.svg \ | ||
| docs/models/responses.svg \ | ||
| docs/models/common.svg \ | ||
| docs/models/database.svg |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n -A6 '^docs/models/(requests|responses|common|database)\.puml:' MakefileRepository: lightspeed-core/lightspeed-stack
Length of output: 1352
🏁 Script executed:
#!/bin/bash
set -u
echo "== Makefile relevant section =="
sed -n '1,45p;200,255p' Makefile
echo
echo "== all docs/models model generator lines =="
rg -n -A6 '^docs/models/(requests|responses|common|database)\.puml:' Makefile
echo
echo "== shared outputs in Makefile =="
rg -n -E 'docs/models/(classes|packages)\.puml|docs/models/classes\.puml|docs/models/packages\.puml' Makefile || trueRepository: lightspeed-core/lightspeed-stack
Length of output: 5617
Avoid reusing shared model-generation output files.
All four docs/models/*.puml targets are phony, so make -j docs/models can run them concurrently while each pyreverse invocation writes into the same docs/models/classes.puml before moving it to its final name. Serialize the targets or generate each model in an isolated temporary directory so generated diagrams cannot be overwritten or mismatched.
🧰 Tools
🪛 checkmake (0.3.2)
[warning] 21-21: Required target "all" is missing from the Makefile.
(minphony)
[warning] 21-21: Required target "clean" is missing from the Makefile.
(minphony)
[warning] 21-21: Required target "test" is missing from the Makefile.
(minphony)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Makefile` around lines 20 - 36, Update the docs/models generation targets and
their pyreverse output handling so parallel make execution cannot share or
overwrite docs/models/classes.puml. Either serialize the four .puml targets
through an explicit dependency chain or run each pyreverse invocation in an
isolated temporary directory before moving its result to the intended target,
preserving the existing generated filenames.
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
repo="lightspeed-core/lightspeed-stack"
title="Prevent parallel docs model generation from overwriting shared output"
body=$(cat <<'EOF'
## Summary
`make -j docs/models` can execute the phony PlantUML model targets concurrently. Each underlying `pyreverse` command writes its intermediate result to the same `docs/models/classes.puml` path before it is renamed, so diagrams can be overwritten, mismatched, or cause a target to fail.
## Required changes
Update the documentation model generation rules in `Makefile` so each of these targets has isolated intermediate output or is explicitly serialized:
- `docs/models/requests.puml`
- `docs/models/responses.puml`
- `docs/models/common.puml`
- `docs/models/database.puml`
Preserve the existing final generated filenames and the existing `docs/models` interface.
## Rationale
The model targets are declared `.PHONY`, which allows GNU Make to schedule them in parallel. Sharing `docs/models/classes.puml` makes the recipes unsafe under parallel execution.
## Affected area
- `Makefile` documentation model-generation targets
## Acceptance criteria
- Running `make -j docs/models` does not share or overwrite an intermediate `classes.puml` file between targets.
- Each target produces its matching final `.puml` diagram.
- The target behavior remains compatible with the SVG generation targets.
## Backlinks
- Reported from PR `#2225`: https://github.com/lightspeed-core/lightspeed-stack/pull/2225
- Review comment: https://github.com/lightspeed-core/lightspeed-stack/pull/2225#discussion_r3636257133
- Requested by `@tisnik`.
EOF
)
gh issue create \
--repo "$repo" \
--title "$title" \
--body "$body" \
--assignee "tisnik"Length of output: 1916
@tisnik, created follow-up issue #2227: Prevent parallel docs model generation from overwriting shared output. It includes the PR and review-comment backlinks, required changes, and acceptance criteria.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Description
LCORE-3141: Docs models are PHONY targets
Type of change
Tools used to create PR
Related Tickets & Documents
Summary by CodeRabbit