coderabbit: T8851: add .coderabbit.yaml for central-config inheritance - #1197
Conversation
|
👍 |
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds ChangesCodeRabbit Configuration Baseline
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ 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 |
|
@copilot review |
The
No issues found. |
a5fe33a to
db577ac
Compare
db577ac to
2f8207d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 @.coderabbit.yaml:
- Line 1: The repo's .coderabbit.yaml references schema.v2.json but the file
(and the central baseline) lack v2's required top-level keys (e.g., language,
tone_instructions, early_access, enable_free_tier, reviews, chat,
code_generation, issue_enrichment), so validation fails; fix by either switching
the schema URL to the compatible version (e.g., a v1 schema) or by adding the
missing required top-level properties to .coderabbit.yaml (populate language,
tone_instructions, early_access, enable_free_tier, reviews, chat,
code_generation, issue_enrichment with sensible defaults) so the file conforms
to schema.v2.json and the validator accepts overrides like inheritance and
knowledge_base.jira.project_keys.
🪄 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: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: b5d8fe96-bcce-40a0-9d97-6464ec48918b
📒 Files selected for processing (1)
.coderabbit.yaml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build_iso
- GitHub Check: codeql-analysis-call / Analyze (python)
- GitHub Check: Mergify Merge Queue
- GitHub Check: Mergify Merge Protections
- GitHub Check: Summary
🔇 Additional comments (1)
.coderabbit.yaml (1)
16-20: LGTM!
| @@ -0,0 +1,29 @@ | |||
| # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json | |||
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify schema URL is accessible and retrieve schema for validation
# Check if schema URL is accessible
echo "Checking schema URL accessibility..."
curl -sf -o /tmp/coderabbit-schema.json "https://coderabbit.ai/integrations/schema.v2.json"
if [ $? -eq 0 ]; then
echo "✓ Schema URL is accessible"
echo ""
echo "Schema properties (top-level keys):"
jq 'keys' /tmp/coderabbit-schema.json 2>/dev/null || echo "Failed to parse JSON"
echo ""
echo "Checking if 'inheritance' is documented:"
jq '.properties.inheritance // "NOT FOUND"' /tmp/coderabbit-schema.json 2>/dev/null
echo ""
echo "Checking if 'knowledge_base' is documented:"
jq '.properties.knowledge_base // "NOT FOUND"' /tmp/coderabbit-schema.json 2>/dev/null
else
echo "✗ Schema URL is not accessible"
exit 1
fiRepository: vyos/vyos-build
Length of output: 268
🏁 Script executed:
#!/bin/bash
set -euo pipefail
SCHEMA_URL="https://coderabbit.ai/integrations/schema.v2.json"
SCHEMA_PATH="/tmp/coderabbit-schema.json"
echo "== Fetch headers =="
curl -sSI "$SCHEMA_URL" | sed -n '1,20p'
echo "== Download schema =="
curl -sSLf "$SCHEMA_URL" -o "$SCHEMA_PATH"
echo "Saved: $SCHEMA_PATH ($(wc -c < "$SCHEMA_PATH") bytes)"
echo "== First bytes (debug) =="
head -c 300 "$SCHEMA_PATH" | cat -v; echo
echo
echo "== Parse + inspect schema =="
python3 - <<'PY'
import json,sys
path="/tmp/coderabbit-schema.json"
with open(path,'r',encoding='utf-8') as f:
try:
data=json.load(f)
except Exception as e:
print("JSON parse failed:",repr(e))
sys.exit(2)
print("Top-level keys:",sorted(list(data.keys())))
props=data.get("properties",{})
print("Has properties:",isinstance(props,dict))
for k in ["inheritance","knowledge_base"]:
print(f"properties.{k} exists:", k in props)
kb=props.get("knowledge_base",{})
print("knowledge_base type:", kb.get("type"))
print("knowledge_base subkeys:", sorted(list(kb.get("properties",{}).keys())) if isinstance(kb.get("properties"),dict) else None)
PY
echo "== Inspect .coderabbit.yaml =="
python3 - <<'PY'
import yaml,json
from pathlib import Path
p=Path(".coderabbit.yaml")
data=yaml.safe_load(p.read_text(encoding="utf-8"))
print("Loaded YAML type:",type(data))
print("Top-level keys:",sorted(data.keys()))
print("inheritance:",data.get("inheritance"))
kb=data.get("knowledge_base",{})
print("knowledge_base keys:", sorted(kb.keys()))
print("knowledge_base.jira:", kb.get("jira"))
PYRepository: vyos/vyos-build
Length of output: 1351
🏁 Script executed:
#!/bin/bash
set -euo pipefail
SCHEMA_URL="https://coderabbit.ai/integrations/schema.v2.json"
SCHEMA_PATH="/tmp/coderabbit-schema.json"
curl -sSLf "$SCHEMA_URL" -o "$SCHEMA_PATH"
python3 - <<'PY'
import yaml, json, sys, subprocess
# Ensure jsonschema is available
try:
import jsonschema
except Exception:
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "jsonschema"])
import jsonschema
schema_path="/tmp/coderabbit-schema.json"
with open(schema_path, "r", encoding="utf-8") as f:
schema=json.load(f)
with open(".coderabbit.yaml","r",encoding="utf-8") as f:
cfg=yaml.safe_load(f)
# Draft 2020-12 is declared in schema
resolver=jsonschema.RefResolver.from_schema(schema)
validator=jsonschema.Draft202012Validator(schema, resolver=resolver)
errors=sorted(validator.iter_errors(cfg), key=lambda e: e.path)
if not errors:
print("YAML config validates against schema.v2.json: OK")
sys.exit(0)
print("YAML config validation errors:")
for e in errors[:50]:
path="/".join(str(p) for p in e.path)
print(f"- path={path or '<root>'}: {e.message}")
print(f"Total errors: {len(errors)}")
sys.exit(2)
PYRepository: vyos/vyos-build
Length of output: 960
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== .coderabbit.yaml =="
nl -ba .coderabbit.yaml | sed -n '1,200p'
echo
echo "== Schema required list + relevant inheritance logic =="
python3 - <<'PY'
import json,re
schema_path="/tmp/coderabbit-schema.json"
with open(schema_path,'r',encoding='utf-8') as f:
s=json.load(f)
print("required:", s.get("required"))
text=json.dumps(s)
print("contains 'inheritance':", "inheritance" in text)
# Print any top-level/conditional logic mentioning inheritance or allOf/anyOf/if/then/oneOf
for kw in ["allOf","anyOf","oneOf","if","then","else","not"]:
if kw in s:
print("top-level has",kw)
# Search for inheritance in conditions-ish areas
m=re.findall(r'(?i).{0,80}"inheritance".{0,80}', text)
print("inheritance context snippets:", len(m))
for snip in m[:5]:
print("-", snip)
PYRepository: vyos/vyos-build
Length of output: 143
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
p=Path(".coderabbit.yaml")
lines=p.read_text(encoding="utf-8").splitlines()
for i,l in enumerate(lines,1):
print(f"{i:4d}\t{l}")
PY
echo
echo "== Schema required list =="
python3 - <<'PY'
import json
s=json.load(open("/tmp/coderabbit-schema.json","r",encoding="utf-8"))
req=s.get("required",[])
print(req)
PY
echo
echo "== Schema: inheritance-related snippets (first 30 hits) =="
python3 - <<'PY'
import json,re
s=json.load(open("/tmp/coderabbit-schema.json","r",encoding="utf-8"))
text=json.dumps(s)
hits=[]
for m in re.finditer(r'(.{0,60}"inheritance".{0,60})', text):
hits.append(m.group(1))
for h in hits[:30]:
print("-",h)
print("Total hits:",len(hits))
PYRepository: vyos/vyos-build
Length of output: 2037
🏁 Script executed:
#!/bin/bash
set -euo pipefail
SCHEMA_URL="https://coderabbit.ai/integrations/schema.v2.json"
SCHEMA_PATH="/tmp/coderabbit-schema.json"
BASELINE_URL="https://raw.githubusercontent.com/vyos/coderabbit/production/.coderabbit.yaml"
BASELINE_PATH="/tmp/coderabbit-baseline.yaml"
curl -sSLf "$SCHEMA_URL" -o "$SCHEMA_PATH"
curl -sSLf "$BASELINE_URL" -o "$BASELINE_PATH"
python3 - <<'PY'
import yaml, json, sys, copy
import jsonschema
def deep_merge(a,b):
# b overrides a; dicts merge recursively; other types/arrays replaced
if isinstance(a, dict) and isinstance(b, dict):
out = dict(a)
for k,v in b.items():
out[k] = deep_merge(out.get(k), v) if k in out else copy.deepcopy(v)
return out
return copy.deepcopy(b)
schema_path="/tmp/coderabbit-schema.json"
baseline_path="/tmp/coderabbit-baseline.yaml"
override_path=".coderabbit.yaml"
schema=json.load(open(schema_path,"r",encoding="utf-8"))
baseline=yaml.safe_load(open(baseline_path,"r",encoding="utf-8"))
override=yaml.safe_load(open(override_path,"r",encoding="utf-8"))
merged=deep_merge(baseline, override)
validator=jsonschema.Draft202012Validator(schema)
def validate(label,cfg):
errs=sorted(validator.iter_errors(cfg), key=lambda e: list(e.path))
print(f"\n== {label} ==")
print("Top-level keys:", sorted(cfg.keys()))
if not errs:
print("Schema validation: OK")
return
print("Schema validation errors (first 20):")
for e in errs[:20]:
p="/".join(str(x) for x in e.path) if e.path else "<root>"
print(f"- path={p}: {e.message}")
print("Total errors:",len(errs))
validate("override-only (.coderabbit.yaml)", override)
validate("baseline+override (deep-merged)", merged)
# Print Jira project key constraints if present
kb_jira = schema.get("properties",{}).get("knowledge_base",{}).get("properties",{}).get("jira",{})
pj = kb_jira.get("properties",{}).get("project_keys",{})
print("\n== Schema constraints (knowledge_base.jira.project_keys) ==")
print("project_keys schema:", {k:pj[k] for k in pj.keys() if k in ["type","items","minItems","maxItems","pattern","minLength","maxLength"]} )
PYRepository: vyos/vyos-build
Length of output: 1134
🏁 Script executed:
#!/bin/bash
set -euo pipefail
SCHEMA_URL="https://coderabbit.ai/integrations/schema.v2.json"
SCHEMA_PATH="/tmp/coderabbit-schema.json"
BASELINE_URL="https://raw.githubusercontent.com/vyos/coderabbit/production/.coderabbit.yaml"
BASELINE_PATH="/tmp/coderabbit-baseline.yaml"
curl -sSLf "$SCHEMA_URL" -o "$SCHEMA_PATH"
curl -sSLf "$BASELINE_URL" -o "$BASELINE_PATH"
python3 - <<'PY'
import yaml, json, sys
import jsonschema
schema=json.load(open("/tmp/coderabbit-schema.json","r",encoding="utf-8"))
baseline=yaml.safe_load(open("/tmp/coderabbit-baseline.yaml","r",encoding="utf-8"))
override=yaml.safe_load(open(".coderabbit.yaml","r",encoding="utf-8"))
print("== baseline top-level keys ==")
print(sorted(baseline.keys()))
print("baseline missing required:",
[k for k in schema.get("required",[]) if k not in baseline])
print("\n== override top-level keys ==")
print(sorted(override.keys()))
print("override missing required:",
[k for k in schema.get("required",[]) if k not in override])
# Validate baseline and override separately
validator=jsonschema.Draft202012Validator(schema)
def validate(label,cfg):
errs=list(validator.iter_errors(cfg))
errs=sorted(errs, key=lambda e: list(e.path))
print(f"\n== validate {label} ==")
if not errs:
print("OK")
return
print("Errors:")
for e in errs[:20]:
p="/".join(str(x) for x in e.path) if e.path else "<root>"
print(f"- path={p}: {e.message}")
print("Total errors:",len(errs))
validate("baseline-only", baseline)
validate("override-only", override)
PYRepository: vyos/vyos-build
Length of output: 1199
Schema URL is reachable, but schema.v2.json doesn’t match the repo/org config shape.
vyos/vyos-build/.coderabbit.yaml (lines 1-29) references https://coderabbit.ai/integrations/schema.v2.json; the endpoint is accessible and returns valid JSON (via a 301 redirect to https://www.coderabbit.ai/integrations/schema.v2.json). However, schema.v2.json marks top-level keys like language, tone_instructions, early_access, enable_free_tier, reviews, chat, code_generation, and issue_enrichment as required, and both:
- the repo override (
inheritance+knowledge_baseonly), and - the referenced central baseline (
https://raw.githubusercontent.com/vyos/coderabbit/production/.coderabbit.yaml)
fail validation for those missing required properties. This means the schema URL/version is reachable, but the v2 schema doesn’t appear to be compatible with the actual baseline/override files currently used here—so value-level checks likeknowledge_base.jira.usage: autoandproject_keys: ['VD']can’t be trusted to be schema-valid based solely on this endpoint.
🤖 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 @.coderabbit.yaml at line 1, The repo's .coderabbit.yaml references
schema.v2.json but the file (and the central baseline) lack v2's required
top-level keys (e.g., language, tone_instructions, early_access,
enable_free_tier, reviews, chat, code_generation, issue_enrichment), so
validation fails; fix by either switching the schema URL to the compatible
version (e.g., a v1 schema) or by adding the missing required top-level
properties to .coderabbit.yaml (populate language, tone_instructions,
early_access, enable_free_tier, reviews, chat, code_generation, issue_enrichment
with sensible defaults) so the file conforms to schema.v2.json and the validator
accepts overrides like inheritance and knowledge_base.jira.project_keys.
|
CI integration 👍 passed! Details
|
Adds a minimal
.coderabbit.yamlso this repo joins the CodeRabbit central-configuration inheritance chain (per T8851 / IS-430).The file inherits the org-level baseline at vyos/coderabbit (loaded automatically because the central repo is named
coderabbitunder the same GitHub org) and only sets:inheritance: true— required, otherwise the per-repo file would silently replace the central baseline instead of merging per-field on top of it.knowledge_base.jirablock — scopes CodeRabbit's Jira-context lookups to a specific project on the VyOS-Networks side.usage: autoself-disables on the public vyos source (no OAuth grant), activates on the private VyOS-Networks mirror (where the grant is attached). One file, both orgs.Phase 0 status
Phase 0 local
coderabbit review --base origin/<branch> --agentwas run once on the canaryvyos/.githubworktree (operator-approved batch waiver — see T8851). The new file produced zero findings. The remaining PRs in this batch are byte-identical except forproject_keys, so per-repo Phase 0 is waived for this fleet sweep.Sibling tracking
🤖 Generated by robots