Repository navigation
Conversation
Once per pull request (opened or marked ready), ask a model through the ASF LLM gateway what the change warrants and compare that with what the PR includes: a changelog entry (and its kind) in the solr-operator or solr chart, a chart README row, docs, upgrade notes and tests, plus flags for incomplete CRD options, Solr/Kubernetes version dependencies and missing manual-testing notes. One advisory comment, never a failing check, nothing posted when the model gives no usable answer. Modelled on apache/solr's pr-triage-llm workflow. The judgements encode the feedback contributor PRs to this repository have historically got from reviewers that CI does not catch. The script adds a few generic knobs over Solr's: project context for the prompt, judgements that only apply when certain files change, evidence matched on the PR body, and flag judgements without evidence files. Needs the ASF_LLM_API_KEY repository secret; skips quietly without it.
A table of nine green rows is noise; when nothing needs action, say so in one line naming the checks. The table, with reasons, is kept whenever any row is a mismatch, uncertain or unanswered, and the per-judgement verdicts stay in the JSON result and the step summary.
|
This is the output when run locally against #843 today: 3 possible mismatch(es) between what this change warrants and what the PR includes.
|
dsmiley
left a comment
There was a problem hiding this comment.
Nice! I suggest you incorporate my latest improvements, which reads better and is more compact, plus it runs for each time the PR moves out of draft (simpler & good).
The comment is now a bullet per judgement instead of a table. A row that
agrees with the PR says what the PR has (included, not needed, the
changelog kind, or "no concern" for the flag judgements that have nothing
to compare with) and keeps the model's reason in an HTML comment, visible
only in the Markdown source. A row that disagrees shows what the model
suggests and what the PR has ("suggest added; PR has fixed"), the
confidence when it is below high, and the reason. Unanswered rows read
"Unclear; please assess." The headline, unanswered count and footer
legend are gone, the header reads "Automated PR readiness judgements",
and the assessed commit is a hidden comment. The one-line collapse when
every judgement agrees is kept.
The workflow no longer looks for an earlier triage comment before
judging, so a PR toggled draft -> ready more than once is judged again
and gets a fresh comment. The comment marker and the issues:read
permission go with it; the API key check stays.
Solr's choice_label key is not ported; the changelog kind is shown bare.
Accept the verdict spellings small models produce: "not-worthy" without
the parentheses, "Fixed", a quoted choice. The model answered that way
on this very branch and the valid answer was thrown away as "Unclear".
Presence judgements (docs, upgrade notes, README rows, tests) now only
flag a missing item. An item the author included but the model deems
unnecessary is no longer a mismatch (surplus_ok in the config): extra
tests or notes never hurt, and the flag fired on two of the seven PRs
without being actionable. The changelog keeps both directions.
The Tests question tells the model to judge the code change, not
whether the description says tests were run, and no longer claims that
nothing under hack/ has tests, which flagged this branch's own test
file. Judgement titles are shorter and read well in a bullet
("Operator chart changelog: added", "Version compatibility: no
concern").
A branch far behind its base gets a rebase notice (behind_by is fetched
with the compare API, since the PR object's base.sha is not current),
and docs at paths that no longer exist on main are hidden from the model
without counting as documentation; one stale PR made the model conclude
the docs were already done.
--debug prints the raw reply and token usage to stderr; the workflow
passes it so the job log explains any "Unclear" row.
The dev-docs page is down to what it does, how to run it locally and how to set it up; the judgement table, comment-format walkthrough and security paragraph duplicated the config, the comment itself and the workflow header. The workflow header and the config's _doc key are tightened the same way.
|
PR updated with @dsmiley's latest improvements to the solr workflow. Tuned the assessments on some more read PRs. Here is the new output on the same PR #843 as below (table output): Automated PR readiness judgements (LLM-generated; may be wrong; not updated on later pushes).
|
|
@dsmiley Are you able to add the required secret to this repo the same way you did for solr? |
|
Your updated output isn't as up to date as my latest PR. In particular is the way changelog is handled... whcih should include the word "type: " next to the proposed type. (see that PR) |
|
RE the key, it's simple; I suggest that you do it, not me (I've never touched this repo and it's better to spread the usage amongst us). Go to https://llm.apache.org/ Go and create a key for that model and give it a name to differentiate this key from other keys you might make (e.g. perhaps "SOLR-OPERATOR-PR-TRIAGE"). You'll copy the key itself soon. At the CLI, type: |
A choice judgement can name the value it is about, so the changelog row reads "kind: added" and "suggest kind: fixed; PR has kind: changed" instead of a bare word that means nothing on its own. Both changelog judgements set it to "kind", the field name in Chart.yaml. The label is optional and is left off an agreeing row when the PR has no entry at all, where "not needed" already reads as a sentence.
|
Also backported the Passing:
Recommendation:
|
🤖 AI assisted 🤖
Adds an advisory, LLM-assisted triage comment on pull requests, modelled on Solr's
pr-triage-llm.ymlandjudgements.json, including the bullet comment format from apache/solr#5308.When a PR is opened or a draft is marked ready (not on later pushes), a model behind the ASF LLM gateway (llm.apache.org) is asked what the change warrants, the answers are compared with what the PR includes, and one comment is posted with a bullet per judgement, mismatches marked⚠️ . When everything agrees it collapses to one line (a deliberate difference from Solr). It never fails the check and posts nothing if the model gives no usable answer. Changelog, docs, README and test files are hidden from the model, so it judges the change on its merits rather than noticing what the author added.
What it checks
The judgements in
.github/pr-triage/judgements.jsonencode the feedback contributor PRs here have historically received from reviewers and that CI does not catch. From the review threads of ~45 non-committer PRs the recurring asks were, in order: a changelog entry inhelm/solr-operator/Chart.yaml(by far the most common, also for controller-only changes), a row in the chart README values table, a new CRD field not wired through or not exposed in thesolrchart, tests, Solr 8.11 vs 9.x compatibility, and a note on how the change was tested. Unlike Solr there is no Jira-style judgement.kindartifacthub.io/changesinhelm/solr-operator/Chart.yamlhelm/solr/Chart.yaml(only asked when that chart changed)helm/*/README.md(only when values/templates changed)docs/modules/**docs/modules/upgrade-notes/***_test.go,tests/e2e/**solrchart)trueverdict is the findingFor docs, upgrade notes, README rows and tests only a missing item is flagged; an extra one the model deems unnecessary is not. The changelog also flags a wrong
kindor an entry for a change not worth one.Files
.github/workflows/pr-triage-llm.yaml: Solr's two-job design.pull_request_targetso fork PRs can use the secret; the job holding the key has a read-only token and the job that comments never sees the key. No PR code is checked out or run. Skips quietly when the secret is absent.hack/pr-triage/pr_triage_llm.py: Solr's script plus project context in the system prompt,applies_to,evidence_text, flag judgements without evidence,surplus_ok, tolerant verdict spelling (not-worthy,Fixed), a rebase notice for branches far behindmain, and--debug(the raw model reply in the job log).hack/pr-triage/test_pr_triage_llm.py: 67 offline tests, run fromcheck.yaml.dev-docs/pr-triage-llm.md: what it does, local use, setup. Linked from the README.Trying it on an existing PR
Needs Python 3,
gh,jqand a personal key for llm.apache.org. From this branch:Reasons are HTML-entity escaped on purpose (model text cannot inject links or mentions); GitHub renders them normally. Agreeing bullets keep their reason in an HTML comment, visible only in the Markdown source.
Run on seven open PRs (#888, #877, #846, #844, #764, #722, #854), every⚠️ was a real gap except a debatable
solrchart changelog on #877: for example the missingsolrchart exposure ofhostNamein #764, andsecurityas the changelog kind for #844.Before this is live
ASF_LLM_API_KEY(an automation key from llm.apache.org, via ASF Infra). Optional variableLLM_MODEL.questionwording injudgements.jsonas real comments come in; that is the only knob that usually matters.