Skip to content

refactor(config): rename event mode key#401

Open
plexoos wants to merge 1 commit into
mainfrom
rename-config-event-mode
Open

refactor(config): rename event mode key#401
plexoos wants to merge 1 commit into
mainfrom
rename-config-event-mode

Conversation

@plexoos

@plexoos plexoos commented Jul 6, 2026

Copy link
Copy Markdown
Member

No description provided.

@plexoos plexoos marked this pull request as ready for review July 6, 2026 22:20
Copilot AI review requested due to automatic review settings July 6, 2026 22:20
@plexoos plexoos force-pushed the rename-config-event-mode branch from 6ff6222 to b4c320f Compare July 6, 2026 22:21
@plexoos plexoos self-assigned this Jul 6, 2026

@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: 6ff6222679

ℹ️ 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 thread sysrap/config.cpp
Assign(event_, "max_genstep", max_genstep);
Assign(event_, "maxslot", maxslot);
AssignNamedEnum(event_, "event", "mode", event_mode, EventModeInfos);
AssignNamedEnum(event_, "event", "event_mode", event_mode, EventModeInfos);

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 Preserve or reject the legacy mode key

When a user points GPHOX_CONFIG_DIR at an existing config that still uses the pre-rename event.mode key, this parser now ignores that key and leaves event_mode at its default Minimal. Because unknown JSON keys are otherwise accepted, configs that requested modes such as DebugLite or HitPhoton silently stop gathering/saving the configured event arrays instead of failing or migrating; consider accepting the legacy key or explicitly rejecting it during the rename.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the event persistence mode configuration key by renaming the JSON field from event.mode to event.event_mode, updating both the C++ config reader and the checked-in sample config files so that Config continues to drive SEventConfig correctly.

Changes:

  • Update Config::ReadConfig to read the event mode from event.event_mode instead of event.mode.
  • Reorder Config’s event_mode member placement and adjust Config::Apply() call ordering for SEventConfig::SetEventMode.
  • Update sample JSON configs to use "event_mode".

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sysrap/config.h Moves event_mode member (no semantic change by itself).
sysrap/config.cpp Reads renamed JSON key and applies SEventConfig::SetEventMode.
config/wls_test.json Updates event mode key to "event_mode".
config/trap_iso.json Updates event mode key to "event_mode".
config/sphere_leak.json Updates event mode key to "event_mode".
config/dev.json Updates event mode key to "event_mode" and reorders within the object.
config/8x8SiPM_crystal.json Updates event mode key to "event_mode".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sysrap/config.cpp
Assign(event_, "max_genstep", max_genstep);
Assign(event_, "maxslot", maxslot);
AssignNamedEnum(event_, "event", "mode", event_mode, EventModeInfos);
AssignNamedEnum(event_, "event", "event_mode", event_mode, EventModeInfos);
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.

2 participants