Skip to content

Add global VoteSites synchronization workflow - #6

Merged
BenCodez merged 31 commits into
mainfrom
codex/control-votesites-sync
Aug 30, 2026
Merged

BenCodez merged 31 commits into
mainfrom
codex/control-votesites-sync

Conversation

@BenCodez

Copy link
Copy Markdown
Owner

Stacked on #5 and paired with VotingPlugin #1588.

Summary

  • negotiate config.vote-sites-sync.v1 and add a Network-tab source/target workflow
  • read VoteSites.yml from one comment-preserving backend, then preview the merge on selected targets
  • reuse the existing one-time preview approval for the final network sync
  • hide source YAML from operation views and bound sync operations with the full-file retention limit
  • invalidate approvals when the source, target set, connectivity, or negotiated capabilities change

Safety

  • the UI states that rewards are never copied or removed
  • only connected backends that explicitly negotiate sync are selectable as targets
  • Control does not parse or rewrite YAML; each target performs the reward-safe merge

Validation

  • node --check src/main/resources/web/app.js
  • git diff --check
  • selector-to-markup ID audit
  • focused protocol, operation-bounds, capability, and static WebUI regressions
  • GitHub CI is authoritative because Maven is unavailable locally

@BenCodez
BenCodez changed the base branch from codex/tabbed-server-workspace to main August 29, 2026 20:20
@BenCodez BenCodez closed this Aug 29, 2026
@BenCodez BenCodez reopened this Aug 29, 2026
@BenCodez
BenCodez changed the base branch from main to codex/tabbed-server-workspace August 29, 2026 20:47
@BenCodez
BenCodez marked this pull request as ready for review August 29, 2026 21:04
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 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-08-30T00:53:25.761703Z 1cbbd96 Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9142c8bbf6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +71 to +75
if (QUICK_SETUP.equals(domain) && VOTE_SITES_SYNC.equals(preset) && options.containsKey("sourceContent")) {
Map<String, String> visible = new LinkedHashMap<>(options);
visible.remove("sourceContent");
return new ManagedConfiguration(domain, sendVotesToAllServers, blockedServers, fileName, content,
preset, visible);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Redact source YAML from successful result configurations

When a sync target returns its successful typed configuration with the submitted sourceContent, this method redacts only the operation's top-level configuration. ConfigurationOperations.boundedResult() retains the first successful non-file result configuration unchanged, and OperationView.results then exposes the complete source YAML through the operation API. Apply publicView() to retained sync result configurations as well so VoteSites secrets are not echoed.

Useful? React with 👍 / 👎.

Comment on lines +449 to +457
function syncSourceCandidates() {
return visibleNodeItems.filter(node => isBackend(node) && node.online &&
node.acceptedCapabilities.includes('config.files.v1') &&
node.acceptedCapabilities.includes('config.file-comments.v1'));
}

function syncTargetCandidates() {
return visibleNodeItems.filter(node => isBackend(node) && node.online &&
node.acceptedCapabilities.includes('config.vote-sites-sync.v1'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Load sync candidates beyond the current node page

In installations with more than 100 registered nodes, both candidate lists are derived only from visibleNodeItems, which is the current /nodes?offset=...&limit=100 page. Changing pages replaces that array and also discards the previous source and targets, so a source on one page cannot be synchronized to a target on another page despite this being a global workflow. Fetch or retain eligible candidates across pages, or provide a dedicated unpaginated/batched selector.

Useful? React with 👍 / 👎.

Comment on lines +471 to +473
const targetIds = new Set(targetsAvailable.map(node => node.nodeId));
voteSitesTargetIds = new Set([...voteSitesTargetIds].filter(nodeId =>
targetIds.has(nodeId) && nodeId !== voteSitesSourceId));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Invalidate in-flight previews when refresh removes targets

If Refresh runs while the sync preview is polling and a target goes offline or loses its sync capability, this filtering silently removes it without incrementing inputGeneration. The completed preview therefore still passes the generation check and stores an approval containing the original target IDs; apply can subsequently queue that stale target because createApply does not revalidate capabilities. Clear/invalidate the in-flight preview whenever this filtering changes the selected target set.

Useful? React with 👍 / 👎.

@BenCodez
BenCodez changed the base branch from codex/tabbed-server-workspace to main August 29, 2026 21:20
@BenCodez BenCodez closed this Aug 29, 2026
@BenCodez BenCodez reopened this Aug 29, 2026
@BenCodez
BenCodez changed the base branch from main to codex/tabbed-server-workspace August 29, 2026 21:24
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

voteSitesTargetIds = new Set(targetsAvailable.map(node => node.nodeId)
.filter(nodeId => nodeId !== voteSitesSourceId));

P2 Badge Limit sync batches to the operation target cap

After the new all-page node load, deployments with more than 100 eligible sync targets select every target by default, but ConfigurationOperations.validateTargets() rejects any request containing over 100 node IDs. Consequently, "Read source and preview" always fails until an administrator manually deselects enough backends, so the global workflow cannot synchronize the default selection. Limit each selection/batch to 100 or split the workflow into bounded operations.


if (!sources.some(node => node.nodeId === voteSitesSourceId)) {
voteSitesSourceId = sources.find(node => node.nodeId === selectedServerId)?.nodeId || sources[0]?.nodeId || '';
}

P2 Badge Invalidate previews when refresh replaces the source

If Refresh makes the selected source ineligible after its read finishes but while target preview polling is still running, this branch silently substitutes another source without incrementing inputGeneration. When the replacement source is not itself a sync target, the target-retention path need not change the generation either, so the completed preview passes the generation check and enables Apply using YAML from the old source while the selector displays the new one. Clear/invalidate the in-flight preview whenever this automatic source replacement changes the source ID.


const page = await authorized(`/api/v1/nodes?offset=${offset}&limit=${PAGE_SIZE}`);
items.push(...page.items);
if (page.items.length < PAGE_SIZE) return items;

P2 Badge Preserve truncation state in the global topology load

Each /api/v1/nodes response can deliberately truncate its nodes' backend arrays (boundedNodePage() sets backendItemsTruncated when this happens), but this all-page loader discards that flag and treats the partial arrays as complete. On a full 100-node page, for example, each proxy can expose only 40 backend summaries, causing the new overview's configured-backend metric and topology to silently omit the remainder. Carry the truncation metadata into those views or load topology through an endpoint that can return complete backend data.

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BenCodez
BenCodez changed the base branch from codex/tabbed-server-workspace to main August 29, 2026 21:31
@BenCodez
BenCodez changed the base branch from codex/tabbed-server-workspace to main August 29, 2026 23:32
@BenCodez BenCodez closed this Aug 29, 2026
@BenCodez BenCodez reopened this Aug 29, 2026
@BenCodez
BenCodez changed the base branch from main to codex/tabbed-server-workspace August 29, 2026 23:32

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 1384f318bb

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BenCodez
BenCodez changed the base branch from codex/tabbed-server-workspace to main August 29, 2026 23:47
@BenCodez BenCodez closed this Aug 29, 2026
@BenCodez BenCodez reopened this Aug 29, 2026
@BenCodez
BenCodez changed the base branch from main to codex/tabbed-server-workspace August 29, 2026 23:47

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 32c3c4e4ea

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BenCodez
BenCodez changed the base branch from codex/tabbed-server-workspace to main August 29, 2026 23:56
@BenCodez BenCodez closed this Aug 29, 2026
@BenCodez BenCodez reopened this Aug 29, 2026
@BenCodez
BenCodez changed the base branch from main to codex/tabbed-server-workspace August 29, 2026 23:56

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: aa3785a476

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

Stack follow-up:

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: dba2815479

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

Final stack follow-up:

AI-assisted implementation; changes and stack ancestry were reviewed before publication.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 1cbbd96dbc

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BenCodez
BenCodez changed the base branch from codex/tabbed-server-workspace to main August 30, 2026 01:28
@BenCodez
BenCodez merged commit c52e025 into main Aug 30, 2026
@BenCodez
BenCodez deleted the codex/control-votesites-sync branch August 30, 2026 01:30
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