Repository navigation
Feature: Add databaseResult, databaseResultList, and ignoreOrigin to CallableLogger - #1037
Open
jasonsiders wants to merge 15 commits into
Open
jasonsiders wants to merge 15 commits into
jasonsiders wants to merge 15 commits into
Conversation
Accepts any single or List Database.*Result type that LogEntryEventBuilder.setDatabaseResult has an overload for, so packages calling Nebula through System.Callable can attach DML results to an entry. Applied before the record arguments, so an explicit record wins over the record ID a single result sets.
Lets packages calling Nebula through System.Callable exclude their own classes from each entry's origin and stack trace in code, without an admin adding them to the IgnoredApexOrigins LoggerParameter record. Takes class names as strings so OmniStudio callers can use it too, and skips blank names, which would otherwise break stack trace parsing.
Read databaseResult once, tighten the ordering comment and ApexDoc, and use one mock result per list in the list test.
Wrap new comments, document the thrown exception, and drop a method-level PMD suppression the analyzer does not need.
The new tests push the class past PMD's 500-statement limit. Matches the class-level suppression in Logger_Tests, LogEntryEventBuilder_Tests, LogEntryEventHandler_Tests, and LogEntryHandler_Tests.
Remove the null databaseResult test: with containsKey, a null value takes the same unsupported-type path as any other value, like the other arguments pass null straight through. Restore Nebula's aligned ApexDoc continuation lines.
Mirror Logger.ignoreOrigin(System.Type) instead of taking a list of class name strings: the action now delegates to the global method directly, so it no longer depends on the deprecated LoggerStackTrace string overload, and a null or missing apexType fails the same way Logger.ignoreOrigin does, before anything is added to the ignored origins.
Match CallableLogger's one-key-per-shape convention (record, recordList, recordMap): databaseResult takes a single Database result and databaseResultList takes a list, each rejecting the other shape with an IllegalArgumentException. Replace the looping tests with one test per result type and shape, using the same assertions as the existing record tests.
Cast databaseResultList at the call site, like recordList and tags, so a single result passed as a list fails the same way a single record passed as recordList does. Cover the unsupported list type branch with its own test.
Add ignoreOrigin to the supported actions table and databaseResult / databaseResultList to the newEntry input keys table, both marked Apex only.
5 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
newEntry, and add anignoreOriginaction #1036 by adding newnewEntryargumentsdatabaseResultanddatabaseResultListtoCallableLogger, which pass Database results to the matchingLogEntryEventBuilder.setDatabaseResult()overload, following the existing record and recordList argumentsCallableLoggeractionignoreOrigin, which passes itsapexTypeargument toLogger.ignoreOrigin(), so packages can hide their logging wrapper from origins and stack traces without admins setting up theIgnoredApexOriginsrecordPMD.NcssCountrule on the test class.