Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant new feature for remote functions, including Firebase integration with AppCheck. The overall structure is well-thought-out, leveraging modern Angular features like signals and standalone components as recommended by the style guide. I've identified a critical issue with a hardcoded key and a few high-severity issues related to encapsulation that should be addressed. Additionally, there are several medium-severity suggestions to improve code quality, maintainability, and the usability of the new debug page. Great work on setting up this new capability!
src/app/feature/remote-function/pages/debug/remote-function-debug.page.ts
Show resolved
Hide resolved
src/app/feature/remote-function/pages/debug/remote-function-debug.page.html
Show resolved
Hide resolved
src/app/feature/remote-function/pages/debug/remote-function-debug.page.html
Outdated
Show resolved
Hide resolved
src/app/feature/remote-function/pages/debug/remote-function-debug.page.ts
Outdated
Show resolved
Hide resolved
src/app/feature/remote-function/pages/debug/remote-function-debug.page.ts
Show resolved
Hide resolved
|
/gemini summary |
Summary of ChangesThis pull request introduces a new Highlights
Changelog
Activity
|
…national/open-app-builder into feat/remote-functions
|
@jfmcquade - just to check if this needs to be on your radar for upcoming releases or not? |
Thanks for the prompt. I believe this has been deprioritised for now as it is no longer required in the current round of pending releases – @ChrisMarsh82 can you confirm? But would still obviously be good to review and keep things moving, I'll add to my to-do list (likely will get to it next week) |
e9039e7 to
814f572
Compare
27200a7 to
795ec1a
Compare
PR Checklist
Description
Adds support for
remote-functionsfeature that allows triggering remote cloud functions.Includes firebase cloud function integration with support for AppCheck
Git Issues
Relates to #3015
Review Notes
A rapidproUserData function has been created and deployed to firebase functions on the
debug deployment. This function is secured with appCheck.Update debug deployment firebase config to include appCheck site key and functions region. Enable remote functions with firebase provider
yarn workflow deployment set debugGo to the remote-functions debug at
http://localhost:4200/remote-functionsAttempt to call the function
rapidproUserData, passing arapidpro_uuidparameter to retrieve from rapidpro. A test contact has been created with uuid700c4bd4-c7e5-4414-9ff2-2b1ff2571947The function will fail due to appCheck blocking from unknown source.
By default AppCheck will run in debug mode, generating a device token locally that can be added to list of whitelisted apps in the firebase console.
Look for message that resembles:
Add the listed ID to the whitelisted debug token within the firebase console
App Check->AppspageRefresh the page to see available token
Call remote function and view response
Dev Notes
This PR only adds backend infrastructure and debug page for calling remote functions. I'm sure we will want to expose to the full authoring system via actions at some point, however as time is somewhat limited at the moment I'd suggest we first try to directly integrate with the plh-parent-group service so that the service exposes it's own action that handles calling the function and displaying results.
Given the potential sensitivity of the rapidpro contact data it is recommended not to persist to the dynamicDB caching system, and instead only show data directly in the page following function trigger (online-only functionality).
See additional notes in README for feature
Follow-up Tasks
idems-debug.web.appso functions should trigger from that website (and fail when testing on corresponding firebase .web.app site)Screenshots/Videos
Example Setup - creating a new reCaptcha Enterprise key to use with AppCheck on web
