Skip to content

Handle nullable AROI validator errors - #208

Open
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-inspection-aa78
Open

Handle nullable AROI validator errors#208
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-inspection-aa78

Conversation

@cursor

@cursor cursor Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

If aroivalidator latest.json contains an invalid relay result with error: null or another non-string value, Allium can crash while generating network-health metrics or contact/operator pages. JSON null bypasses dict.get(..., default), then the value reaches string-only helpers (re.findall, .lower()), aborting the static site build.

Root cause

AROI result error fields were treated as always-present strings at the aggregation/rendering boundary.

Fix

  • Normalize optional/non-string validator error values to Unknown error before rollup/rendering.
  • Harden the existing error deduplication and simplification helpers as defense in depth.
  • Add regression tests for both affected paths: contact validation rendering and operator metrics rollup.

Validation

  • python3 -m pytest tests/unit/aroi/test_aroi_validation.py — 49 passed
  • python3 -m flake8 allium/lib/aroi_validation.py tests/unit/aroi/test_aroi_validation.py --select=E9,F63,F7,F82 --show-source — passed
  • python3 -m pytest — 949 passed, 54 deselected, 34 subtests passed

Note: repo-wide python3 -m flake8 . --select=E9,F63,F7,F82 --show-source currently reports pre-existing failures in tests/integration/test_api_timeout.py, tests/integration/test_authorities.py, and vendored venv/ files; the touched files pass the same rule set.

Open in Web View Automation 

Co-authored-by: 1aeo <1aeo@users.noreply.github.com>
@1aeo
1aeo marked this pull request as ready for review May 11, 2026 05:50
@1aeo

1aeo commented May 11, 2026

Copy link
Copy Markdown
Owner

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@1aeo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 9 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fb78c0f7-7d4b-4bc9-8041-335885cf47df

📥 Commits

Reviewing files that changed from the base of the PR and between 1f2e12d and 8edc8e9.

📒 Files selected for processing (2)
  • allium/lib/aroi_validation.py
  • tests/unit/aroi/test_aroi_validation.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/critical-bug-inspection-aa78

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 and usage tips.

@cursor cursor Bot left a comment

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.

Security review result: no high-confidence vulnerabilities found in this PR.

Reviewed the AROI validator error normalization changes for injection, XSS/request-forgery exposure, secrets leakage, authz boundary changes, unsafe deserialization, dependency/supply-chain changes, and insecure logging. The diff normalizes nullable/non-string error fields to a constant display string before existing regex/lowercase processing and does not add new external requests, command execution, template sinks, dependencies, or credential handling.

Validation: python3 -m unittest tests.unit.aroi.test_aroi_validation passed (49 tests). python3 -m pytest tests/unit/aroi/test_aroi_validation.py could not run because pytest is not installed in the active environment.

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

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.

2 participants