Skip to content

refactor: Refactor service module to TS + ESM #1063

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 20 commits into
base: main
Choose a base branch
from

Conversation

jescalada
Copy link
Contributor

@jescalada jescalada commented Jun 27, 2025

Fixes #1062.

This PR is built on top of #977 which should merged first (and is ready to merge!).

Note that some .post requests use res: any instead of res: Response. For some reason, when using res: Response, I was getting this (unhelpful) error:

No overload matches this call.
  The last overload gave the following error.
    Argument of type '(req: Request, res: Response) => Promise<express.Response<any, Record<string, any>>>' is not assignable to parameter of type 'Application<Record<string, any>>'.
      Type '(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>) => Promise<...>' is missing the following properties from type 'Application<Record<string, any>>': init, defaultConfiguration, engine, set, and 63 more.ts(2769)

I have no idea why it seems to require the type Application (from the Express library), but when setting it to type any the endpoints work as they used to.

Copy link

netlify bot commented Jun 27, 2025

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit f57b1a1
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/68666e83a595a20008cb6708

Copy link

codecov bot commented Jun 29, 2025

Codecov Report

Attention: Patch coverage is 61.27660% with 182 lines in your changes missing coverage. Please review.

Project coverage is 77.27%. Comparing base (75fb0e6) to head (f57b1a1).

Files with missing lines Patch % Lines
src/service/routes/push.ts 16.90% 58 Missing and 1 partial ⚠️
src/service/routes/repo.ts 61.03% 24 Missing and 6 partials ⚠️
src/service/routes/users.ts 20.00% 24 Missing ⚠️
src/service/passport/ldaphelper.ts 27.27% 16 Missing ⚠️
src/service/passport/oidc.ts 35.00% 13 Missing ⚠️
src/service/passport/jwtAuthHandler.ts 69.69% 4 Missing and 6 partials ⚠️
src/service/passport/activeDirectory.ts 63.15% 5 Missing and 2 partials ⚠️
src/service/passport/jwtUtils.ts 87.17% 3 Missing and 2 partials ⚠️
src/service/index.ts 90.69% 2 Missing and 2 partials ⚠️
src/service/routes/config.ts 66.66% 4 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1063      +/-   ##
==========================================
+ Coverage   76.78%   77.27%   +0.49%     
==========================================
  Files          55       54       -1     
  Lines        2261     2187      -74     
  Branches      251      342      +91     
==========================================
- Hits         1736     1690      -46     
+ Misses        495      445      -50     
- Partials       30       52      +22     

☔ 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.

@jescalada
Copy link
Contributor Author

By the way, @06kellyjac, the OIDC is still working correctly after your passport changes 👍🏼

I tried merging in your ActiveDirectory additions and refactoring them into TS, but I'm not sure if they work 100% as intended. Would appreciate a quick look at this to make sure!

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

Successfully merging this pull request may close these issues.

Refactor service module to TS [Migration] Convert /src/service files to TS and ESM (API)
1 participant