Skip to content

Fix Control apply rollback on blank YAML comments - #1610

Open
BenCodez wants to merge 2 commits into
masterfrom
codex/fix-control-null-comments
Open

BenCodez wants to merge 2 commits into
masterfrom
codex/fix-control-null-comments

Conversation

@BenCodez

@BenCodez BenCodez commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • handle Bukkit YAML comment metadata entries that use null to represent blank comment lines
  • preserve those blank-line markers while sanitizing comments for Control
  • make redacted-comment filtering and restoration null-safe as well
  • add a regression through the exact proxy-method Quick Setup APPLY path

Root cause

A valid BungeeSettings.yml comment block can contain blank comment lines. Bukkit represents those blank lines as null entries in comment metadata. Control's masking/sanitization assumed every comment entry was a non-null string and called COMMENT_SECRET.matcher(original), causing:

NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null

The exception happened after the managed file was installed during APPLY, so the normal safety path restored the backup and reported RELOAD_FAILED / NOT SAVED.

Regression

The new test applies a proxy-method change to a BungeeSettings file containing a blank comment line and verifies:

  • APPLY completes without rollback
  • BungeeMethod is changed
  • surrounding comments are retained

This is intentionally separate from the verified deployment staging work in #1609.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed configuration processing when blank comment lines are present.
    • Preserved blank-line formatting while applying proxy method changes.
    • Prevented incorrect rollback reports during successful configuration updates.
  • Tests

    • Added regression coverage for proxy method changes with blank comment metadata.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-18T00:09:24.349388Z 25b9b87 PR opened
🔒 Security Review Completed 2026-09-18T00:12:31.593242Z 25b9b87 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 31e996f7-94a5-4f78-8c9f-e8dd973d1e93

📥 Commits

Reviewing files that changed from the base of the PR and between aad0d0b and 25b9b87.

📒 Files selected for processing (2)
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/control/BackendConfigurationService.java
  • VotingPlugin/src/test/java/com/bencodez/votingplugin/control/BackendConfigurationServiceTest.java

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: build
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (2)
VotingPlugin/src/main/java/com/bencodez/votingplugin/control/BackendConfigurationService.java (1)

768-768: LGTM!

Also applies to: 879-885, 971-972, 980-980, 988-988

VotingPlugin/src/test/java/com/bencodez/votingplugin/control/BackendConfigurationServiceTest.java (1)

749-765: LGTM!


📝 Walkthrough

Walkthrough

Comment filtering and restoration now preserve null entries that represent blank lines. The regression test verifies proxy-method updates retain meaningful comments and are not rolled back.

Changes

Comment safety

Layer / File(s) Summary
Null-safe comment processing and regression coverage
VotingPlugin/src/main/java/com/bencodez/votingplugin/control/BackendConfigurationService.java, VotingPlugin/src/test/java/com/bencodez/votingplugin/control/BackendConfigurationServiceTest.java
Comment filtering, sanitization, and restoration now handle null entries safely. The test verifies a proxy-method change to REDIS, preserved comments, and no rollback.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 25b9b

The apply and comment-restoration workflows are covered without any unresolved merge-blocking risk.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: fixing Control apply rollback caused by blank YAML comments.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

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.

1 participant