Skip to content

refactor: mark BoardCandidatesLayout props as read-only#3409

Merged
arkid15r merged 2 commits intoOWASP:mainfrom
ThetaLogN:fix/sonar-readonly-board-candidates
Jan 18, 2026
Merged

refactor: mark BoardCandidatesLayout props as read-only#3409
arkid15r merged 2 commits intoOWASP:mainfrom
ThetaLogN:fix/sonar-readonly-board-candidates

Conversation

@ThetaLogN
Copy link
Contributor

Resolves #3405

Following the SonarCloud recommendation, this PR refactors the BoardCandidatesLayout component by marking its props as read-only.

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran make check-test locally: all warnings addressed, tests passed
  • I used AI for code, documentation, tests, or communication related to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

Summary by CodeRabbit

  • Refactor
    • Updated component prop types to be read-only, tightening static type definitions for improved code quality and consistency across the UI layer.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

The BoardCandidatesLayout component's props parameter type was changed to use Readonly<{ children: React.ReactNode }> instead of { children: React.ReactNode }, altering only the TypeScript type-level immutability without changing runtime behavior.

Changes

Cohort / File(s) Summary
Type annotation update for component props
frontend/src/app/board/[year]/candidates/layout.tsx
Updated component parameter type from { children: React.ReactNode } to Readonly<{ children: React.ReactNode }> to mark props as read-only.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: marking BoardCandidatesLayout props as read-only, which matches the primary objective of the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the refactoring follows SonarCloud recommendations and links to issue #3405 which documents the requirement.
Linked Issues check ✅ Passed The PR successfully implements the requirement from issue #3405 by updating the BoardCandidatesLayout component props to be marked as read-only using the Readonly type.
Out of Scope Changes check ✅ Passed The changes are focused solely on marking the BoardCandidatesLayout props as read-only, with no unrelated modifications detected in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 18, 2026
@sonarqubecloud
Copy link

@arkid15r arkid15r enabled auto-merge January 18, 2026 21:13
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM

@arkid15r arkid15r added this pull request to the merge queue Jan 18, 2026
Merged via the queue into OWASP:main with commit ba28d79 Jan 18, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark the props of the component as read-only.

2 participants

Comments