Validate NOT NULL constraint on gpg_signatures#project_id

What does this MR do and why?

Validate NOT NULL constraint on gpg_signatures#project_id

Epic: &11670

Addresses #555251

There are no rows where project_id is NULL: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/42015/commands/129065

This is a large table (https://postgres.ai/console/gitlab/gitlab-production-main/sessions/42015/commands/129066) and I will shard it in two steps:

1- (previous MR) add a not null constraint with validate: false + prepare an async constraint validation - !200250 (merged)

Screenshot 2025-08-11 at 10.28.38 AM.png

2- (this MR) validate project_id NOT NULL

* gpg_signatures#project_id is enforced through https://gitlab.com/gitlab-org/gitlab/-/blob/3ad8e7660a5facf83a1772ef1876b140f2684493/app/models/concerns/commit_signature.rb#L14

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Tomasz Skorupa

Merge request reports

Loading