-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Created new LoggerScenario__c custom object #356
Conversation
…e old text field, Log__c.Scenario__c
…rio__c within LogEntryEventHandler
… fields, added some extra tests in LogEntryEventHandler_Tests for creating LogScenario__c records
…try event stream & log scenarios at the top of the list
…tryEventHandler.cls
…liases, cleaned up sfdx-project.json & README files
…legacy support - it may get removed in a future release, but will keep it for now
…io__c.UniqueId__c a required field, added a 'My Assigned Log Scenarios' list view
be018d2
to
201b7ac
Compare
…ueId__c is required, and Name is auto-populated (when null) to a truncated version of UniqueId__c
201b7ac
to
4c25045
Compare
nebula-logger/core/main/log-management/objects/Log__c/fields/ApiVersion__c.field-meta.xml
Show resolved
Hide resolved
@@ -836,7 +908,12 @@ private class LogEntryEventHandler_Tests { | |||
System.assertEquals(logEntryEvent.ParentLogTransactionId__c, log.ParentLogTransactionId__c, 'log.ParentLogTransactionId__c was not properly set'); | |||
System.assertEquals(logEntryEvent.ProfileId__c, log.ProfileId__c, 'log.ProfileId__c was not properly set'); | |||
System.assertEquals(logEntryEvent.ProfileName__c, log.ProfileName__c, 'log.ProfileName__c was not properly set'); | |||
System.assertEquals(logEntryEvent.Scenario__c, log.Scenario__c, 'log.Scenario__c was not properly set'); | |||
System.assertEquals( | |||
logEntryEvent.Scenario__c?.left(Schema.LogScenario__c.Name.getDescribe().getLength()), |
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.
what's the mechanism here that's setting the Scenario here? I didn't see anything in setup creating a scenario record, and the assert makes it seem like there could be truncation at play here, as well?
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.
Oh maybe it's just not part of the diff because I see you were previously asserting on the Scenario being set ...
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.
@jongpie LGTM! Just a couple of comments here and there but everything looks great!
@jamessimone thanks for reviewing! I'll finish the object rename & incorporating your comments, and then I'll publish this release today or tomorrow! |
6cf5b75
to
a2b6b1e
Compare
…io__c to Log__c.TransactionScenario__c
a2b6b1e
to
1477eb2
Compare
1bcd2e9
to
b70f6e6
Compare
b70f6e6
to
5608e6f
Compare
Codecov ReportBase: 95.14% // Head: 95.18% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #356 +/- ##
==========================================
+ Coverage 95.14% 95.18% +0.03%
==========================================
Files 51 52 +1
Lines 4989 5023 +34
Branches 96 96
==========================================
+ Hits 4747 4781 +34
Misses 238 238
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
* Closed #347 & #356 by deprecating LogScenarioRule__mdt object & replacing it with a new object LoggerScenarioRule__mdt that provides optional overrides for all fields on LoggerSettings__c * Added new Apex class LogScenarioRule to manage accessing LoggerScenarioRule__mdt CMDT records * Incorporated the stellar idea from @jamessimone to tie LogEntry__c records to the new LoggerScenario__c object via a new lookup field LogEntry__c.EntryScenario__c * Added new method Logger.endScenario(String) so that Apex developers can explicitly end a scenario, which then automatically rolls back to the previous scenario (and re-applies the previous scenario rule, if one exists) - another fantastic suggestion from @jamessimone * Renamed LoggerSettings__c.DefaultLogScenario__c to LoggerSettings__c.DefaultScenario__c for consistency * Fixed #360 by changing Logger.logDatabaseErrors() overloads to always return a non-null instance of LogEntryEventBuilder * Updated some formatting in SlackLoggerPlugin to better format stack traces & create new plugin package version v1.5.0 * Fixed #363 by correcting some references in the migration script ./scripts/data/migrate-log-scenario-field-to-logger-scenario-object.apex * Added content in README that links to the wiki's architecture overview * Removed build numbers for package versions in sfdx-project.json, upgraded some packages in package.json to resolve some GitHub security alerts
Closes #349 by deprecating the field
Log__c.Scenario__c
and replacing it with a new optional lookupLog__c.TransactionScenario__c
that leverages the new custom objectLoggerScenario__c
. TheLoggerScenario__c
object does not currently have any automation built-in - this PR is focused on just getting the object introduced, more features will be added later.Added
LoggerScenario__c
object with a uniqued external ID fieldLoggerScenario__c .Unique__c
- this is set based on the valueLogEntryEvent__e.Scenario__c
(which can be set usingLogger.setScenario(String)
Added new "Logger Scenarios" tab to the Logger Console app, and rearranged the ordering of the included tabs
Added skeleton trigger handler class
LoggerScenarioHandler
- there's currently no object-specific logic implemented, but this provides an entry point for plugins. Additional logic will probably also be incorporated as part of Add more fields to LogScenarioRule__mdt #355Added flexipage, page layout, compact layout, etc for the new object. I've arranged the UI to mimic the UI of the
Log__c
object's flexipage/layoutAdded an Apex script
./scripts/data/migrate-log-scenario-field-to-logger-scenario-object.apex
that migrates existing data from the text fieldLog__c.Scenario__c
to the new object & lookupLog__c.TransactionScenario__c
.Log__c
records need to be updated, the script may need to be executed multiple times. It's not ideal, but this approach is easier that deploying a new, temporary batch job to do it in bulk.Updated
LoggerAdmin
, LoggerLogViewer, and
LoggerEndUserpermission sets to have access to the new
LoggerScenario__c` objectUpdated
LoggerEndUser
permission set to have read-only access to the tagging & scenario custom objects