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

Double Feature: support for OmniStudio + loosely-coupled dependencies #765

Merged
merged 6 commits into from
Sep 17, 2024

Conversation

jongpie
Copy link
Owner

@jongpie jongpie commented Sep 16, 2024

Core Unlocked Package Changes

New Support for Loosely-Coupled Dependencies

Resolved #371 by introducing a new CallableLogger Apex class that implements Apex's Callable interface - see the new wiki page for full docs. This class provides dynamic access to Nebula Logger's core features - ISVs and package developers can use this to optionally leverage Nebula Logger in a customer's org when it's available, without requiring a package dependency.

For example, this sample code can be executed in any Salesforce org - and when Nebula Logger is available, 2 log entries will be saved.

// Dynamically create a instance Nebula Logger's Callable Apex class (if it's available)
Type nebulaLoggerCallableType = Type.forName('Nebula', 'CallableLogger') ?? Type.forName('CallableLogger');
Callable nebulaLoggerCallable = (Callable) nebulaLoggerCallableType?.newInstance();
if (nebulaLoggerCallable == null) {
  return;
}

// Example action: Add a basic "hello, world!" INFO entry
Map<String, Object> infoEntryInput = new Map<String, Object>{
  'loggingLevel' => System.LoggingLevel.INFO,
  'message' => 'hello, world!'
};
nebulaLoggerCallable.call('newEntry', infoEntryInput);

// Example action: Add an ERROR entry with an Apex exception
Exception someException = new DmlException('oops');
Map<String, Object> errorEntryInput = new Map<String, Object>{
  'exception' => someException,
  'loggingLevel' => LoggingLevel.ERROR,
  'message' => 'An unexpected exception was thrown'
};
nebulaLoggerCallable.call('newEntry', errorEntryInput);

// Example: Save any pending log entries
nebulaLoggerCallable.call('saveLog', null);

New Support for OmniStudio Logging

Resolved #644 by adding support for logging in OmniStudio, using the new CallableLogger Apex class - see the new wiki page for full docs. The included CallableLogger Apex class can be used in:

Once you've added logging in OmniStudio, any log entries generated in OmniStudio can be seen using the LogEntry__c object's included list view AllOmniStudioLogEntries

image

Slack Plugin Package Changes

Fixed #764 by correcting the logic used in SlackLoggerPlugin to format text fields containing line breaks

Documentation Changes

Started rewriting & consolidating all documentation to live just in the wiki. Currently, content is split across the wiki, README.md, and the GitHub Pages site

  • README.md has been updated to link to wiki pages (instead of putting all content directly into README.md)
  • Eventually most of the content current in README.md will be removed/moved to the wiki

Pipeline Changes

  • Renamed all of the scratch definition files (again 😅 )
  • Updated build.yml so that 2 additional scratch orgs (6 total) are used for automated testing in the pipeline
    • "Advanced" scratch org (formerly called the 'dev' scratch org) - existing scratch org, but was not previously used by the pipeline
    • "OmniStudio" scratch org - new scratch definition file, used to validate that queries on OmniProcess work correctly, and to validate that sample OmniScript and OmniIntegrationProcedure metadata that leverage CallableLogger can successfully be deployed

