Skip to content

Refactor: Move Cloud Functions logic to a dedicated service - #2597

Open
gino-m wants to merge 9 commits into
masterfrom
refactor-auth-cloud-functions-120037319741353196
Open

gino-m wants to merge 9 commits into
masterfrom
refactor-auth-cloud-functions-120037319741353196

Conversation

@gino-m

@gino-m gino-m commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Refactored AuthService to delegate Cloud Functions related logic (sessionLogin and profileRefresh) to a new, dedicated CloudFunctionsService in order to improve code modularity. Replaced HttpClientService and Functions dependencies with CloudFunctionsService inside AuthService. Included unit tests for the new service and updated AuthService tests accordingly.


PR created automatically by Jules for task 120037319741353196 started by @gino-m

…nsService

Co-authored-by: gino-m <228050+gino-m@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gino-m

gino-m commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

@jules Please fix failing tests and try again.

@google-labs-jules

Copy link
Copy Markdown
Contributor

@jules Please fix failing tests and try again.

I'm looking into the failing tests. I notice that trying to use spyOnProperty with httpsCallable gives not declared configurable. Is it possible to mock it using spyOn(fireFunctions, 'httpsCallable') instead in this CI setup, or by overriding httpsCallable with another method in the service that can be stubbed?

@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.56%. Comparing base (3ea0be2) to head (070acb7).

Files with missing lines Patch % Lines
...ervices/cloud-functions/cloud-functions.service.ts 81.81% 2 Missing ⚠️
web/src/app/services/auth/auth.service.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2597      +/-   ##
==========================================
+ Coverage   65.43%   65.56%   +0.13%     
==========================================
  Files         121      122       +1     
  Lines        3052     3058       +6     
  Branches      467      467              
==========================================
+ Hits         1997     2005       +8     
+ Misses        987      985       -2     
  Partials       68       68              

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

@rfontanarosa

Copy link
Copy Markdown
Collaborator

/gemini review

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors access to Cloud Functions by extracting the logic from AuthService into a new CloudFunctionsService, updating the corresponding unit tests to use the new service. The feedback focuses on simplifying the CloudFunctionsService by removing the redundant Injector and runInInjectionContext wrapper, enhancing type safety with generic typings for the callable helper, and improving test readability by formatting a long line in the spec file.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants