-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[BUG] Apollo.io triggers are not logging anything #15991
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
[BUG] Apollo.io triggers are not logging anything #15991
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughMultiple files across the Apollo.io component were updated. Most changes involve version number increments and renaming of exported methods. In one action file, the contact-fetch method was changed from Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ApolloApp
participant HTTPServer
Client->>ApolloApp: Invoke HTTP-specific method (e.g., put/post)
ApolloApp->>HTTPServer: Send corresponding HTTP request
HTTPServer-->>ApolloApp: Return response
ApolloApp->>Client: Return processed result
sequenceDiagram
participant App
participant Utils
participant Logger
App->>App: Call paginate(args)
App->>Utils: Invoke iterate(iterations)
Utils-->>App: Return aggregated items
App->>Logger: Log resource counts (fetched, emitted, filtered)
Assessment against linked issues
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
components/apollo_io/actions/add-contacts-to-sequence/add-contacts-to-sequence.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/apollo_io/actions/create-update-contact/create-update-contact.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/apollo_io/actions/create-contact/create-contact.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (24)
🚧 Files skipped from review as they are similar to previous changes (23)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (7)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
components/apollo_io/actions/search-accounts/search-accounts.mjs (1)
56-56:⚠️ Potential issueCode reference needs to be updated to match renamed utility function
The code is calling
utils.streamIterator(resourcesStream), but this function has been renamed toiteratein the utils.mjs file. This will cause runtime errors when executed.- const accounts = await utils.streamIterator(resourcesStream); + const accounts = await utils.iterate(resourcesStream);
🧹 Nitpick comments (3)
components/apollo_io/actions/update-account-stage/update-account-stage.mjs (1)
8-8: Version Update and Logging Inclusion.
The exported action’s version is correctly updated to "0.0.5". Additionally, the use of$.export("$summary", …)in the run method confirms that a summary message is being logged, which should help with debugging Apollo.io triggers. Please verify that the logged information meets your debugging requirements.components/apollo_io/actions/search-sequences/search-sequences.mjs (1)
26-26: Resource Name Consistency Check.
TheresourceNameis set to"emailer_campaigns", yet the action is designed to search for sequences. Please verify that this naming is intentional; if not, consider renaming it (e.g., to"sequences") to better reflect the resource being queried.components/apollo_io/sources/contact-created/contact-created.mjs (1)
21-21: Added debug property.Enabling debug logs can be very helpful for troubleshooting. Ensure that sensitive data or PII is not inadvertently exposed in logs.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (23)
components/apollo_io/actions/create-account/create-account.mjs(1 hunks)components/apollo_io/actions/create-contact/create-contact.mjs(1 hunks)components/apollo_io/actions/create-opportunity/create-opportunity.mjs(1 hunks)components/apollo_io/actions/create-update-contact/create-update-contact.mjs(2 hunks)components/apollo_io/actions/get-opportunity/get-opportunity.mjs(1 hunks)components/apollo_io/actions/people-enrichment/people-enrichment.mjs(1 hunks)components/apollo_io/actions/search-accounts/search-accounts.mjs(1 hunks)components/apollo_io/actions/search-contacts/search-contacts.mjs(1 hunks)components/apollo_io/actions/search-sequences/search-sequences.mjs(1 hunks)components/apollo_io/actions/update-account-stage/update-account-stage.mjs(1 hunks)components/apollo_io/actions/update-account/update-account.mjs(1 hunks)components/apollo_io/actions/update-contact-stage/update-contact-stage.mjs(1 hunks)components/apollo_io/actions/update-contact/update-contact.mjs(1 hunks)components/apollo_io/actions/update-opportunity/update-opportunity.mjs(1 hunks)components/apollo_io/apollo_io.app.mjs(10 hunks)components/apollo_io/common/constants.mjs(1 hunks)components/apollo_io/common/utils.mjs(2 hunks)components/apollo_io/package.json(1 hunks)components/apollo_io/sources/account-created/account-created.mjs(2 hunks)components/apollo_io/sources/account-updated/account-updated.mjs(2 hunks)components/apollo_io/sources/common/polling.mjs(1 hunks)components/apollo_io/sources/contact-created/contact-created.mjs(2 hunks)components/apollo_io/sources/contact-updated/contact-updated.mjs(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (54)
components/apollo_io/common/constants.mjs (2)
3-3: Added pagination limit to optimize API requests.Adding a
DEFAULT_LIMITconstant is a good practice for API interactions. This helps prevent excessive data retrieval and potential timeouts that could have been impacting logging functionality.
9-9: LGTM: Properly exported the new constant.The
DEFAULT_LIMITconstant is correctly exposed in the default export, making it available to other modules that import from this file.components/apollo_io/package.json (1)
3-3: Version Bump Confirmed.
The version has been updated to "0.5.1" as expected. This change is a straightforward version bump without affecting functionality.components/apollo_io/actions/search-sequences/search-sequences.mjs (1)
9-9: Version Update Verified.
The version update to "0.0.4" is consistent with the overall module versioning strategy.components/apollo_io/actions/update-contact/update-contact.mjs (1)
9-9: Version Update Confirmed.
The action’s version is updated to "0.0.6", aligning with the coordinated version bumps across the component. The logging via$.export("$summary", …)after updating the contact is also appropriately handled.components/apollo_io/actions/search-contacts/search-contacts.mjs (1)
9-9: Version Update Verified.
The action’s version has been correctly updated to "0.0.4". The summary logging in the run method is intact and should assist with logging trigger behavior.components/apollo_io/actions/get-opportunity/get-opportunity.mjs (1)
8-8: Version Increment and Logging ConfirmationThe version update to
"0.0.4"is consistent with the coordinated release effort. The action still exports a summary log (line 24) which should help with tracing trigger execution. If Apollo.io triggers were previously not logging, please verify that the environment correctly interprets the$.export("$summary", ...)mechanism.components/apollo_io/actions/update-opportunity/update-opportunity.mjs (1)
8-8: Consistent Version Update and Log OutputThe version change to
"0.0.4"appears appropriate. The summary logging on success remains intact (line 73). Ensure that your logging configuration captures the export messages so that Apollo.io triggers now correctly log information.components/apollo_io/actions/update-contact-stage/update-contact-stage.mjs (1)
8-8: Version Bump with Logging VerificationThe version number update to
"0.0.5"is in line with other modules. The summary message (lines 36–39) confirms that an update log is being generated. Please double-check that the trigger infrastructure now picks up these logs as expected.components/apollo_io/actions/people-enrichment/people-enrichment.mjs (1)
8-8: Version Update and Enhanced Action OperationThe version is incremented to
"0.0.7", and the action’s functionality (including additional properties and method calls) remains unaffected. The exported summary log on line 152 should help in verifying trigger activity. If logging issues persist, consider validating that the runtime accepts the$summaryexport from asynchronous actions.components/apollo_io/actions/create-contact/create-contact.mjs (1)
8-8: Version Bump with Correct Summary LoggingThe update to version
"0.0.6"is consistent with the other Apollo.io actions. The summary export (line 91) confirms that logging is in place upon contact creation. As with the other actions, please ensure that these summary logs are processed by your trigger mechanism.components/apollo_io/actions/search-accounts/search-accounts.mjs (1)
9-9: Version bump reflects dependency updateThe version has been incremented from "0.0.3" to "0.0.4", which aligns with the changes made to the utility functions in the common directory.
components/apollo_io/actions/update-account/update-account.mjs (1)
9-9: Version bump looks goodThe version has been incremented from "0.0.4" to "0.0.5", which is appropriate for tracking changes across the component.
components/apollo_io/actions/create-account/create-account.mjs (1)
8-8: Version bump looks goodThe version has been incremented from "0.0.4" to "0.0.5", aligning with the version updates in other Apollo.io actions.
components/apollo_io/actions/create-opportunity/create-opportunity.mjs (1)
8-8: Version bump looks goodThe version has been incremented from "0.0.3" to "0.0.4", keeping consistent with the versioning strategy across components.
components/apollo_io/common/utils.mjs (2)
19-19: Export updated correctlyThe export has been updated to match the renamed function.
1-7:❓ Verification inconclusive
Function rename improves clarity but requires updates to all references
The function
streamIteratorhas been renamed toiteratewith corresponding parameter and variable name changes. While this improves clarity, any files that reference the old function name will need to be updated.The function name change is good, but please ensure all references to
streamIteratoracross the codebase are updated toiterate. At minimum, thesearch-accounts.mjsfile needs to be updated as it still uses the old function name.
🏁 Script executed:
#!/bin/bash # Find all references to the old function name across the codebase echo "Searching for references to streamIterator in the codebase:" rg -l "streamIterator" --type js --type mjs components/apollo_io/Length of output: 222
Below is a revised shell script that explicitly adds support for the “.mjs” file type so that we can correctly verify that no lingering references to
streamIteratorexist in the codebase:#!/bin/bash # Define file type for .mjs and search for references to 'streamIterator' in components/apollo_io rg --type-add 'mjs:*.mjs' -l "streamIterator" components/apollo_io/Please run this script to verify that all references to
streamIteratorhave been updated toiterate(especially in files likesearch-accounts.mjs). Once you confirm that there are no remaining matches, the function renaming should be fully integrated across the codebase.components/apollo_io/actions/create-update-contact/create-update-contact.mjs (2)
9-9: Version increment looks good.The version has been updated from "0.0.2" to "0.0.3", which is appropriate for this bugfix change.
91-95: Method change fromlistContactstosearchContactslooks good.This change aligns with the overall PR objective to fix logging issues in Apollo.io triggers. The switch to
searchContactsis likely part of a consistent approach to use named methods that better reflect their HTTP operations.components/apollo_io/sources/contact-updated/contact-updated.mjs (3)
7-7: Improved description clarity.The description has been updated to more accurately reflect the component's behavior, changing from "Triggers when a contact is updated" to "Emit new event when a contact is updated."
9-9: Version increment is appropriate.The version has been updated from "0.0.6" to "0.0.7" to reflect the changes in this PR.
21-21: Added debugging to resolve logging issues.Adding
debug: trueis crucial for addressing the PR's main objective - fixing the issue where Apollo.io triggers weren't logging anything. This parameter will enable enhanced logging for troubleshooting and visibility.components/apollo_io/sources/common/polling.mjs (4)
38-40: Simplified stream processing logic.The
processStreamEventsmethod has been updated to accept an array of resources directly instead of a stream, making the code more straightforward and easier to maintain.
41-43: Added critical logging statements.These console.log statements directly address the PR's core objective by adding explicit logging of resource count metrics:
- Total resources fetched
- Number of resources emitted
- Number of resources filtered out
This will provide much-needed visibility into the trigger's operation.
47-51: Switched to pagination-based resource retrieval.The implementation now uses
this.app.paginateinstead ofthis.app.getResourcesStream, which aligns with the updatedprocessStreamEventsmethod that expects an array of resources rather than a stream.
53-53: Simplified event processing call.This change passes resources directly to
processStreamEvents, which is consistent with the method's updated signature.components/apollo_io/sources/account-updated/account-updated.mjs (4)
8-8: Improved description clarity.The description has been updated to more accurately reflect the component's behavior, changing from "Triggers when an account is updated" to "Emit new event when an account is updated."
10-10: Version increment is appropriate.The version has been updated from "0.0.4" to "0.0.5" to reflect the changes in this PR.
37-37: Method change fromlistAccountstosearchAccountslooks good.This change aligns with the overall PR objective and is consistent with similar changes in other files, shifting to more explicitly named methods.
41-41: Added debugging to resolve logging issues.Adding
debug: trueenables enhanced logging capabilities for this trigger, directly addressing the PR's main objective of fixing the logging issues with Apollo.io triggers.components/apollo_io/sources/contact-created/contact-created.mjs (2)
6-7: Renamed source title and description.This updated naming convention is clearer and more descriptive.
9-9: Bumped version to 0.0.7.Incrementing the version helps signal new functionality or fixes.
components/apollo_io/sources/account-created/account-created.mjs (4)
6-7: Updated source title and description.This name and description now better reflect the event.
9-9: Incremented version to 0.0.5.Version bump aligns with added functionality.
30-30: Switched from listAccounts to searchAccounts.This change appears consistent with the broader shift to the
searchAccountsmethod. Confirm that all uses of the old function are migrated.
34-34: Enabled debug mode.This should facilitate improved logging visibility.
components/apollo_io/apollo_io.app.mjs (18)
3-3: Imported utils.This import is necessary for the new pagination logic and is a welcome addition.
14-14: Using searchAccounts within prop definition.Replacing any previous list method with
searchAccountsshould expand filtering and querying capabilities.
32-32: Using searchContacts within prop definition.This similarly streamlines contact lookups with advanced filtering.
247-249: Introduced dedicated PUT method.Defining an explicit method for PUT requests clarifies intent and HTTP usage.
253-255: Introduced dedicated PATCH method.Having a separate PATCH method aligns with standard REST conventions.
272-275: listSequences now uses POST.Switching from a shared listing approach to an explicit POST for searching email campaigns is consistent with the app’s new method pattern.
303-305: createContact calls POST.This approach follows standard RESTful practices for resource creation.
310-313: updateContact now uses PUT.A clear indication that we're fully updating a contact record.
316-319: updateContactStage calls POST.Centralizing stage updates under POST is a logical extension of the new naming conventions.
322-325: createAccount calls POST.Good to see explicit, consistent HTTP methods for resource creation.
328-331: createOpportunity calls POST.Follows the pattern of using POST for resource creation.
336-339: updateOpportunity now uses PATCH.Patch is appropriate for partial resource updates.
352-355: updateAccount uses PUT.Adopting PUT clarifies that we’re likely making a full update.
358-361: updateAccountStage calls POST.This standardized pattern avoids confusion by grouping update logic under similar method signatures.
366-369: addContactsToSequence calls POST.Ensures consistency when adding resources in bulk.
372-375: searchAccounts calls POST.Further unification of search endpoints under POST.
378-381: searchContacts calls POST.Matches the new approach to searching resources.
389-435: Refactored iteration and pagination logic.Introducing
getIterationsandpaginatecreates a more scalable, modular way to handle multi-page data. Verify that logs won’t expose sensitive records in production.
4005b7f to
1ad3be0
Compare
1ad3be0 to
5e62d8d
Compare
5e62d8d to
0109758
Compare
|
/approve |
WHY
Resolves #15841
Summary by CodeRabbit