…renamed), added sample OmniStudio metadata to use in the pipeline (for orgs with OmniStudio configured)
…led dependencies, as well as for adding support for logging in OmniStudio
@jongpie jongpie added Type: Enhancement New feature or request devops Items related to tooling, automation, and guidelines used for developing Nebula Logger Logging Source: Apex Items related to using Logger within Apex Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Feature: Tags Items related to Nebula Logger's tagging/labeling functionality Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Feature: Scenario-Based Logging Items related to Logger.setScenario(), LoggerScenarioRule__mdt, etc. Salesforce Feature: OmniStudio Items related to using Nebula Logger within OmniStudio Salesforce Feature: Callable Interface Items related to dynamically using Nebula Logger via the Apex's Callable interface Logging Source: OmniStudio Items related to using Nebula Logger within OmniStudio labels Sep 16, 2024
@jongpie jongpie temporarily deployed to Event Monitoring Scratch Org September 16, 2024 00:08 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Advanced Scratch Org September 16, 2024 00:08 — with GitHub Actions Inactive
@jongpie jongpie changed the title Double Feature: support for OmniStudio + support for loosely-coupled dependencies Double Feature: support for OmniStudio + loosely-coupled dependencies Sep 16, 2024
@jongpie jongpie had a problem deploying to Platform Cache Scratch Org September 16, 2024 00:21 — with GitHub Actions Failure
@jongpie jongpie added the Salesforce Feature: Package Dependency Items related to ISVs/2GP packages that want to integrate with one of Nebula Logger's packages label Sep 16, 2024
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org September 16, 2024 00:47 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Platform Cache Scratch Org September 16, 2024 01:21 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to OmniStudio Scratch Org September 16, 2024 01:34 — with GitHub Actions Inactive
@jongpie jongpie force-pushed the feature/callable-logger branch from 5f742f1 to 6554537 Compare September 16, 2024 02:35
@jongpie jongpie temporarily deployed to Advanced Scratch Org September 16, 2024 02:40 — with GitHub Actions Inactive
…rt' boolean, used to determine how to format long text blocks & blocks with line breaks
@jongpie jongpie force-pushed the feature/callable-logger branch from 262698d to 4476cbe Compare September 16, 2024 20:22
@jongpie jongpie had a problem deploying to Advanced Scratch Org September 16, 2024 20:26 — with GitHub Actions Failure
@jongpie jongpie had a problem deploying to Event Monitoring Scratch Org September 16, 2024 20:26 — with GitHub Actions Failure
@jongpie jongpie had a problem deploying to Advanced Scratch Org September 16, 2024 20:26 — with GitHub Actions Failure
@jongpie jongpie had a problem deploying to Event Monitoring Scratch Org September 16, 2024 20:26 — with GitHub Actions Failure
@jongpie jongpie had a problem deploying to OmniStudio Scratch Org September 16, 2024 20:39 — with GitHub Actions Failure
@jongpie jongpie had a problem deploying to Event Monitoring Scratch Org September 16, 2024 20:41 — with GitHub Actions Failure
@jongpie jongpie had a problem deploying to OmniStudio Scratch Org September 16, 2024 20:58 — with GitHub Actions Error
@jongpie jongpie temporarily deployed to Advanced Scratch Org September 16, 2024 21:02 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Event Monitoring Scratch Org September 16, 2024 21:02 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to OmniStudio Scratch Org September 16, 2024 21:02 — with GitHub Actions Inactive
@jongpie jongpie had a problem deploying to Platform Cache Scratch Org September 16, 2024 21:14 — with GitHub Actions Failure
@jongpie jongpie had a problem deploying to Experience Cloud Scratch Org September 16, 2024 21:24 — with GitHub Actions Failure
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 92.06349% with 10 lines in your changes missing coverage. Please review.

Project coverage is 92.24%. Comparing base (ff06c25) to head (4476cbe).

Files with missing lines Patch % Lines
...g-management/classes/LogManagementDataSelector.cls 30.00% 7 Missing ⚠️
...re/main/log-management/classes/LogEntryHandler.cls 89.65% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #765      +/-   ##
==========================================
- Coverage   93.17%   92.24%   -0.93%     
==========================================
  Files          67       74       +7     
  Lines        6974     7211     +237     
  Branches      199      199              
==========================================
+ Hits         6498     6652     +154     
- Misses        448      531      +83     
  Partials       28       28              
Flag Coverage Δ
Apex 94.23% <92.00%> (-1.23%) ⬇️
LWC 83.26% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org September 16, 2024 22:15 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Platform Cache Scratch Org September 16, 2024 22:15 — with GitHub Actions Inactive
@jongpie jongpie marked this pull request as ready for review September 17, 2024 18:34
@jongpie jongpie merged commit 1629291 into main Sep 17, 2024
1 of 12 checks passed
@jongpie jongpie deleted the feature/callable-logger branch September 17, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Items related to tooling, automation, and guidelines used for developing Nebula Logger Feature: Scenario-Based Logging Items related to Logger.setScenario(), LoggerScenarioRule__mdt, etc. Feature: Tags Items related to Nebula Logger's tagging/labeling functionality Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Logging Source: Apex Items related to using Logger within Apex Logging Source: OmniStudio Items related to using Nebula Logger within OmniStudio Plugin: Slack Salesforce Feature: Callable Interface Items related to dynamically using Nebula Logger via the Apex's Callable interface Salesforce Feature: OmniStudio Items related to using Nebula Logger within OmniStudio Salesforce Feature: Package Dependency Items related to ISVs/2GP packages that want to integrate with one of Nebula Logger's packages Type: Enhancement New feature or request
Projects
None yet
2 participants