Skip to content

LCORE-3141: Docs models are PHONY targets#2225

Merged
tisnik merged 2 commits into
lightspeed-core:mainfrom
tisnik:lcore-3141-docs-models-are-phony-targets
Jul 23, 2026
Merged

LCORE-3141: Docs models are PHONY targets#2225
tisnik merged 2 commits into
lightspeed-core:mainfrom
tisnik:lcore-3141-docs-models-are-phony-targets

Conversation

@tisnik

@tisnik tisnik commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

LCORE-3141: Docs models are PHONY targets

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

  • Assisted-by: N/A
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #LCORE-3141

Summary by CodeRabbit

  • Documentation
    • Updated the model documentation generation workflow to include request, response, common, and database diagrams.
    • Ensured obsolete package diagram output is removed when regenerating model documentation.
    • Improved build target handling for documentation generation.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@tisnik, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 332a49aa-583e-40bf-ba64-e28565413959

📥 Commits

Reviewing files that changed from the base of the PR and between bef849c and bcfdf8c.

📒 Files selected for processing (1)
  • Makefile

Walkthrough

The Makefile marks documentation model targets and generated PlantUML/SVG files as phony, and removes docs/models/packages.puml when generating model documentation.

Changes

Documentation model targets

Layer / File(s) Summary
Phony model generation and cleanup
Makefile
The .PHONY declaration includes documentation model targets and generated outputs, while the docs/models target removes docs/models/packages.puml.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: making docs model targets phony.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Performance And Algorithmic Complexity ✅ Passed No new O(n^2), N+1, loop, cache, or pagination issues; the Makefile change only marks docs-model targets phony and cleans one file.
Security And Secret Handling ✅ Passed PASS: The only changes are Makefile phony target additions and a cleanup rm; no secrets, auth, injection, leaked data, or secret-owner issues.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified 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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 287072e and bef849c.

📒 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)

Comment thread Makefile
Comment on lines +20 to +36
.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

@coderabbitai coderabbitai Bot Jul 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -A6 '^docs/models/(requests|responses|common|database)\.puml:' Makefile

Repository: 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 || true

Repository: 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@coderabbitai create issue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧩 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.

Comment thread Makefile Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@tisnik
tisnik merged commit 95f17db into lightspeed-core:main Jul 23, 2026
31 of 37 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.

1 participant