Back to WorkflowBench
💬MattermostGo32k starsTeam Communication & Collaboration

One PR. A constraint gap behind 9,856 production panics in a 32k-star platform.

A single PR adding a NOT NULL constraint exposed 5 untested requirements. Application-layer validation existed, but the database had no guardrails. OrangePro found it from one pull request.

7
Requirements Extracted
5
Verified Gaps
14%
Coverage Before
86%
Coverage After
Trace Matrix

Requirement-to-Test Traceability

Every requirement extracted from the PR, mapped to existing tests and verified against the codebase. Click any row to see the search evidence.

Coverage Distribution

7
5 Gaps
1 Partial
1 Covered

Requirement Coverage

Before14%
After OrangePro86%
+72% coverage improvement
7 requirements traced|5 gaps|1 partial|1 covered
R1GAP

Database rejects NULL username on INSERT

000160_add_users_username_not_null.up.sql
R2GAP

Database rejects empty string username on INSERT

000160_add_users_username_not_null.up.sql
R3GAP

Migration backfills existing NULL/empty usernames

000160_add_users_username_not_null.up.sql
R4COVERED

Application-layer validation still rejects invalid usernames

user.IsValid()
R5PARTIAL

Plugin/webhook user creation respects constraint

plugin_api.CreateUser()
R6GAP

Profile image generation handles constraint-valid usernames

createProfileImage()
R7GAP

Migration rollback (down) removes constraint cleanly

000160_add_users_username_not_null.down.sql
Critical Findings

Top 3 Verified Gaps

These gaps were verified by searching the repository's test directories. Each finding includes the exact search query and result so you can reproduce it yourself.

1

Zero database-level constraint tests despite application-layer validation

search evidence

user_test.go validates usernames at the Go application layer, but no test in server/**/*_test.go validates the actual PostgreSQL NOT NULL + CHECK constraints. Any code path bypassing IsValid() (plugins, migrations, admin scripts) could create invalid records.

2

No migration backfill verification

search evidence

The migration includes an UPDATE to backfill NULL/empty usernames, but no test validates that existing data is correctly transformed or that the backfill handles edge cases (whitespace-only, special characters).

3

Profile image crash path completely untested

search evidence

Sentry issue MATTERMOST-SERVER-W1 with 9,856 events shows createProfileImage panics on empty usernames. Despite being a known production issue, no test covers this specific code path.

Before vs. After

Coverage Comparison

RequirementBeforeAfter
DB rejects NULL username✗ None✓ Integration
DB rejects empty string username✗ None✓ Integration
Migration backfills existing records✗ None✓ Integration
App-layer validation rejects invalid✓ Unit✓ Unit
Plugin/webhook respects constraint~ Partial✓ Integration + E2E
Profile image handles valid usernames✗ None✓ Unit + E2E
Migration rollback works cleanly✗ None✓ Integration
Verifiable Evidence

Don't take our word for it. Verify it yourself.

Every finding in this analysis is based on a public GitHub repository. Clone the repo, run the searches we documented, and see the same results. No black boxes.