Skip to content

fix: remove unused color field from sector events#150

Merged
fank merged 2 commits intomainfrom
fix/remove-sector-color-field
Mar 7, 2026
Merged

fix: remove unused color field from sector events#150
fank merged 2 commits intomainfrom
fix/remove-sector-color-field

Conversation

@fank
Copy link
Member

@fank fank commented Mar 7, 2026

Summary

  • Remove Color field from SectorEvent struct
  • Revert parser args to [frame, type, objectType, unitName, side, posX?, posY?, posZ?]
  • Remove color from v1 JSON builder output
  • Companion PRs: addon and web

Test plan

  • All parser tests passing
  • All builder tests passing
  • All integration tests passing

Remove Color from SectorEvent struct, parser, and v1 builder. The field
was never populated by the addon. Args revert to
[frame, type, objectType, unitName, side, posX?, posY?, posZ?].
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the SectorEvent data structure by eliminating an unused 'Color' field. This change simplifies the event's definition, its parsing logic, and its representation in the v1 JSON export, ensuring that only necessary data is processed and stored. The primary impact is a cleaner, more efficient handling of sector-related events across the system.

Highlights

  • Removed 'Color' field from SectorEvent: The 'Color' field has been removed from the core.SectorEvent struct as it was unused.
  • Updated SectorEvent parsing logic: The ParseSectorEvent function in the parser was updated to no longer expect or parse a 'color' argument, adjusting the indices for position data accordingly.
  • Modified v1 JSON export format: The v1 JSON builder output for SectorEvent no longer includes the 'color' field, streamlining the data structure.
  • Updated test cases: All relevant parser, builder, and integration tests were updated to reflect the removal of the 'Color' field from SectorEvent.
Changelog
  • internal/parser/parse_events.go
    • Removed 'color' from the ParseSectorEvent argument list in comments.
    • Removed logic for parsing the event.Color field.
    • Adjusted indices for parsing PosX, PosY, and PosZ due to the removal of the 'color' field.
  • internal/parser/parse_events_test.go
    • Updated test case names to reflect the removal of 'color' from input descriptions.
    • Modified input arrays in test cases to remove the 'color' string.
    • Removed assertions related to e.Color in test checks.
    • Adjusted input arrays for error test cases to match the new argument structure.
  • internal/storage/memory/export/v1/builder.go
    • Updated the comment describing the v1 SectorEvent format to remove 'color'.
    • Removed evt.Color from the []any slice used to build the SectorEvent payload.
  • internal/storage/memory/export/v1/builder_test.go
    • Removed the Color field from the core.SectorEvent struct initialization in test data.
    • Removed the assertion for payload0[3] being the color.
    • Adjusted the index for retrieving pos0 from payload0.
  • internal/storage/memory/export_test.go
    • Removed the Color field from the core.SectorEvent struct initialization when recording a sector event.
    • Removed the assertion for sectorPayload[3] being the color.
  • pkg/core/events.go
    • Removed the Color field from the SectorEvent struct definition.
    • Updated the comment for UnitName to specify 'name of the sector'.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly removes the unused Color field from SectorEvent. The changes are consistently applied across the parser, data structures, and tests. I've identified a couple of opportunities to improve test coverage by adding more specific assertions, which will make the test suite more robust.

@github-actions
Copy link

github-actions bot commented Mar 7, 2026

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/OCAP2/extension/v5/internal/parser 100.00% (ø)
github.com/OCAP2/extension/v5/internal/storage/memory 99.22% (ø)
github.com/OCAP2/extension/v5/internal/storage/memory/export/v1 100.00% (ø)
github.com/OCAP2/extension/v5/pkg/core 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/OCAP2/extension/v5/internal/parser/parse_events.go 100.00% (ø) 229 (-2) 229 (-2) 0
github.com/OCAP2/extension/v5/internal/storage/memory/export/v1/builder.go 100.00% (ø) 212 212 0
github.com/OCAP2/extension/v5/pkg/core/events.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/OCAP2/extension/v5/internal/parser/parse_events_test.go
  • github.com/OCAP2/extension/v5/internal/storage/memory/export/v1/builder_test.go
  • github.com/OCAP2/extension/v5/internal/storage/memory/export_test.go

@fank fank merged commit 6aac713 into main Mar 7, 2026
3 checks passed
@fank fank deleted the fix/remove-sector-color-field branch March 7, 2026 14:59
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