Skip to content
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

Adding new IntegrationMapping collection #142

Merged
merged 7 commits into from
Apr 4, 2023

Conversation

debbie-yu
Copy link
Contributor

@debbie-yu debbie-yu commented Mar 29, 2023

For Ironclad-Slack use case we were noticing the integration document could get quite large as we keep track of a growing number of slack threads. To better handle cases where we need to keep track of integration mappings, we thought it would be better to introduce a IntegrationMapping collection that could be used for these lookup cases.

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @friggframework/api-module-activecampaign@0.8.25-canary.142.cf9317a.0
npm install @friggframework/api-module-airwallex@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-attentive@0.8.25-canary.142.cf9317a.0
npm install @friggframework/api-module-clyde@0.8.26-canary.142.cf9317a.0
npm install @friggframework/api-module-connectwise@0.8.27-canary.142.cf9317a.0
npm install @friggframework/api-module-crossbeam@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-fastspring-iq@0.8.26-canary.142.cf9317a.0
npm install @friggframework/api-module-front@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-gorgias@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-hubspot@0.8.25-canary.142.cf9317a.0
npm install @friggframework/api-module-huggg@0.8.25-canary.142.cf9317a.0
npm install @friggframework/api-module-ironclad@0.0.35-canary.142.cf9317a.0
npm install @friggframework/api-module-marketo@0.8.25-canary.142.cf9317a.0
npm install @friggframework/api-module-microsoft-teams@0.0.3-canary.142.cf9317a.0
npm install @friggframework/api-module-monday@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-netx@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-outreach@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-personio@0.8.25-canary.142.cf9317a.0
npm install @friggframework/api-module-pipedrive@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-qbo@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-rev-io@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-rollworks@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-salesforce@0.8.31-canary.142.cf9317a.0
npm install @friggframework/api-module-salesloft@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-slack@0.1.29-canary.142.cf9317a.0
npm install @friggframework/api-module-terminus@0.8.24-canary.142.cf9317a.0
npm install @friggframework/api-module-yotpo@0.0.18-canary.142.cf9317a.0
npm install @friggframework/api-module-zoom@0.8.24-canary.142.cf9317a.0
npm install @friggframework/assertions@1.0.8-canary.142.cf9317a.0
npm install @friggframework/core@0.2.12-canary.142.cf9317a.0
npm install @friggframework/database@1.0.12-canary.142.cf9317a.0
npm install @friggframework/encrypt@1.1.7-canary.142.cf9317a.0
npm install @friggframework/integrations@1.0.23-canary.142.cf9317a.0
npm install @friggframework/module-plugin@1.0.25-canary.142.cf9317a.0
# or 
yarn add @friggframework/api-module-activecampaign@0.8.25-canary.142.cf9317a.0
yarn add @friggframework/api-module-airwallex@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-attentive@0.8.25-canary.142.cf9317a.0
yarn add @friggframework/api-module-clyde@0.8.26-canary.142.cf9317a.0
yarn add @friggframework/api-module-connectwise@0.8.27-canary.142.cf9317a.0
yarn add @friggframework/api-module-crossbeam@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-fastspring-iq@0.8.26-canary.142.cf9317a.0
yarn add @friggframework/api-module-front@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-gorgias@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-hubspot@0.8.25-canary.142.cf9317a.0
yarn add @friggframework/api-module-huggg@0.8.25-canary.142.cf9317a.0
yarn add @friggframework/api-module-ironclad@0.0.35-canary.142.cf9317a.0
yarn add @friggframework/api-module-marketo@0.8.25-canary.142.cf9317a.0
yarn add @friggframework/api-module-microsoft-teams@0.0.3-canary.142.cf9317a.0
yarn add @friggframework/api-module-monday@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-netx@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-outreach@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-personio@0.8.25-canary.142.cf9317a.0
yarn add @friggframework/api-module-pipedrive@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-qbo@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-rev-io@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-rollworks@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-salesforce@0.8.31-canary.142.cf9317a.0
yarn add @friggframework/api-module-salesloft@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-slack@0.1.29-canary.142.cf9317a.0
yarn add @friggframework/api-module-terminus@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/api-module-yotpo@0.0.18-canary.142.cf9317a.0
yarn add @friggframework/api-module-zoom@0.8.24-canary.142.cf9317a.0
yarn add @friggframework/assertions@1.0.8-canary.142.cf9317a.0
yarn add @friggframework/core@0.2.12-canary.142.cf9317a.0
yarn add @friggframework/database@1.0.12-canary.142.cf9317a.0
yarn add @friggframework/encrypt@1.1.7-canary.142.cf9317a.0
yarn add @friggframework/integrations@1.0.23-canary.142.cf9317a.0
yarn add @friggframework/module-plugin@1.0.25-canary.142.cf9317a.0

