fix(schema): widen filename columns from VARCHAR(500) to TEXT#150
Open
Tet-9 wants to merge 1 commit into
Open
Conversation
pr_files.filename, pr_files.previous_filename, and pr_file_contents.filename were defined as VARCHAR(500). Valid Git file paths can exceed 500 characters, causing Postgres to reject PR file ingestion with 'value too long for type character varying(500)', leaving affected PRs without scoring data. Changes: - packages/db/08_pr_files.sql: filename and previous_filename -> TEXT - packages/db/09_pr_file_contents.sql: filename -> TEXT - packages/db/26_alter_filename_to_text.sql: migration for existing deployments - PrFile.entity.ts: @PrimaryColumn type explicitly set to 'text' - PrFileContent.entity.ts: @PrimaryColumn type explicitly set to 'text' Fixes entrius#134
Contributor
Author
|
@anderdc , you may please review this now 🫡 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pr_files.filename,pr_files.previous_filename, andpr_file_contents.filenamewere defined asVARCHAR(500). Valid Git file paths can exceed 500 characters, causing Postgres to reject PR file ingestion withvalue too long for type character varying(500), leaving affected PRs without file metadata or scoring data.Root Cause
The schema used a fixed
VARCHAR(500)for Git file paths, but GitHub can return file paths longer than 500 characters from/pulls/:number/files. The ingestion path passesfile.filenamedirectly to the DB with no truncation or validation.Changes
packages/db/08_pr_files.sql:filenameandprevious_filenamewidened toTEXTpackages/db/09_pr_file_contents.sql:filenamewidened toTEXTpackages/db/26_alter_filename_to_text.sql: migration for existing deploymentspackages/das/src/entities/PrFile.entity.ts:@PrimaryColumntype explicitly set to"text"packages/das/src/entities/PrFileContent.entity.ts:@PrimaryColumntype explicitly set to"text"Testing
Lint confirmed only pre-existing errors in
cache.module.ts, unrelated to this change.Fixes #134