8000 fix: neDB implementation issues by kriswest · Pull Request #979 · finos/git-proxy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: neDB implementation issues #979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

kriswest
Copy link
Contributor
@kriswest kriswest commented Apr 15, 2025

resolves #948
resolves #947

Fixes a number of shortcomings in the file DB implementation, including:

  • Merge documents when updating user records instead of replacing (to match behaviour of mongo - was dropping gitAccount when record was updated)
  • Apply basic validation to repository records (to match behaviour of mongo)
  • Reduce username and email to lowercase consistently in DB clients
  • Add indexes and compaction settings (db file format is append only and needs periodic compaction)

Changes were also applied to the mongo DB classes:

  • Be more consistent about lowercasing user details (username and email)
  • Lowercase repo name consistently
    • this change may be controversial (may need migration)
    • however a number of functions already lowercase the repo name... e.g. addUserCanPush and addUserCanAuthorise, its just not being applied consistently

Finally, tests were updates:

  • existing was updated to ensure it uses unique usernames and emails as this is necessary after the indexes are added.
  • Many more DB tests were introduced. These only cover the fileDB currently, but could be run over mongo implementation if an instance is setup for testing and config applied, perhaps in a GH action

kriswest added 21 commits April 10, 2025 13:16
@kriswest kriswest changed the title 948 neDB implementation issues fix: neDB implementation issues Apr 15, 2025
Copy link
netlify bot commented Apr 15, 2025

Deploy Preview for endearing-brigadeiros-63f9d0 ready!

Name Link
🔨 Latest commit 37f1684
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/6839cee3600b1300081cbd79
😎 Deploy Preview https://deploy-preview-979--endearing-brigadeiros-63f9d0.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the fix label Apr 15, 2025
Copy link
codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 77.16535% with 29 lines in your changes missing coverage. Please review.

Project coverage is 56.01%. Comparing base (25dbd56) to head (37f1684).

Files with missing lines Patch % Lines
src/plugin.ts 6.25% 15 Missing ⚠️
src/service/passport/oidc.js 0.00% 4 Missing ⚠️
.../proxy/processors/push-action/checkAuthorEmails.ts 0.00% 2 Missing ⚠️
src/proxy/processors/push-action/parsePush.ts 33.33% 2 Missing ⚠️
src/db/file/repo.ts 96.42% 0 Missing and 1 partial ⚠️
src/proxy/actions/Step.ts 75.00% 1 Missing ⚠️
src/proxy/processors/pre-processor/parseAction.ts 50.00% 1 Missing ⚠️
src/proxy/processors/push-action/preReceive.ts 0.00% 1 Missing ⚠️
src/proxy/processors/push-action/pullRemote.ts 66.66% 1 Missing ⚠️
src/proxy/processors/push-action/scanDiff.ts 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #979      +/-   ##
==========================================
+ Coverage   48.70%   56.01%   +7.30%     
==========================================
  Files          53       53              
  Lines        2166     2196      +30     
  Branches      242      250       +8     
==========================================
+ Hits         1055     1230     +175     
+ Misses       1074      940     -134     
+ Partials       37       26      -11     

☔ View full report in Codecov by Sentry.
📢 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.

@kriswest
Copy link
Contributor Author

This PR has one more push to come that will hopefully complete the code coverage. Should be reviewed and pushed tomorrow

@kriswest
Copy link
Contributor Author

One last commit to push on this PR that should get coverage on /src/db/file up to near 100% - might get pushed after easter now.

@coopernetes coopernetes self-assigned this Apr 21, 2025
@kriswest
Copy link
Contributor Author

@JamieSlome @coopernetes @grovesy this PR should be ready to go now

Copy link
Member
@JamieSlome JamieSlome left a comment

Choose a reason for hiding this comment

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

@kriswest - before I review pre-merge, can we confirm that the linting changes are aligned with the current config and expectation asserted by the project?

@kriswest
Copy link
Contributor Author
kriswest commented May 7, 2025

@JamieSlome I was set-up as per the project config, however the project config doesn't cover packages/git-proxy-cli! I've tweaked the format command so that it does apply and run it. I tried to add prettier to the child project directly but it's not working there, so I extended the parent project's format command to cover it instead.

This adds a bunch of files to the PR with minor changes - waiting on a review then will push

@kriswest
Copy link
Contributor Author
kriswest commented May 7, 2025

@JamieSlome prettier was run on everything and should be applying to packages/git-proxy-cli. It looks like that was previously formatted with different settings / narrower width. Does it look right to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants
0