Skip to content

Prevent disabled vote sites from being auto-created - #1553

Merged
BenCodez merged 7 commits into
masterfrom
tests/disabled-vote-site-autocreation
Aug 18, 2026
Merged

Prevent disabled vote sites from being auto-created#1553
BenCodez merged 7 commits into
masterfrom
tests/disabled-vote-site-autocreation

Conversation

@BenCodez

@BenCodez BenCodez commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Motivation

Disabled vote sites are intentionally excluded from the in-memory list of loaded sites. That made a configured-but-disabled site look missing during vote ingestion, allowing AutoCreateVoteSites to generate the same site again with Enabled: true.

Implementation

  • Added ConfigVoteSites#getRawVoteSiteNames() to return actual VoteSites configuration sections without filtering on Enabled or validating site settings.
  • Added configured-site resolution in VoteSiteManager for:
    • exact keys;
    • normalized keys such as site.examplesite_example;
    • non-empty ServiceSite values;
    • non-empty display names.
  • Added hasConfiguredVoteSite(String...) while preserving hasVoteSite(...) as a loaded-site check.
  • Blocked auto-creation in both:
    • VoteSiteManager#getVoteSite(...);
    • the explicit generation path in VotiferEvent.
  • Added null handling without changing enabled-only lookup behavior.

Regression coverage

Added 14 focused tests covering:

  • enabled and disabled raw configuration sections;
  • malformed scalar entries and malformed/missing VoteSites roots;
  • configured-site matching by key, normalized key, ServiceSite, and display name;
  • multiple identifiers, null values, and empty aliases;
  • loaded-versus-configured site semantics;
  • prevention of disabled-site generation;
  • preservation of auto-generation for genuinely unknown sites;
  • both VoteSiteManager and Votifier ingestion paths.

Verification

  • Final clean diff contains exactly three production files and three test files.
  • GitHub Actions Java CI with Maven run Use new config api #403 passed on the final branch head.
  • Full Maven package result: 271 tests, 0 failures, 0 errors, 0 skipped.

AI disclosure

This pull request was created with assistance from OpenAI and reviewed by BenCodez.

@BenCodez BenCodez changed the title Add regression tests for disabled vote-site auto-creation Prevent disabled vote sites from being auto-created Aug 18, 2026
@BenCodez
BenCodez marked this pull request as ready for review August 18, 2026 00:08
@BenCodez
BenCodez merged commit ffaaff2 into master Aug 18, 2026
4 checks passed
@BenCodez
BenCodez deleted the tests/disabled-vote-site-autocreation branch August 18, 2026 00:41
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