diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 70e6f880..bd296fac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,29 +38,6 @@ jobs: fail-fast: false with: os: ${{ matrix.os }} - xNuts-ps: - needs: linux-unit-tests - uses: salesforcecli/github-workflows/.github/workflows/externalNut.yml@main - strategy: - fail-fast: false - matrix: - os: ['ubuntu-latest', 'windows-latest'] - command: - - 'yarn test:nuts:tracking:basics' - - 'yarn test:nuts:tracking:conflicts' - - 'yarn test:nuts:tracking:forceignore' - - 'yarn test:nuts:tracking:remote' - - 'yarn test:nuts:tracking:lwc' - - 'yarn test:nuts:deb' - - 'yarn mocha "test/nuts/trackingCommands/mpd-*.nut.ts" --slow 3000 --timeout 600000 --parallel' - with: - packageName: '@salesforce/source-tracking' - externalProjectGitUrl: 'https://github.com/salesforcecli/plugin-source' - command: ${{matrix.command}} - os: ${{matrix.os}} - preSwapCommands: 'yarn upgrade @salesforce/source-deploy-retrieve@latest; npx yarn-deduplicate; yarn install' - useCache: false - secrets: inherit xNuts-pdr: needs: linux-unit-tests diff --git a/src/shared/remote/fileOperations.ts b/src/shared/remote/fileOperations.ts index fa5c9a9f..f9aeeb3a 100644 --- a/src/shared/remote/fileOperations.ts +++ b/src/shared/remote/fileOperations.ts @@ -52,6 +52,7 @@ export const revisionToRemoteChangeElement = (memberRevision: MemberRevision): R revisionCounter: memberRevision.RevisionCounter, changedBy: memberRevision.ChangedBy, memberIdOrName: memberRevision.MemberIdOrName, + lastModifiedDate: memberRevision.LastModifiedDate, }); export const upgradeFileContents = (contents: ContentsV0): ContentsV1 => ({ @@ -70,6 +71,7 @@ export const upgradeFileContents = (contents: ContentsV0): ContentsV1 => ({ lastRetrievedFromServer: value.lastRetrievedFromServer ?? undefined, ChangedBy: 'unknown', MemberIdOrName: 'unknown', + LastModifiedDate: 'unknown', }, ]) ), diff --git a/src/shared/remote/types.ts b/src/shared/remote/types.ts index b047eb00..9f838ce3 100644 --- a/src/shared/remote/types.ts +++ b/src/shared/remote/types.ts @@ -31,6 +31,7 @@ export type SourceMember = { MemberIdOrName: string; /** userID of the person who made change */ ChangedBy: string; + LastModifiedDate: string; }; export type MemberRevision = SourceMember & { @@ -57,4 +58,5 @@ export const SOURCE_MEMBER_FIELDS = [ 'RevisionCounter', 'IsNewMember', 'ChangedBy', + 'LastModifiedDate', ] satisfies Array; diff --git a/src/shared/types.ts b/src/shared/types.ts index b92603d7..f42b3cf5 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -33,6 +33,7 @@ export type RemoteChangeElement = { modified?: boolean; changedBy: string; revisionCounter: number; + lastModifiedDate: string; /** the ID of the metadata that was changed. Each metadata type has a different 3-char prefix */ memberIdOrName: string; }; diff --git a/src/sourceTracking.ts b/src/sourceTracking.ts index 7e431dce..6a578c4f 100644 --- a/src/sourceTracking.ts +++ b/src/sourceTracking.ts @@ -330,7 +330,7 @@ export class SourceTracking extends AsyncCreatable { if (options.format === 'ChangeResultWithPaths') { return populateFilePaths({ elements: filteredChanges.map(remoteChangeElementToChangeResult), - packageDirPaths: this.project.getPackageDirectories().map((pkgDir) => pkgDir.path), + packageDirPaths: this.project.getPackageDirectories().map((pkgDir) => pkgDir.fullPath), registry: this.registry, }); } diff --git a/test/unit/remote/fileOperations.test.ts b/test/unit/remote/fileOperations.test.ts index 8bf1713f..45df1b17 100644 --- a/test/unit/remote/fileOperations.test.ts +++ b/test/unit/remote/fileOperations.test.ts @@ -26,6 +26,7 @@ describe('writing file version based on env', () => { RevisionCounter: 1, MemberName: 'MyClass', IsNewMember: false, + LastModifiedDate: new Date().toJSON(), } satisfies MemberRevision, ], ]); @@ -97,6 +98,7 @@ describe('upgrading undefined file version to v1 file', () => { IsNameObsolete: false, RevisionCounter: 1, MemberName: 'MyClass', + LastModifiedDate: 'unknown', } satisfies Omit); }); diff --git a/test/unit/remote/remoteSourceTracking.test.ts b/test/unit/remote/remoteSourceTracking.test.ts index 8f9ce8dd..fe9a7a85 100644 --- a/test/unit/remote/remoteSourceTracking.test.ts +++ b/test/unit/remote/remoteSourceTracking.test.ts @@ -23,7 +23,7 @@ import { RemoteSyncInput, RemoteChangeElement } from '../../../src/shared/types' import * as orgQueryMocks from '../../../src/shared/remote/orgQueries'; import { getMetadataNameFromKey, getMetadataTypeFromKey } from '../../../src/shared/functions'; -import { ContentsV0, MemberRevision, SourceMember } from '../../../src/shared/remote/types'; +import { ContentsV0, ContentsV1, MemberRevision, SourceMember } from '../../../src/shared/remote/types'; config.truncateThreshold = 0; @@ -34,6 +34,7 @@ const defaultSourceMemberValues = { RevisionCounter: 1, ChangedBy: 'Shelby McLaughlin', MemberIdOrName: '00eO4000003cP5JIAU', + LastModifiedDate: new Date().toJSON(), } satisfies Partial; const getSourceMember = (revision: number, isDeleted = false): SourceMember => ({ @@ -126,6 +127,7 @@ describe('remoteSourceTrackingService', () => { changedBy: 'Shelby McLaughlin', revisionCounter: 1, memberIdOrName, + lastModifiedDate: defaultSourceMemberValues.LastModifiedDate, }; const changeResult = remoteChangeElementToChangeResult(rce); expect(changeResult).to.deep.equal({ @@ -137,6 +139,7 @@ describe('remoteSourceTrackingService', () => { changedBy: 'Shelby McLaughlin', revisionCounter: 1, memberIdOrName, + lastModifiedDate: defaultSourceMemberValues.LastModifiedDate, }); }); @@ -149,6 +152,7 @@ describe('remoteSourceTrackingService', () => { changedBy: 'Shelby McLaughlin', revisionCounter: 1, memberIdOrName, + lastModifiedDate: defaultSourceMemberValues.LastModifiedDate, }; const changeResult = remoteChangeElementToChangeResult(rce); expect(changeResult).to.deep.equal({ @@ -160,6 +164,7 @@ describe('remoteSourceTrackingService', () => { changedBy: 'Shelby McLaughlin', revisionCounter: 1, memberIdOrName, + lastModifiedDate: defaultSourceMemberValues.LastModifiedDate, }); }); }); @@ -564,6 +569,7 @@ describe('remoteSourceTrackingService', () => { }); const contents = { serverMaxRevisionCounter: 1, + fileVersion: 1, sourceMembers: { 'Profile###my(awesome)profile': { ...defaultSourceMemberValues, @@ -575,7 +581,7 @@ describe('remoteSourceTrackingService', () => { MemberType: 'Profile', }, }, - }; + } satisfies ContentsV1; setContents(contents); await remoteSourceTrackingService.syncSpecifiedElements([ {