Skip to content

ci: add LLM review rules - #29950

Merged
BKPepe merged 1 commit into
openwrt:masterfrom
BKPepe:add-llm-rules
Jul 28, 2026
Merged

ci: add LLM review rules#29950
BKPepe merged 1 commit into
openwrt:masterfrom
BKPepe:add-llm-rules

Conversation

@BKPepe

@BKPepe BKPepe commented Jul 9, 2026

Copy link
Copy Markdown
Member

Add .github/llm-review-rules.md to define project-specific patterns and guidelines for the LLM review bot.

Follow-up of #29888 to add review rules.

I took a quick look at it further, and I think there are so many rules. I'm not sure if that's good or not, but maybe... who knows? 🤷 🧙

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit; no new issues found.


Generated by Claude Code

@BKPepe

BKPepe commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@1715173329 What do you think? Is it too strict, or do you have any suggestions on what to add? You previously said I’m a bit of a bully regarding formalities, but since I’m still the only one reviewing PRs here, I want to get it right. It’s a pity no one else is doing them.

@BKPepe
BKPepe requested a review from commodo July 9, 2026 16:29
Comment on lines +70 to +71
PRs targeting `openwrt-NN.NN` branches or titled `[X.Y] ...` are
backports. Their diffs should match the upstream commit on `master`

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.

nitpick: we can have unique minor lts update for stable branches.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok. Added.

- Absolute paths must be used (starting with `/`).
- Directories must end with a trailing slash `/`.
- Individual files must NOT end with a trailing slash.
- No indentation is allowed (do not start lines with spaces or tabs).

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.

add some indentation tips for other recipes? like use 2 spaces for define Package/$(PKG_NAME) and define Package/$(PKG_NAME)/description and tabs for define Build/* / define Package/$(PKG_NAME)/install?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for suggestion. Added. :)

@1715173329

Copy link
Copy Markdown
Member

@1715173329 What do you think?

This looks good overall to me.

Honestly, I'm a lazy guy and I'm not very strict about patch rules. But I guess the same rules are (already) applied to other repos too.
Some patches are OpenWrt-specific hacks, and many of them are really simple, just one or a few lines, so they can be understood at a glance. I don’t really want to write a long description for them. Maybe that's also because of my poor English.

Of course, for complex patches, we should still describe them properly.

You previously said I’m a bit of a bully regarding formalities

On the other hand, I hope we don't get too fixated on CI results, or on making every single check pass. They should be treated more as a reference, since CI can't cover every possible situation, and I don't think we need to follow every CI requirement.

Sometimes contributors' PR may have small formatting issues that could be nitpicked, but I'm still glad to merge them.
For me, in cases like that, the code itself is more important than the formatting.

but since I’m still the only one reviewing PRs here, I want to get it right. It’s a pity no one else is doing them.

As I mentioned above, I'm lazy, so when I see a PR with obvious formatting issues, I'll probably just choose to ignore them.

Since I started working late last year, the time I can spend contributing to the open-source community has decreased significantly. I can no longer spend a whole day here like I used to.
I'm sorry that we've ended up leaving most of the work to you. Hopefully our new members, @GeorgeSapkin and @wehagy, can help share some of the workload.

@ruralroots ruralroots mentioned this pull request Jul 28, 2026
4 tasks
@ruralroots

Copy link
Copy Markdown
Contributor

Possible false positive in the conffiles parser. PR #29343
(net/darkstat) is triggering the following errors:

❌ Package/darkstat/conffiles line 'define Build/Configure' must not
contain any spaces or indentation
❌ Package/darkstat/conffiles line 'define Build/Configure' must be an
absolute path starting with '/'

Raw byte inspection via od -c confirms the conffiles section is
correctly formatted and properly terminated with endef\n\n before
Build/Configure begins. The parser appears to be incorrectly
associating the subsequent Build/Configure block with the conffiles
section.

@BKPepe

BKPepe commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

This is not right pull request. Even bot says what you should do.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit (640f3fd "ci: soften and extend LLM review rules"); its message matches the diff. Two questions inline on the new "Makefile indentation" section, where the stated rule disagrees with dominant in-tree practice.


Generated by Claude Code

Comment thread .github/llm-review-rules.md Outdated
Comment on lines +77 to +79
- **Two spaces** for metadata blocks, whose body is a list of
`KEY:=value` lines: `define Package/<name>`,
`define Package/<name>/config`, `define KernelPackage/<name>`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

define Package/<name>/config doesn't match this bullet on either count: its body is Kconfig syntax (config …, bool "…", depends on …, source "…"), not a list of KEY:=value lines, and in this feed it is predominantly tab-indented — 788 tab-indented body lines across 82 Makefiles vs 220 space-indented across 62, e.g. libs/libtins/Makefile:38-40. A reviewer following this bullet would flag the more common in-tree form as wrong, which is the opposite of what the "only raise indentation on lines the PR actually touches" paragraph is going for. The reviewer feedback that prompted this section only asked about Package/<name>, /description, Build/* and /install. Was including /config here deliberate, or should it move to the tabs bullet (or be left unspecified like /description)?


Generated by Claude Code

Comment thread .github/llm-review-rules.md Outdated
Comment on lines +80 to +83
- **Tabs** for blocks whose body is shell run by make:
`define Build/*` (`Build/Configure`, `Build/Compile`,
`Build/InstallDev`, …), `define Package/<name>/install`, and the
`preinst` / `postinst` / `prerm` / `postrm` scriptlets.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The preinst / postinst / prerm / postrm scriptlets are not recipes, so by the rationale one line above ("make only requires tabs where the block is a recipe") they don't belong in the tabs bullet. They go through BuildPackVariable in include/package-pack.mk:41-47, which echoes the block verbatim into a file — exactly the same mechanism as conffiles (registered a few lines below), which this section correctly describes as taking no indentation. Any leading whitespace simply ends up inside the generated shell script.

In-tree the unindented form dominates for these blocks: 53 Makefiles with unindented scriptlet bodies vs 27 using tabs (455 vs 143 lines), e.g. admin/memtest86plus/Makefile:94-100, where the shebang and body sit at column 0. Should the scriptlets be listed with conffiles under "no indentation" instead?


Generated by Claude Code

Add `.github/llm-review-rules.md` to define project-specific patterns
and guidelines for the LLM review bot, alongside the equivalents in
openwrt/openwrt and openwrt/luci.

The rules cover what the review routine cannot infer from the diff
alone: quilt-managed patch refresh, the generic version check and the
test.sh / test-version.sh overrides, procd init scripts, conffiles
layout, source and mirror macro preferences, and Makefile indentation
per block type.

They also set the review posture. Formatting that changes what gets
built is treated as a defect, while cosmetic style is not worth
blocking a merge over; findings the formality bot already posts are
not repeated; and CI results are a reference rather than a gate.
Patches only need to be upstream-ready when they are candidates for
upstream, since many here are OpenWrt-specific hacks with nowhere to
go. Stable branches may carry a minor LTS update that has no
counterpart on master, so not every stable-branch PR is a cherry-pick.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@BKPepe
BKPepe merged commit 774ec30 into openwrt:master Jul 28, 2026
14 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.

5 participants