Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
peternhale authored Dec 20, 2023
2 parents 64a7728 + 45c87a7 commit 4513562
Show file tree
Hide file tree
Showing 40 changed files with 283 additions and 268 deletions.
4 changes: 1 addition & 3 deletions contributing/publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ If any code changes are made between the time the release branch is automaticall

## Updating the Change Log

The action that creates the release branch will also generate the change log and push those changes to the release branch. The change log can also be generated manually, if need be, following the instructions below.

After the release branch is created, the changelog needs to be updated. To do so, the engineer should go into VSCode, pull the latest changes, and switch to the release branch. Then, they should open a Terminal window and run `npm run changelog` to generate the changelog entry for the upcoming release. This task will gather commits that should be published (like `feat` or `fix`) and write the update to `CHANGELOG.md`. If there are no commits worth publishing (for instance, if everything was a `chore` or a `ci` commit), then the changelog entry for the upcoming release can be skipped. If a changelog is necessary, the engineer will then push the changelog to the release branch with the commit name of `chore: generated CHANGELOG for vXX.YY.ZZ`, where XX.YY.ZZ are the numbers of the current release.
The changelog will be automatically generated as part of the Create Release Branch workflow. This task will gather commits that should be published (like `feat` or `fix`) and write the update to `CHANGELOG.md`. If there are no commits worth publishing (for instance, if everything was a `chore` or a `ci` commit), then the changelog entry for the upcoming release can be skipped. The workflow will then push the changelog to the release branch with the commit name of `chore: generated CHANGELOG for vXX.YY.ZZ`, where XX.YY.ZZ are the numbers of the current release.

The engineer should work with the team and doc writer to update and finalize the contents of the changelog. During the update process, if the writer wants to make further changes to changelog through the browser, they can do that by switching the branch from develop to release/vXX.YY.ZZ and go to `CHANGELOG.md` and clicking on the pencil icon to edit the file.

