-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: warn about legacy suffix use (#1298)
* feat: warn about legacy suffix use * fix: more support for legacy suffix * test: snapshot for bigObject indexe * test: extra ut for legacy suffix * test: handle potentially undefined childType * chore: resolve a TODO * fix: legacy suffix warning in the correct place * feat: also check legacy suffix for strict folder matching
- Loading branch information
Showing
15 changed files
with
264 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...acySuffixSupport/__snapshots__/verify-md-files.expected/objects/LogEntryArchive__b.object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<deploymentStatus>Deployed</deploymentStatus> | ||
<description>Big Object representation of Logger data, used as an alternative to the platform event LogEntryEvent__e, as well as a way to archive Logger data stored in Log__c, LogEntry__, and LogEntryTag__c</description> | ||
<label>Log Entry Archive</label> | ||
<pluralLabel>Log Entry Archives</pluralLabel> | ||
<fields> | ||
<fullName>Timestamp__c</fullName> | ||
<businessStatus>Active</businessStatus> | ||
<complianceGroup>None</complianceGroup> | ||
<externalId>false</externalId> | ||
<label>Timestamp</label> | ||
<required>true</required> | ||
<securityClassification>Confidential</securityClassification> | ||
<type>DateTime</type> | ||
</fields> | ||
<fields> | ||
<fullName>TransactionEntryNumber__c</fullName> | ||
<businessStatus>Active</businessStatus> | ||
<complianceGroup>None</complianceGroup> | ||
<description>The sequential number of this log entry within the transaction</description> | ||
<externalId>false</externalId> | ||
<label>Entry #</label> | ||
<precision>10</precision> | ||
<required>true</required> | ||
<scale>0</scale> | ||
<securityClassification>Confidential</securityClassification> | ||
<type>Number</type> | ||
<unique>false</unique> | ||
</fields> | ||
<fields> | ||
<fullName>TransactionId__c</fullName> | ||
<businessStatus>Active</businessStatus> | ||
<complianceGroup>None</complianceGroup> | ||
<externalId>false</externalId> | ||
<label>Transaction ID</label> | ||
<length>36</length> | ||
<required>true</required> | ||
<securityClassification>Confidential</securityClassification> | ||
<type>Text</type> | ||
<unique>false</unique> | ||
</fields> | ||
<indexes> | ||
<fullName>LogEntryArchiveIndex</fullName> | ||
<fields> | ||
<name>Timestamp__c</name> | ||
<sortDirection>DESC</sortDirection> | ||
</fields> | ||
<fields> | ||
<name>TransactionId__c</name> | ||
<sortDirection>ASC</sortDirection> | ||
</fields> | ||
<fields> | ||
<name>TransactionEntryNumber__c</name> | ||
<sortDirection>DESC</sortDirection> | ||
</fields> | ||
<label>Log Entry Archive Index</label> | ||
</indexes> | ||
</CustomObject> |
18 changes: 18 additions & 0 deletions
18
...hot/sampleProjects/legacySuffixSupport/__snapshots__/verify-md-files.expected/package.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<types> | ||
<members>LogEntryArchive__b.Timestamp__c</members> | ||
<members>LogEntryArchive__b.TransactionEntryNumber__c</members> | ||
<members>LogEntryArchive__b.TransactionId__c</members> | ||
<name>CustomField</name> | ||
</types> | ||
<types> | ||
<members>LogEntryArchive__b</members> | ||
<name>CustomObject</name> | ||
</types> | ||
<types> | ||
<members>LogEntryArchive__b.LogEntryArchiveIndex</members> | ||
<name>Index</name> | ||
</types> | ||
<version>60.0</version> | ||
</Package> |
8 changes: 8 additions & 0 deletions
8
...ixSupport/force-app/objects/objects/LogEntryArchive__b/LogEntryArchive__b.object-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<deploymentStatus>Deployed</deploymentStatus> | ||
<description | ||
>Big Object representation of Logger data, used as an alternative to the platform event LogEntryEvent__e, as well as a way to archive Logger data stored in Log__c, LogEntry__, and LogEntryTag__c</description> | ||
<label>Log Entry Archive</label> | ||
<pluralLabel>Log Entry Archives</pluralLabel> | ||
</CustomObject> |
11 changes: 11 additions & 0 deletions
11
...ixSupport/force-app/objects/objects/LogEntryArchive__b/fields/Timestamp__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>Timestamp__c</fullName> | ||
<businessStatus>Active</businessStatus> | ||
<complianceGroup>None</complianceGroup> | ||
<externalId>false</externalId> | ||
<label>Timestamp</label> | ||
<required>true</required> | ||
<securityClassification>Confidential</securityClassification> | ||
<type>DateTime</type> | ||
</CustomField> |
15 changes: 15 additions & 0 deletions
15
...ce-app/objects/objects/LogEntryArchive__b/fields/TransactionEntryNumber__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>TransactionEntryNumber__c</fullName> | ||
<businessStatus>Active</businessStatus> | ||
<complianceGroup>None</complianceGroup> | ||
<description>The sequential number of this log entry within the transaction</description> | ||
<externalId>false</externalId> | ||
<label>Entry #</label> | ||
<precision>10</precision> | ||
<required>true</required> | ||
<scale>0</scale> | ||
<securityClassification>Confidential</securityClassification> | ||
<type>Number</type> | ||
<unique>false</unique> | ||
</CustomField> |
13 changes: 13 additions & 0 deletions
13
...pport/force-app/objects/objects/LogEntryArchive__b/fields/TransactionId__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>TransactionId__c</fullName> | ||
<businessStatus>Active</businessStatus> | ||
<complianceGroup>None</complianceGroup> | ||
<externalId>false</externalId> | ||
<label>Transaction ID</label> | ||
<length>36</length> | ||
<required>true</required> | ||
<securityClassification>Confidential</securityClassification> | ||
<type>Text</type> | ||
<unique>false</unique> | ||
</CustomField> |
17 changes: 17 additions & 0 deletions
17
...force-app/objects/objects/LogEntryArchive__b/indexes/LogEntryArchiveIndex.indexe-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<Index xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>LogEntryArchiveIndex</fullName> | ||
<fields> | ||
<name>Timestamp__c</name> | ||
<sortDirection>DESC</sortDirection> | ||
</fields> | ||
<fields> | ||
<name>TransactionId__c</name> | ||
<sortDirection>ASC</sortDirection> | ||
</fields> | ||
<fields> | ||
<name>TransactionEntryNumber__c</name> | ||
<sortDirection>DESC</sortDirection> | ||
</fields> | ||
<label>Log Entry Archive Index</label> | ||
</Index> |
9 changes: 9 additions & 0 deletions
9
test/snapshot/sampleProjects/legacySuffixSupport/sfdx-project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"packageDirectories": [ | ||
{ | ||
"default": true, | ||
"path": "force-app" | ||
} | ||
], | ||
"sourceApiVersion": "59.0" | ||
} |
31 changes: 31 additions & 0 deletions
31
test/snapshot/sampleProjects/legacySuffixSupport/snapshots.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2023, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import * as fs from 'node:fs'; | ||
import * as path from 'node:path'; | ||
import { MDAPI_OUT, fileSnap, sourceToMdapi } from '../../helper/conversions'; | ||
|
||
// we don't want failing tests outputting over each other | ||
/* eslint-disable no-await-in-loop */ | ||
|
||
describe('legacy suffix support (.indexe for bigObject index)', () => { | ||
const testDir = path.join('test', 'snapshot', 'sampleProjects', 'legacySuffixSupport'); | ||
let mdFiles: string[]; | ||
|
||
before(async () => { | ||
mdFiles = await sourceToMdapi(testDir); | ||
}); | ||
|
||
it('verify md files', async () => { | ||
for (const file of mdFiles) { | ||
await fileSnap(file, testDir); | ||
} | ||
}); | ||
|
||
after(async () => { | ||
await Promise.all([fs.promises.rm(path.join(testDir, MDAPI_OUT), { recursive: true, force: true })]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters