fix: add helper snake to camle case (CM-1285) - #4258
Merged
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the public package detail API response shape by converting signalCoverageHealth keys from Tinybird/DB-style snake_case to API-consistent camelCase.
Changes:
- Add a small
snakeToCamelKeyshelper for top-level key conversion (pass-through fornull). - Apply the helper to
pkg.signalCoverageHealthbefore returning the response payload.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Fixes the
signalCoverageHealthobject returned by the package detail API: keys were coming through insnake_case(as stored in the DB by Tinybird) and are now converted tocamelCaseto be consistent with the rest of the API response.Changes
getPackage.ts: adds asnakeToCamelKeyshelper that converts top-level object keys fromsnake_casetocamelCase, and applies it tosignalCoverageHealthbefore returning the response.bus_factor→busFactor,supply_chain_integrity→supplyChainIntegritynull(not-yet-enriched packages).Type of change
JIRA ticket
CM-1285
Note
Low Risk
Single-field response shaping in a read endpoint; no auth, persistence, or behavioral logic changes beyond key naming.
Overview
Fixes
signalCoverageHealthon the package detail API so top-level keys match the rest of the response (camelCase) instead of the snake_case shape from Tinybird/DB storage.Adds a
snakeToCamelKeyshelper ingetPackage.ts(pass-through fornull) and wrapspkg.signalCoverageHealthbefore it is returned—e.g.bus_factor→busFactor,supply_chain_integrity→supplyChainIntegrity.Reviewed by Cursor Bugbot for commit 86ee6f3. Bugbot is set up for automated code reviews on this repo. Configure here.