Expand Down
1 change: 1 addition & 0 deletions packages/salesforcedx-apex-debugger/fix-these-rules.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"rules": {
"prefer-arrow/prefer-arrow-functions": ["error", {}],
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
Expand Down
125 changes: 63 additions & 62 deletions packages/salesforcedx-apex-debugger/src/adapter/apexDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import {
extractJsonObject,
ForceConfigGet,
ConfigGet,
OrgDisplay,
RequestService,
SFDX_CONFIG_ISV_DEBUGGER_SID,
SFDX_CONFIG_ISV_DEBUGGER_URL
SF_CONFIG_ISV_DEBUGGER_SID,
SF_CONFIG_ISV_DEBUGGER_URL
} from '@salesforce/salesforcedx-utils';
import * as os from 'os';
import { basename } from 'path';
Expand Down Expand Up @@ -272,7 +272,7 @@ export class ScopeContainer implements VariableContainer {
filter: FilterType,
start?: number,
count?: number
/* eslint-enable @typescript-eslint/no-unused-vars */
/* eslint-enable @typescript-eslint/no-unused-vars */
): Promise<ApexVariable[]> {
if (
!this.frameInfo.locals &&
Expand Down Expand Up @@ -303,10 +303,11 @@ export class ScopeContainer implements VariableContainer {

return Promise.all(
values.map(async value => {
const variableReference = await session.resolveApexIdToVariableReference(
this.frameInfo.requestId,
value.ref
);
const variableReference =
await session.resolveApexIdToVariableReference(
this.frameInfo.requestId,
value.ref
);
return new ApexVariable(
value,
variableKind,
Expand Down Expand Up @@ -339,7 +340,7 @@ export class ObjectReferenceContainer implements VariableContainer {
filter: FilterType,
start?: number,
count?: number
/* eslint-enable @typescript-eslint/no-unused-vars */
/* eslint-enable @typescript-eslint/no-unused-vars */
): Promise<ApexVariable[]> {
if (!this.reference.fields) {
// this object is empty
Expand All @@ -348,10 +349,11 @@ export class ObjectReferenceContainer implements VariableContainer {

return Promise.all(
this.reference.fields.map(async value => {
const variableReference = await session.resolveApexIdToVariableReference(
this.requestId,
value.ref
);
const variableReference =
await session.resolveApexIdToVariableReference(
this.requestId,
value.ref
);
return new ApexVariable(
value,
ApexVariableKind.Field,
Expand Down Expand Up @@ -476,7 +478,7 @@ export class MapTupleContainer implements VariableContainer {
filter: FilterType,
start?: number,
count?: number
/* eslint-enable @typescript-eslint/no-unused-vars */
/* eslint-enable @typescript-eslint/no-unused-vars */
): Promise<ApexVariable[]> {
if (!this.tuple.key && !this.tuple.value) {
// this object is empty
Expand All @@ -496,9 +498,9 @@ export class MapTupleContainer implements VariableContainer {
if (this.tuple.key) {
const keyVariableReference = this.tuple.key.ref
? await session.resolveApexIdToVariableReference(
this.requestId,
this.tuple.key.ref
)
this.requestId,
this.tuple.key.ref
)
: undefined;
variables.push(
new ApexVariable(
Expand All @@ -512,9 +514,9 @@ export class MapTupleContainer implements VariableContainer {
if (this.tuple.value) {
const valueVariableReference = this.tuple.value.ref
? await session.resolveApexIdToVariableReference(
this.requestId,
this.tuple.value.ref
)
this.requestId,
this.tuple.value.ref
)
: undefined;
variables.push(
new ApexVariable(
Expand Down Expand Up @@ -569,7 +571,7 @@ export class ApexDebug extends LoggingDebugSession {
protected initializeRequest(
response: DebugProtocol.InitializeResponse,
args: DebugProtocol.InitializeRequestArguments
/* eslint-enable @typescript-eslint/no-unused-vars */
/* eslint-enable @typescript-eslint/no-unused-vars */
): void {
this.initializedResponse = response;
this.initializedResponse.body = {
Expand All @@ -595,7 +597,7 @@ export class ApexDebug extends LoggingDebugSession {
protected attachRequest(
response: DebugProtocol.AttachResponse,
args: DebugProtocol.AttachRequestArguments
/* eslint-enable @typescript-eslint/no-unused-vars */
/* eslint-enable @typescript-eslint/no-unused-vars */
): void {
response.success = false;
this.sendResponse(response);
Expand Down Expand Up @@ -674,13 +676,13 @@ export class ApexDebug extends LoggingDebugSession {
}
try {
if (args.connectType === CONNECT_TYPE_ISV_DEBUGGER) {
const forceConfig = await new ForceConfigGet().getConfig(
const config = await new ConfigGet().getConfig(
args.sfdxProject,
SFDX_CONFIG_ISV_DEBUGGER_SID,
SFDX_CONFIG_ISV_DEBUGGER_URL
SF_CONFIG_ISV_DEBUGGER_SID,
SF_CONFIG_ISV_DEBUGGER_URL
);
const isvDebuggerSid = forceConfig.get(SFDX_CONFIG_ISV_DEBUGGER_SID);
const isvDebuggerUrl = forceConfig.get(SFDX_CONFIG_ISV_DEBUGGER_URL);
const isvDebuggerSid = config.get(SF_CONFIG_ISV_DEBUGGER_SID);
const isvDebuggerUrl = config.get(SF_CONFIG_ISV_DEBUGGER_URL);
if (
typeof isvDebuggerSid === 'undefined' ||
typeof isvDebuggerUrl === 'undefined'
Expand Down Expand Up @@ -746,10 +748,8 @@ export class ApexDebug extends LoggingDebugSession {
if (args && args.lineBreakpointInfo) {
const lineBpInfo: LineBreakpointInfo[] = args.lineBreakpointInfo;
if (lineBpInfo && lineBpInfo.length > 0) {
const lineNumberMapping: Map<
string,
LineBreakpointsInTyperef[]
> = new Map();
const lineNumberMapping: Map<string, LineBreakpointsInTyperef[]> =
new Map();
const typerefMapping: Map<string, string> = new Map();
for (const info of lineBpInfo) {
if (!lineNumberMapping.has(info.uri)) {
Expand Down Expand Up @@ -804,7 +804,8 @@ export class ApexDebug extends LoggingDebugSession {
);
} else {
this.errorToDebugConsole(
`${nls.localize('command_error_help_text')}:${os.EOL
`${nls.localize('command_error_help_text')}:${
os.EOL
}${terminatedSessionId}`
);
}
Expand Down Expand Up @@ -837,17 +838,18 @@ export class ApexDebug extends LoggingDebugSession {
TRACE_CATEGORY_BREAKPOINTS,
`setBreakPointsRequest: uri=${uri}`
);
const knownBps = await this.myBreakpointService.reconcileLineBreakpoints(
this.sfdxProject,
uri,
this.mySessionService.getSessionId(),
args.lines!.map(line => this.convertClientLineToDebugger(line))
);
const knownBps =
await this.myBreakpointService.reconcileLineBreakpoints(
this.sfdxProject,
uri,
this.mySessionService.getSessionId(),
args.lines!.map(line => this.convertClientLineToDebugger(line))
);
return Promise.resolve(knownBps);
}
);
// tslint:disable-next-line:no-empty
} catch (error) { }
} catch (error) {}
verifiedBreakpoints.forEach(verifiedBreakpoint => {
const lineNumber = this.convertDebuggerLineToClient(verifiedBreakpoint);
response.body.breakpoints.push({
Expand Down Expand Up @@ -1001,7 +1003,7 @@ export class ApexDebug extends LoggingDebugSession {
this.log(
TRACE_CATEGORY_VARIABLES,
'stackTraceRequest: state=' +
JSON.stringify(stateRespObj.stateResponse.state)
JSON.stringify(stateRespObj.stateResponse.state)
);
if (
stateRespObj.stateResponse.state.locals &&
Expand Down Expand Up @@ -1049,9 +1051,9 @@ export class ApexDebug extends LoggingDebugSession {
serverFrames[i].fullName,
sourcePath
? new Source(
basename(sourcePath),
this.convertDebuggerPathToClient(sourcePath)
)
basename(sourcePath),
this.convertDebuggerPathToClient(sourcePath)
)
: undefined,
this.convertDebuggerLineToClient(serverFrames[i].lineNumber),
0
Expand Down Expand Up @@ -1135,7 +1137,9 @@ export class ApexDebug extends LoggingDebugSession {
break;
case LIST_EXCEPTION_BREAKPOINTS_REQUEST:
response.body = {
typerefs: Array.from(this.myBreakpointService.getExceptionBreakpointCache().keys())
typerefs: Array.from(
this.myBreakpointService.getExceptionBreakpointCache().keys()
)
};
break;
default:
Expand Down Expand Up @@ -1258,7 +1262,7 @@ export class ApexDebug extends LoggingDebugSession {
this.log(
TRACE_CATEGORY_VARIABLES,
`fetchFrameVariables: frame ${frameInfo.frameNumber} frame=` +
JSON.stringify(frameRespObj.frameResponse.frame)
JSON.stringify(frameRespObj.frameResponse.frame)
);
if (
frameRespObj.frameResponse.frame.locals &&
Expand Down Expand Up @@ -1384,9 +1388,8 @@ export class ApexDebug extends LoggingDebugSession {
return;
}
}
const variableReference = this.variableContainerReferenceByApexId.get(
apexId
);
const variableReference =
this.variableContainerReferenceByApexId.get(apexId);
this.log(
TRACE_CATEGORY_VARIABLES,
`resolveApexIdToVariableReference: resolved apexId=${apexId} to variableReference=${variableReference}`
Expand All @@ -1405,9 +1408,8 @@ export class ApexDebug extends LoggingDebugSession {
const referencesResponse = await this.myRequestService.execute(
new ReferencesCommand(requestId, ...apexIds)
);
const referencesResponseObj: DebuggerResponse = JSON.parse(
referencesResponse
);
const referencesResponseObj: DebuggerResponse =
JSON.parse(referencesResponse);
if (
referencesResponseObj &&
referencesResponseObj.referencesResponse &&
Expand Down Expand Up @@ -1513,7 +1515,8 @@ export class ApexDebug extends LoggingDebugSession {
}
if (errorObj.action) {
this.errorToDebugConsole(
`${nls.localize('command_error_help_text')}:${os.EOL}${errorObj.action
`${nls.localize('command_error_help_text')}:${os.EOL}${
errorObj.action
}`
);
}
Expand Down Expand Up @@ -1664,17 +1667,17 @@ export class ApexDebug extends LoggingDebugSession {
if (matches && matches.length === 3) {
const possibleClassName = matches[1];
const possibleClassLine = parseInt(matches[2], 10);
const possibleSourcePath = this.myBreakpointService.getSourcePathFromPartialTyperef(
possibleClassName
);
const possibleSourcePath =
this.myBreakpointService.getSourcePathFromPartialTyperef(
possibleClassName
);
if (possibleSourcePath) {
eventDescriptionSourceFile = new Source(
basename(possibleSourcePath),
this.convertDebuggerPathToClient(possibleSourcePath)
);
eventDescriptionSourceLine = this.convertDebuggerLineToClient(
possibleClassLine
);
eventDescriptionSourceLine =
this.convertDebuggerLineToClient(possibleClassLine);
}
}
}
Expand Down Expand Up @@ -1778,10 +1781,8 @@ export class ApexDebug extends LoggingDebugSession {
// if breakpointid is found in exception breakpoint cache
// set the reason for stopped event to that reason
if (message.sobject.BreakpointId) {
const cache: Map<
string,
string
> = this.myBreakpointService.getExceptionBreakpointCache();
const cache: Map<string, string> =
this.myBreakpointService.getExceptionBreakpointCache();
cache.forEach((value, key) => {
if (value === message.sobject.BreakpointId) {
// typerefs for exceptions will change based on whether they are custom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
import {
ENV_SF_ORG_INSTANCE_URL,
ENV_SF_TARGET_ORG,
ForceConfigGet,
ConfigGet,
GlobalCliEnvironment,
SFDX_CONFIG_ISV_DEBUGGER_SID,
SFDX_CONFIG_ISV_DEBUGGER_URL
SF_CONFIG_ISV_DEBUGGER_SID,
SF_CONFIG_ISV_DEBUGGER_URL
} from '@salesforce/salesforcedx-utils';

export class IsvContextUtil {
public async setIsvDebuggerContext(projectWorkspacePath: string) {
let isvDebugProject = false;
if (projectWorkspacePath) {
const forceConfig = await new ForceConfigGet().getConfig(
const config = await new ConfigGet().getConfig(
projectWorkspacePath,
SFDX_CONFIG_ISV_DEBUGGER_SID,
SFDX_CONFIG_ISV_DEBUGGER_URL
SF_CONFIG_ISV_DEBUGGER_SID,
SF_CONFIG_ISV_DEBUGGER_URL
);
const isvDebuggerSid = forceConfig.get(SFDX_CONFIG_ISV_DEBUGGER_SID);
const isvDebuggerUrl = forceConfig.get(SFDX_CONFIG_ISV_DEBUGGER_URL);
const isvDebuggerSid = config.get(SF_CONFIG_ISV_DEBUGGER_SID);
const isvDebuggerUrl = config.get(SF_CONFIG_ISV_DEBUGGER_URL);

if (
typeof isvDebuggerSid !== 'undefined' &&
Expand Down
8 changes: 4 additions & 4 deletions packages/salesforcedx-apex-debugger/src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import {
import { messages } from './i18n';
import { messages as jaMessages } from './i18n.ja';

function loadMessageBundle(config?: Config): Message {
const loadMessageBundle = (config?: Config): Message => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function resolveFileName(locale: string): string {
const resolveFileName = (locale: string): string => {
return locale === DEFAULT_LOCALE
? `${BASE_FILE_NAME}.${BASE_FILE_EXTENSION}`
: `${BASE_FILE_NAME}.${locale}.${BASE_FILE_EXTENSION}`;
}
};

const base = new Message(messages);

Expand All @@ -36,7 +36,7 @@ function loadMessageBundle(config?: Config): Message {
}

return base;
}
};

export const nls = new Localization(
loadMessageBundle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ describe.skip('Interactive debugger adapter - integration', () => {
});
});

function execApexNoWait(
const execApexNoWait = (
apexExecFilePath: string,
userName: string
): CommandExecution {
): CommandExecution => {
return new CliCommandExecutor(
new SfdxCommandBuilder()
.withArg('force:apex:execute')
Expand All @@ -209,4 +209,4 @@ function execApexNoWait(
.build(),
{ cwd: process.cwd() }
).execute();
}
};
Loading

0 comments on commit 4513562

Please sign in to comment.