Skip to content

Suppress false assumed-(required) handling for primitive entity IDs#301

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-false-warning-for-required-id
Draft

Suppress false assumed-(required) handling for primitive entity IDs#301
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-false-warning-for-required-id

Conversation

Copy link
Copy Markdown

Copilot AI commented May 13, 2026

Entity state IDs are implicitly treated as (required), but that assumption was leaking onto primitive IDs such as int32, producing misleading warnings and incorrect validation behavior. This change narrows implicit required handling to field types that actually support (required).

  • Behavior change

    • Skip generated (required) validation for implicitly required IDs whose field type does not support the option.
    • This prevents primitive entity IDs from being treated as missing/invalid solely because they are the first field.
  • Regression coverage

    • Add a validating test fixture for an entity state with an int32 ID.
    • Add runtime coverage asserting such a message remains valid when the primitive ID is omitted.
    • Add compiler-side coverage asserting no warning is emitted for the implicit primitive ID case.
  • Why this matters

    • Keeps implicit entity ID conventions aligned with actual (required) semantics.
    • Avoids diagnostics that imply a field is incorrectly using (required) when the field was only inferred by convention.

Example covered by the change:

message NumberStats {
    option (entity).kind = ENTITY;
    int32 id = 1;
}

Before this change, the first field could be treated as implicitly (required) despite int32 not supporting that option. With this update, primitive IDs like the above are ignored by required-field generation.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.jetbrains.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=1024m -XX:+UseParallelGC -Xmx4096m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI self-assigned this May 13, 2026
Copilot AI review requested due to automatic review settings May 13, 2026 21:16
Copilot AI review requested due to automatic review settings May 13, 2026 21:16
Agent-Logs-Url: https://github.com/SpineEventEngine/validation/sessions/c0c59d00-5e83-41d0-8488-c2618a6ea31a

Co-authored-by: alexander-yevsyukov <3116444+alexander-yevsyukov@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 13, 2026 21:28
Copilot AI changed the title [WIP] Fix false warning for assumed required ID of entity state Suppress false assumed-(required) handling for primitive entity IDs May 13, 2026
Copilot AI requested a review from alexander-yevsyukov May 13, 2026 21:31
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.

False warning for assumed (required) ID of entity state with the int32 type

2 participants