Skip to content

fix: match repo name filters case-insensitively in the mongo sink - #1892

Merged
jescalada merged 3 commits into
finos:mainfrom
kwy404:fix/mongo-repo-name-query-case
Nov 23, 2026
Merged

jescalada merged 3 commits into
finos:mainfrom
kwy404:fix/mongo-repo-name-query-case

Conversation

@kwy404

@kwy404 kwy404 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Description

Repo names are stored lowercased (createRepo in src/db/index.ts lowercases them), and the file and postgres sinks lowercase the name filter in getRepos before querying. The mongo sink passed the query to find() unchanged, so with a mongo sink GET /api/v1/repo?name=Git-Proxy returned an empty list while the same request on the file or postgres sink returned the git-proxy repo. getRepo in the mongo sink already lowercases the name, only getRepos was missed.

This lowercases a string name filter in the mongo getRepos, building a new filter object so the caller's query is not mutated. Other fields (project, url, ...) and non-string values are passed through as before.

A unit test checks that the filter sent to find() has the lowercased name and that the caller's query is unchanged; it fails on main and passes with the fix. A mongo integration test creates a repo and filters it with a mixed-case name, mirroring the existing case-insensitive getRepo test.

Ran npm test, npm run lint, npm run format:check and npm run check-types, plus npm run test:integration against a local MongoDB 8.2. The new integration test fails on main (no repos returned) and passes with the fix.

Related Issue

None

Checklist

General

Documentation

  • Documentation has been added/updated for any new features

Configuration

  • If configuration schema (config.schema.json) was modified:
    • TypeScript types regenerated (npm run generate-config-types)
    • Schema reference docs regenerated (npm run gen-schema-doc)

Tests

  • Tests have been added/updated for new functionality
  • Unit tests pass (npm test)
  • Linting and formatting pass (npm run lint and npm run format:check)
  • Type checks pass (npm run check-types)

Repo names are stored lowercased and the file and postgres sinks
lowercase the name filter in getRepos, but the mongo sink passed the
query to find() unchanged. Filtering by a mixed-case name, for example
GET /api/v1/repo?name=Git-Proxy, returned no repos on mongo while the
other sinks returned the matching repo.

Lowercase a string name filter before querying, without mutating the
caller's query, as getRepo already does.
@kwy404
kwy404 requested a review from a team as a code owner November 14, 2026 03:26
@netlify

netlify Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit bf91562
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/6b03f202209659fc760f7054

@github-actions github-actions Bot added the fix label Nov 14, 2026
@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.96%. Comparing base (e67b681) to head (bf91562).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1892   +/-   ##
=======================================
  Coverage   88.96%   88.96%           
=======================================
  Files         127      127           
  Lines        7113     7114    +1     
  Branches     1324     1325    +1     
=======================================
+ Hits         6328     6329    +1     
  Misses        489      489           
  Partials      296      296           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jescalada jescalada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! 🚀

Feel free to open other PRs for minor bugfixes/good first issues.

@jescalada
jescalada enabled auto-merge November 23, 2026 05:58
@jescalada
jescalada merged commit aaf901f into finos:main Nov 23, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants