Repository navigation
fix: make extension_version.published_by_id NOT NULL - #2276
Conversation
Changes * added migration; just sets NOT NULL constraint as there should be no NULL values * modified ExtensionVersion: @manytoone on publishedBy becomes @manytoone(optional = false) plus @joincolumn(name = "published_by_id", nullable = false) * left in places null checks in rest of the places; they are no redundant, null is enforced at DB level * fixed tests that now failed (did not set user on entity) * added one test that ensures that persisting with null user fails fixes: #2266
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Generated jOOQ metadata remains stale, and several new publisher fixtures are not cleaned from the shared test database.
Review effort: Balanced
Findings: 4
Open (4)
What changed in this PR
Enforces non-null publishers for extension versions, resolving #2266.
Changes:
- Adds the database constraint and matching JPA mapping.
- Updates affected test fixtures.
- Adds coverage for rejecting versions without publishers.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The migration should avoid scanning the full table while holding an exclusive lock.
Review effort: Balanced
Findings: 1
Open (2)
Resolved since last review (3)
Files not reviewed (1)
- server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java: Generated file
Validate a NOT VALID check constraint under a weaker lock first, so the table scan doesn't run while SET NOT NULL holds the exclusive lock on extension_version. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The database, ORM, generated metadata, and tests consistently enforce the new invariant.
Review effort: Balanced
Findings: None
Resolved since last review (2)
Files not reviewed (1)
- server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java: Generated file



Changes
fixes: #2266