fix(channels): make seed runnable + widen platform (unblocks DEV channel data load) - #2159
Merged
jung-thomas merged 1 commit intoSep 5, 2026
Merged
Conversation
…ion, widen platform
The channel seed script crashed under raw node: srv/lib/channels/normalize.js
used CommonJS (require/module.exports) but sat under a "type":"module"
package, so Node parsed it as ESM (ReferenceError: require is not defined).
Vitest masked this with its own loader, so tests passed while the seed never
ran. Renamed to .cjs and updated the 3 importers.
Two dataset-vs-schema defects surfaced while seeding DEV:
- github_stars values are human approximations ("~1.4K", "~3.2K") but
githubStars/subscribers are Integer columns → SqlError 'not a valid number'.
Added parseApproxCount() (handles ~, commas, K/M/B suffixes) and applied it
to both count fields.
- platform : String(40) is too narrow for legitimate 56-char values
("Multi-Platform (LinkedIn / Bluesky / GitHub / X)") → widened to String(80).
Regenerated the hdbmigrationtable (version=2, non-lossy ALTER) via the
documented single-hana-task workaround, then canonical rebuild for last-dev.
Tests: channels-normalize/seed + channel-submission-service — 13 passed.
jung-thomas
marked this pull request as ready for review
September 5, 2026 08:20
jung-thomas
deleted the
fix/channels-seed-normalize-cjs-and-platform-width
branch
September 5, 2026 08:20
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.
Make the external-channels seed actually runnable + fix two dataset-vs-schema defects
Surfaced while loading the 238-channel research dataset into DEV so the P1–P3 channels surfaces can be tested. Three fixes, all needed before the seed completes.
1. Seed crashed under raw
node— CJS file named.jsunder an ESM packagesrv/lib/channels/normalize.jsusedrequire/module.exportsbut the package is"type":"module", so Node parsed it as ESM →ReferenceError: require is not defined. Vitest masked it (own loader) so tests were green while the seed had never run. Renamed tonormalize.cjs; updated the 3 importers (scripts/seed-channels.cjs,test/channels-normalize.test.js,test/channels-seed.test.js).2. Approximate GitHub-star counts into Integer columns
github_starsin the dataset is human-readable (~1.4K,~3.2K,~520) butgithubStars/subscribersareInteger→SqlError: invalid number: not a valid number string '~1.4K'. AddedparseApproxCount()(strips~/commas, handles K/M/B) and applied to both count fields.3.
platformcolumn too narrow for the dataplatform : String(40)but 3 channels have legitimate 56-char values (Multi-Platform (LinkedIn / Bluesky / GitHub / X)) →inserted value too large. Widened toString(80). Regeneratedcom.sap.developers.ims.Channels.hdbmigrationtableto version=2 (non-lossyALTER (platform NVARCHAR(80))) via the documented single-hana-task workaround, then a canonical two-task rebuild fordb/last-dev/csn.jsonordering.Verification
channels-normalize+channels-seed+channel-submission-service— 13 passed.inserted=238.version=2,platform NVARCHAR(80), oneALTERinmigration=2.Deploy note
Widening
platformneeds the db module redeployed to DEV (applies migration v2) before the last ~69 rows — incl. the 3 wide-platform rows — can load. Per policy, deploy from fresh origin/DEV after merge, not this branch. 169/238 rows are already in DEV from the pre-fix partial run; the seed is idempotent, so the post-deploy re-run finishes the set.