Skip to content

fix: widen knowledge processing span names#1954

Closed
godququ5-code wants to merge 1 commit into
Tencent:mainfrom
godququ5-code:fix-1941-widen-wiki-span-name
Closed

fix: widen knowledge processing span names#1954
godququ5-code wants to merge 1 commit into
Tencent:mainfrom
godququ5-code:fix-1941-widen-wiki-span-name

Conversation

@godququ5-code

Copy link
Copy Markdown

Description

Wiki summary pages generate span names such as postprocess.wiki.page[summary/<knowledge-id>], which are 67 characters long. The knowledge_processing_spans.name column and its GORM model were limited to 64 characters, causing PostgreSQL inserts to fail and leaving Wiki-enabled documents stuck in finalizing.

This change:

  • adds migration 000066 to widen knowledge_processing_spans.name to VARCHAR(256)
  • keeps the down migration safe by truncating names back to 64 characters before narrowing the column
  • aligns the GORM model and SQLite test schemas with the production column width
  • adds a regression test covering the actual Wiki summary span name shape

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • 🎨 Refactor
  • ⚡ Performance improvement
  • 🧪 Test
  • 🔧 Configuration / Build / CI

Related Issue

Fixes #1941

Testing

  • go test ./internal/types ./internal/application/repository ./internal/application/service -count=1
  • golangci-lint run --new-from-rev=HEAD (0 issues)
  • PostgreSQL 16 migration check:
    • the existing VARCHAR(64) schema rejects the 67-character Wiki summary span name
    • migration up allows the insert and preserves all 67 characters
    • migration down restores a 64-character column and truncates the value to 64 characters

Full make test was also attempted. Unrelated environment-dependent tests fail because the local DocReader service is not running on localhost:50051, and existing Notion/remote-image tests are blocked by the current SSRF rules for 127.0.0.1. The packages changed by this PR pass.

Full make lint reports existing repository-wide findings; diff-scoped lint reports no new issues.

Checklist

  • make fmt && make lint && make test pass locally
  • Self-reviewed the code
  • Added/updated tests covering the change
  • Updated related documentation (README, docs/, Swagger annotations, etc.)
  • Breaking changes are clearly called out in the description above

Screenshots / Recordings

Not applicable; this is a database schema fix.

@godququ5-code
godququ5-code marked this pull request as ready for review July 7, 2026 17:00
@godququ5-code

Copy link
Copy Markdown
Author

Thanks for addressing this upstream. PR #2020 has now merged the same schema expansion and also adds deterministic hash-suffix truncation for names beyond the new column limit, so this PR is superseded. Closing to avoid duplicating the merged fix.

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.

Bug: Wiki summary page span name exceeds VARCHAR(64) limit in knowledge_processing_spans table

1 participant