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

Deprecated & replaced HttpRequestEndpoint__c fields with new HttpRequestEndpointAddress__c fields #773

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

The most robust observability solution for Salesforce experts. Built 100% natively on the platform, and designed to work seamlessly with Apex, Lightning Components, Flow, Process Builder & integrations.

## Unlocked Package - v4.14.11
## Unlocked Package - v4.14.12

[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oUgQAI)
[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oUgQAI)
[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oV0QAI)
[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oV0QAI)
[![View Documentation](./images/btn-view-documentation.png)](https://github.com/jongpie/NebulaLogger/wiki)

`sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oUgQAI`
`sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oV0QAI`

`sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oUgQAI`
`sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oV0QAI`

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler {
HttpRequestBodyMasked__c = logEntryEvent.HttpRequestBodyMasked__c,
HttpRequestCompressed__c = logEntryEvent.HttpRequestCompressed__c,
HttpRequestEndpoint__c = logEntryEvent.HttpRequestEndpoint__c,
HttpRequestEndpointAddress__c = logEntryEvent.HttpRequestEndpointAddress__c,
HttpRequestHeaderKeys__c = logEntryEvent.HttpRequestHeaderKeys__c,
HttpRequestHeaders__c = logEntryEvent.HttpRequestHeaders__c,
HttpRequestMethod__c = logEntryEvent.HttpRequestMethod__c,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,16 @@
<identifier>RecordHttpRequestEndpoint_cField1</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldInstanceProperties>
<name>uiBehavior</name>
<value>readonly</value>
</fieldInstanceProperties>
<fieldItem>Record.HttpRequestEndpointAddress__c</fieldItem>
<identifier>RecordHttpRequestEndpointAddress_cField1</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldInstanceProperties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@
<behavior>Readonly</behavior>
<field>HttpRequestEndpoint__c</field>
</layoutItems>
<layoutItems>
<behavior>Readonly</behavior>
<field>HttpRequestEndpointAddress__c</field>
</layoutItems>
<layoutItems>
<behavior>Readonly</behavior>
<field>HttpRequestMethod__c</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@
"localApiName": "HttpRequestEndpoint__c",
"type": "string"
},
"HttpRequestEndpointAddress__c": {
"apiName": "HttpRequestEndpointAddress__c",
"label": "HTTP Request Endpoint Address",
"localApiName": "HttpRequestEndpointAddress__c",
"type": "string"
},
"HttpRequestMethod__c": {
"apiName": "HttpRequestMethod__c",
"label": "HTTP Request Method",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>HttpRequestEndpointAddress__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>PII;GDPR;CCPA</complianceGroup>
<label>HTTP Request Endpoint Address</label>
<length>2000</length>
<securityClassification>Confidential</securityClassification>
<trackTrending>false</trackTrending>
<type>LongTextArea</type>
<visibleLines>3</visibleLines>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>HttpRequestEndpoint__c</fullName>
<businessStatus>Active</businessStatus>
<businessStatus>DeprecateCandidate</businessStatus>
<complianceGroup>None</complianceGroup>
<externalId>false</externalId>
<label>HTTP Request Endpoint</label>
<inlineHelpText>Deprecated: instead use the field HttpRequestEndpointAddress__c</inlineHelpText>
<label>DEPRECATED: HTTP Request Endpoint</label>
<length>255</length>
<required>false</required>
<securityClassification>Confidential</securityClassification>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,11 @@
<field>LogEntry__c.HttpRequestEndpoint__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>false</editable>
<field>LogEntry__c.HttpRequestEndpointAddress__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>false</editable>
<field>LogEntry__c.HttpRequestHeaderKeys__c</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,11 @@
<field>LogEntry__c.HttpRequestEndpoint__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>false</editable>
<field>LogEntry__c.HttpRequestEndpointAddress__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>false</editable>
<field>LogEntry__c.HttpRequestHeaderKeys__c</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,11 @@ global with sharing class LogEntryEventBuilder {
this.logEntryEvent.HttpRequestBody__c = cleanedRequestBody;
this.logEntryEvent.HttpRequestBodyMasked__c = requestBodyMasked;
this.logEntryEvent.HttpRequestCompressed__c = request.getCompressed();
this.logEntryEvent.HttpRequestEndpoint__c = request.getEndpoint();
this.logEntryEvent.HttpRequestEndpoint__c = LoggerDataStore.truncateFieldValue(Schema.LogEntryEvent__e.HttpRequestEndpoint__c, request.getEndpoint());
this.logEntryEvent.HttpRequestEndpointAddress__c = LoggerDataStore.truncateFieldValue(
Schema.LogEntryEvent__e.HttpRequestEndpointAddress__c,
request.getEndpoint()
);
this.logEntryEvent.HttpRequestHeaderKeys__c = formattedHeaderKeysString;
this.logEntryEvent.HttpRequestHeaders__c = LoggerDataStore.truncateFieldValue(Schema.LogEntryEvent__e.HttpRequestHeaders__c, formattedHeadersString);
this.logEntryEvent.HttpRequestMethod__c = request.getMethod();
Expand Down
2 changes: 1 addition & 1 deletion nebula-logger/core/main/logger-engine/classes/Logger.cls
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
global with sharing class Logger {
// There's no reliable way to get the version number dynamically in Apex
@TestVisible
private static final String CURRENT_VERSION_NUMBER = 'v4.14.11';
private static final String CURRENT_VERSION_NUMBER = 'v4.14.12';
private static final System.LoggingLevel FALLBACK_LOGGING_LEVEL = System.LoggingLevel.DEBUG;
private static final List<LogEntryEventBuilder> LOG_ENTRIES_BUFFER = new List<LogEntryEventBuilder>();
private static final String MISSING_SCENARIO_ERROR_MESSAGE = 'No logger scenario specified. A scenario is required for logging in this org.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import FORM_FACTOR from '@salesforce/client/formFactor';
import { log as lightningLog } from 'lightning/logger';
import { LoggerStackTrace } from './loggerStackTrace';

const CURRENT_VERSION_NUMBER = 'v4.14.11';
const CURRENT_VERSION_NUMBER = 'v4.14.12';

const LOGGING_LEVEL_EMOJIS = {
ERROR: '⛔',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>HttpRequestEndpointAddress__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>HTTP Request Endpoint Address</label>
<length>2000</length>
<securityClassification>Confidential</securityClassification>
<type>LongTextArea</type>
<visibleLines>5</visibleLines>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>HttpRequestEndpoint__c</fullName>
<businessStatus>Active</businessStatus>
<businessStatus>DeprecateCandidate</businessStatus>
<complianceGroup>None</complianceGroup>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>HTTP Request Endpoint</label>
<label>DEPRECATED: HTTP Request Endpoint</label>
<length>255</length>
<required>false</required>
<securityClassification>Confidential</securityClassification>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,7 @@ private class LogEntryEventHandler_Tests {
HttpRequestBodyMasked__c,
HttpRequestCompressed__c,
HttpRequestEndpoint__c,
HttpRequestEndpointAddress__c,
HttpRequestHeaderKeys__c,
HttpRequestHeaders__c,
HttpRequestMethod__c,
Expand Down Expand Up @@ -1616,6 +1617,11 @@ private class LogEntryEventHandler_Tests {
System.Assert.areEqual(logEntryEvent.HttpRequestBodyMasked__c, logEntry.HttpRequestBodyMasked__c, 'logEntry.HttpRequestBodyMasked__c was not properly set');
System.Assert.areEqual(logEntryEvent.HttpRequestCompressed__c, logEntry.HttpRequestCompressed__c, 'logEntry.HttpRequestCompressed__c was not properly set');
System.Assert.areEqual(logEntryEvent.HttpRequestEndpoint__c, logEntry.HttpRequestEndpoint__c, 'logEntry.HttpRequestEndpoint__c was not properly set');
System.Assert.areEqual(
logEntryEvent.HttpRequestEndpointAddress__c,
logEntry.HttpRequestEndpointAddress__c,
'logEntry.HttpRequestEndpointAddress__c was not properly set'
);
System.Assert.areEqual(logEntryEvent.HttpRequestHeaderKeys__c, logEntry.HttpRequestHeaderKeys__c, 'logEntry.HttpRequestHeaderKeys__c was not properly set');
System.Assert.areEqual(logEntryEvent.HttpRequestHeaders__c, logEntry.HttpRequestHeaders__c, 'logEntry.HttpRequestHeaders__c was not properly set');
System.Assert.areEqual(logEntryEvent.HttpRequestMethod__c, logEntry.HttpRequestMethod__c, 'logEntry.HttpRequestMethod__c was not properly set');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1280,14 +1280,20 @@ private class LogEntryEventBuilder_Tests {
System.HttpRequest request = new System.HttpRequest();
request.setBody('Hello, world!');
request.setCompressed(true);
request.setEndpoint('https://fake.salesforce.com');

String reallyLongEndpointAddress = 'https://fake.salesforce.com/' + 'A'.repeat(LogEntryEvent__e.HttpRequestEndpoint__c.getDescribe().getLength() + 1);
request.setEndpoint(reallyLongEndpointAddress);
request.setMethod('GET');

builder.setHttpRequestDetails(request);

System.Assert.areEqual(request.getBody(), event.HttpRequestBody__c);
System.Assert.areEqual(request.getCompressed(), event.HttpRequestCompressed__c);
System.Assert.areEqual(request.getEndpoint(), event.HttpRequestEndpoint__c);
System.Assert.areEqual(reallyLongEndpointAddress.left(LogEntryEvent__e.HttpRequestEndpoint__c.getDescribe().getLength()), event.HttpRequestEndpoint__c);
System.Assert.areEqual(
reallyLongEndpointAddress.left(LogEntryEvent__e.HttpRequestEndpointAddress__c.getDescribe().getLength()),
event.HttpRequestEndpointAddress__c
);
System.Assert.isNull(event.HttpRequestHeaderKeys__c);
System.Assert.isNull(event.HttpRequestHeaders__c);
System.Assert.areEqual(request.getMethod(), event.HttpRequestMethod__c);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nebula-logger",
"version": "4.14.11",
"version": "4.14.12",
"description": "The most robust logger for Salesforce. Works with Apex, Lightning Components, Flow, Process Builder & Integrations. Designed for Salesforce admins, developers & architects.",
"author": "Jonathan Gillespie",
"license": "MIT",
Expand Down
7 changes: 4 additions & 3 deletions sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"path": "./nebula-logger/core",
"definitionFile": "./config/scratch-orgs/base-scratch-def.json",
"scopeProfiles": true,
"versionNumber": "4.14.11.NEXT",
"versionName": "Updated Behavior of Logger.setAsyncContext()",
"versionDescription": "Updated the behavior of Logger.setAsyncContext() to only set the context the first time a non-null context value is provided. Previously, subsequent calls would overwrite the context value, which wasn't really the intended behaviour.",
"versionNumber": "4.14.12.NEXT",
"versionName": "Replaced HttpRequestEndpoint__c with HttpRequestEndpointAddress__c",
"versionDescription": "Deprecated the HttpRequestEndpoint__c fields on LogEntryEvent__e and LogEntry__c, and replaced them with new HttpRequestEndpointAddress__c fields that have a much longer max length (2,000 vs 255)",
"releaseNotesUrl": "https://github.com/jongpie/NebulaLogger/releases",
"unpackagedMetadata": {
"path": "./nebula-logger/extra-tests"
Expand Down Expand Up @@ -196,6 +196,7 @@
"Nebula Logger - Core@4.14.9-bugfix:-apex-code-snippets-auto-truncated": "04t5Y0000015oSQQAY",
"Nebula Logger - Core@4.14.10-new-callablelogger-apex-class": "04t5Y0000015oTdQAI",
"Nebula Logger - Core@4.14.11-updated-behavior-of-logger.setasynccontext()": "04t5Y0000015oUgQAI",
"Nebula Logger - Core@4.14.12-replaced-httprequestendpoint__c-with-httprequestendpointaddress__c": "04t5Y0000015oV0QAI",
"Nebula Logger - Core Plugin - Async Failure Additions": "0Ho5Y000000blO4SAI",
"Nebula Logger - Core Plugin - Async Failure Additions@1.0.0": "04t5Y0000015lhiQAA",
"Nebula Logger - Core Plugin - Async Failure Additions@1.0.1": "04t5Y0000015lhsQAA",
Expand Down