@debbie-yu debbie-yu changed the title adding new IntegrationMapping collection Adding new IntegrationMapping collection Mar 29, 2023
@ghost
Copy link

ghost commented Mar 29, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

Copy link
Contributor

@seanspeaks seanspeaks left a comment

Choose a reason for hiding this comment

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

I'm comfortable merging/deploying as is, you'll see my notes, but overall the eventual goal is to bundle packages together (sometime in the next few months) so that most are exposed via a single import (@friggframework/core).

Just seemed worth writing out my thought process/threading on them if you have comments.

@debbie-yu
Copy link
Contributor Author

@seanspeaks mind taking a look again? added tests which then complained about certain dependencies missing

main change should be around introducing helper functions getIntegrationMapping and upsertIntegrationMapping to read/write to IntegrationMapping

Copy link
Contributor

@seanspeaks seanspeaks left a comment

Choose a reason for hiding this comment

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

This is great stuff. I really appreciate the work you put into the tests; breath of fresh air.

The inclusion of IntegrationMapping into the whole IntegrationManager is going to be helpful I think as a core concept, regularly reached-for within the context. I do think we can take it a step further and when instantiating the IntegrationManager class, we can make the IntegrationMapping inherit/automatically know the integration ID, so all we're doing is finding a mapping by the sourceId; not sure yet if that's a helper function that loads up the available mappings for an integration (and therefore handles the discriminators), or if the dev needs to call it for each type of integration mapping... I'm envisioning something like const workflowConfig = await this.getIntegrationMapping('IroncladWorkflow', workflowId)

Anywho, easy to build that function into a single instance, but also just as easy to expose it as an inherited function built into the base class.

Only reason I'm not approving is that the Ironclad API module manager is going to be broken ('Test' as the name) and after checking where you were adding the discriminators, I'm realizing a SlackMessage or SlackChannel (or both) Mapping is an obvious good inclusion into the Slack API Module, and correspondingly we should add the IroncladWorkflow mapping to the Ironclad API Module.

@debbie-yu
Copy link
Contributor Author

@seanspeaks thanks for feedback, makes sense!

for

I do think we can take it a step further and when instantiating the IntegrationManager class, we can make the IntegrationMapping inherit/automatically know the integration ID, so all we're doing is finding a mapping by the sourceId; not sure yet if that's a helper function that loads up the available mappings for an integration (and therefore handles the discriminators), or if the dev needs to call it for each type of integration mapping... I'm envisioning something like const workflowConfig = await this.getIntegrationMapping('IroncladWorkflow', workflowId)

definitely agree this can be improved, as i was looking into it though thought it might be better to apply changes later after seeing how we use in ironclad-frigg and see if there any learnings for how we should handle. since i notice we'll set integration via receiveNotification and wanted to check if we'd need to use helper function to set integration first or could we assume for most times that it's set for us? questions i'm not too clear on but hoping once we implement in ironclad-frigg will become clear

@debbie-yu debbie-yu requested a review from seanspeaks March 31, 2023 21:48
Copy link
Contributor

@seanspeaks seanspeaks left a comment

Choose a reason for hiding this comment

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

This is 👌 Great 🙏 Thanks!

@debbie-yu debbie-yu merged commit 82c3b0f into main Apr 4, 2023
@seanspeaks
Copy link
Contributor

@seanspeaks seanspeaks added the released This issue/pull request has been released. label Apr 4, 2023
@seanspeaks seanspeaks deleted the debbie.yu/integration-mapping branch April 26, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants