-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added StripInaccessibleRecordFields__c setting * Added all CMDT objects to LoggerAdmin.permissionset * Added LogEntryDataMaskRule__mdt object for applying data mask rules to log entry message & record JSON fields in LogEntryEventBuilder * Added CMDT rules for credit card numbers & social security numbers * Added setting ApplyDataMaskRules__c to control if CMDT data mask rules are applied * Added some user managament settings to scratch-def files * Added test suites for each module * Moved some test helper methods to LoggerTestUtils, cleaned up LogEntryEventBuilder_Tests methods * Optimized setTagsDetails() * Made record & records parameters optional in FlowRecordLogEntry & FlowCollectionLogEntry (respectively) to handle situations where null is passed (e.g., Get Records returns null for no matches, instead of an empty list) (reported in #198) * Changed FlowDescription__c.field to long text area + added automatic field-truncation for LogEntry__c inserts + added a ridiculously long description to one of the Flows in nebula-logger-recipes (reported in #199) * Made fancier buttons that include the release number * Cleaned up a few areas in README * Added 'Code Quality Tests' to deploy.yml + ran prettier * Setup ESLint for lwc + fixed some reported issues * Removed some unused scripts in package.json * Switched back to using extra-tests folder, created LogEntryEventBuilder_IntegrationTests class (AccountBrand doesn't exist in all orgs) * Added new step to pipeline to create an unvalidated package version & auto-install it into the package-demo org, then reinstall the latest released package version * Reenabled Codecov.io integration in the pipeline * Added static code analysis / PMD through sfdx-scanner (#201 by @jamessimone) * Fixed line breaks not working when calling System.debug() @jamessimone and I had a lot of... "fun" with this one Co-authored-by: James Simone <[email protected]>
- Loading branch information
1 parent
4938da6
commit 408580f
Showing
157 changed files
with
3,750 additions
and
1,244 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"parser": "@babel/eslint-parser", | ||
"parserOptions": { | ||
"requireConfigFile": false, | ||
"babelOptions": { | ||
"parserOpts": { | ||
"plugins": ["classProperties", ["decorators", { "decoratorsBeforeExport": false }]] | ||
} | ||
} | ||
}, | ||
"ignorePatterns": ["**/*.html", "**/*.cmp", "**/*.cmp-meta.xml", "**/*.css", "**/*.test.js", "**/*js-meta.xml", "**/*.json"], | ||
"plugins": ["@lwc/eslint-plugin-lwc", "@salesforce/eslint-plugin-aura"], | ||
"extends": ["@salesforce/eslint-config-lwc/recommended"], | ||
"rules": { | ||
"eqeqeq": "off", | ||
"no-console": "off", | ||
"no-unused-expressions": "off", | ||
"semi": "off", | ||
"@lwc/lwc/consistent-component-name": "error", | ||
"@lwc/lwc/no-api-reassignments": "off", | ||
"@lwc/lwc/no-async-operation": "off", | ||
"@lwc/lwc/no-deprecated": "error", | ||
"@lwc/lwc/no-document-query": "error", | ||
"@lwc/lwc/valid-api": "error" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Unique name for this workflow | ||
# Pipeline for Nebula Logger | ||
name: Deployment | ||
|
||
on: | ||
|
@@ -39,12 +39,11 @@ on: | |
- 'sfdx-project.json' | ||
|
||
jobs: | ||
local-tests: | ||
name: 'Local Tests' | ||
code-quality-tests: | ||
name: 'Code Quality Tests' | ||
runs-on: ubuntu-latest | ||
environment: Test | ||
steps: | ||
# Checkout the code | ||
- name: 'Checkout source code' | ||
uses: actions/checkout@v2 | ||
|
||
|
@@ -56,41 +55,55 @@ jobs: | |
- name: 'Install npm' | ||
run: npm install | ||
|
||
# Install Salesforce CLI | ||
- name: 'Lint Lightning Components' | ||
run: npm run lint:lwc | ||
|
||
- name: 'Prettier code formatting verification' | ||
run: npm run prettier:verify | ||
|
||
- name: Install Salesforce CLI | ||
run: npm install sfdx-cli --global | ||
# run: | | ||
# wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz | ||
# mkdir sfdx-cli | ||
# tar xJf sfdx-linux-amd64.tar.xz -C sfdx-cli --strip-components 1 | ||
# ./sfdx-cli/install | ||
|
||
# Start local testing | ||
# TODO uncomment | ||
# Prettier formatting | ||
# - name: 'Code formatting verification with Prettier' | ||
# run: npm run prettier:verify | ||
# TODO uncomment | ||
# Lint LWC | ||
# - name: 'Lint Lightning Web Components' | ||
# run: npm run lint:lwc | ||
# LWC unit tests | ||
|
||
- name: Install & run SFDX Scanner | ||
run: | | ||
sfdx plugins:install @salesforce/sfdx-scanner | ||
sfdx scanner:run --pmdconfig config/pmd-ruleset.xml --target . --engine pmd --severity-threshold 3 | ||
lwc-tests: | ||
name: 'LWC Tests' | ||
needs: [code-quality-tests] | ||
runs-on: ubuntu-latest | ||
environment: Test | ||
steps: | ||
- name: 'Checkout source code' | ||
uses: actions/checkout@v2 | ||
|
||
- name: 'Setup node' | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: 'Install npm' | ||
run: npm install | ||
|
||
- name: Install Salesforce CLI | ||
run: npm install sfdx-cli --global | ||
|
||
- name: 'Run LWC Tests' | ||
run: npm run test:lwc | ||
|
||
# Upload code coverage data for LWC | ||
# - name: 'Upload code coverage for LWC to Codecov.io' | ||
# uses: codecov/[email protected] | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# flags: LWC | ||
- name: 'Upload LWC code coverage to Codecov.io' | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
flags: LWC | ||
|
||
scratch-org-tests: | ||
name: 'Scratch Org Tests' | ||
needs: [code-quality-tests] | ||
runs-on: ubuntu-latest | ||
environment: Test | ||
steps: | ||
# Checkout the code | ||
- name: 'Checkout source code' | ||
uses: actions/checkout@v2 | ||
|
||
|
@@ -102,18 +115,9 @@ jobs: | |
- name: 'Install npm' | ||
run: npm install | ||
|
||
# Install Salesforce CLI | ||
- name: Install Salesforce CLI | ||
run: npm install sfdx-cli --global | ||
# run: | | ||
# wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz | ||
# mkdir sfdx-cli | ||
# tar xJf sfdx-linux-amd64.tar.xz -C sfdx-cli --strip-components 1 | ||
# ./sfdx-cli/install | ||
|
||
# Start remote testing | ||
|
||
# Store secrets for dev hubs | ||
- name: 'Populate DevHub Auth Files' | ||
shell: bash | ||
run: | | ||
|
@@ -142,31 +146,70 @@ jobs: | |
with: | ||
args: '120' | ||
|
||
- name: 'Deploy Metadata' | ||
run: npm run deploy | ||
- name: 'Push Metadata' | ||
run: sfdx force:source:push --forceoverwrite | ||
|
||
- name: 'Run Apex Tests' | ||
run: npm run test:apex | ||
|
||
# Delete test files that Codecov is unable to parse | ||
# - name: 'Delete unsupported code coverage files' | ||
# run: rm ./tests/apex/test-result-707*-codecoverage.json | ||
- name: 'Delete unsupported code coverage files' | ||
run: rm ./tests/apex/test-result-707*-codecoverage.json | ||
|
||
# Upload code coverage data for Apex | ||
# - name: 'Upload code coverage for Apex to Codecov.io' | ||
# uses: codecov/[email protected] | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# flags: Apex | ||
- name: 'Upload Apex test code coverage to Codecov.io' | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
flags: Apex | ||
|
||
- name: 'Delete Scratch Org' | ||
run: npm run org:delete:noprompt | ||
if: ${{ always() }} | ||
|
||
create-and-install-test-package-version: | ||
name: 'Create & Install Test Package Version' | ||
needs: [lwc-tests, scratch-org-tests] | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
environment: Test | ||
steps: | ||
- name: 'Checkout source code' | ||
uses: actions/checkout@v2 | ||
|
||
- name: 'Setup node' | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: 'Install npm' | ||
run: npm install | ||
|
||
- name: Install Salesforce CLI | ||
run: npm install sfdx-cli --global | ||
|
||
- name: 'Populate Org Auth Files' | ||
shell: bash | ||
run: | | ||
echo ${{ env.DEVHUB_SFDX_URL }} > ./DEVHUB_SFDX_URL.txt | ||
echo ${{ env.NEBULA_PKG_DEMO_SANDBOX_SFDX_URL }} > ./NEBULA_PKG_DEMO_SANDBOX_SFDX_URL.txt | ||
env: | ||
DEVHUB_SFDX_URL: ${{ secrets.DEVHUB_SFDX_URL }} | ||
NEBULA_PKG_DEMO_SANDBOX_SFDX_URL: ${{ secrets.NEBULA_PKG_DEMO_SANDBOX_SFDX_URL }} | ||
|
||
- name: 'Authorize Orgs' | ||
run: | | ||
sfdx auth:sfdxurl:store --sfdxurlfile ./DEVHUB_SFDX_URL.txt --setalias nebula-logger-packaging --setdefaultdevhubusername | ||
sfdx auth:sfdxurl:store --sfdxurlfile ./NEBULA_PKG_DEMO_SANDBOX_SFDX_URL.txt --setalias nebula-logger-package-demo | ||
- name: 'Create & Install Unvalidated Package Version' | ||
run: npx pwsh ./scripts/create-and-install-unvalidated-package-version.ps1 -targetusername nebula-logger-package-demo | ||
|
||
- name: 'Reinstall Latest Released Package Version' | ||
run: npx pwsh ./scripts/install-latest-released-unlocked-package-version.ps1 -targetusername nebula-logger-package-demo | ||
|
||
# TODO finish auto-creation & promotion of unlocked package + committing changes to docs | ||
# create-package-version: | ||
# name: 'Create Package Version' | ||
# needs: [local-tests, scratch-org-tests] | ||
# needs: [code-quality-tests, lwc-tests, scratch-org-tests] | ||
# runs-on: ubuntu-latest | ||
# environment: Test | ||
# steps: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ coverage: | |
threshold: 1% | ||
if_ci_failed: success | ||
patch: off | ||
ignore: | ||
- 'nebula-logger-recipes/**/*' |
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,45 @@ | ||
<?xml version="1.0" ?> | ||
<ruleset | ||
name="Nebula Logger Rules" | ||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd" | ||
> | ||
<description> | ||
Nebula Logger custom PMD ruleset | ||
</description> | ||
<rule ref="category/apex/bestpractices.xml"> | ||
<exclude name="ApexAssertionsShouldIncludeMessage" /> | ||
<exclude name="AvoidGlobalModifier" /> | ||
<exclude name="AvoidLogicInTrigger" /> | ||
</rule> | ||
<rule ref="category/apex/codestyle.xml"> | ||
<exclude name="FieldNamingConventions" /> | ||
<exclude name="MethodNamingConventions" /> | ||
<exclude name="PropertyNamingConventions" /> | ||
<exclude name="VariableNamingConventions" /> | ||
</rule> | ||
<rule ref="category/apex/design.xml"> | ||
<exclude name="AvoidDeeplyNestedIfStmts" /> | ||
<exclude name="CognitiveComplexity" /> | ||
<exclude name="CyclomaticComplexity" /> | ||
<exclude name="ExcessiveClassLength" /> | ||
<exclude name="ExcessiveParameterList" /> | ||
<exclude name="ExcessivePublicCount" /> | ||
<exclude name="NcssConstructorCount" /> | ||
<exclude name="NcssMethodCount" /> | ||
<exclude name="StdCyclomaticComplexity" /> | ||
<exclude name="TooManyFields" /> | ||
</rule> | ||
<rule ref="category/apex/documentation.xml"> | ||
<exclude name="ApexDoc" /> | ||
</rule> | ||
<rule ref="category/apex/errorprone.xml"> | ||
<exclude name="EmptyStatementBlock" /> | ||
</rule> | ||
<rule ref="category/apex/performance.xml"> | ||
<exclude name="AvoidDebugStatements" /> | ||
</rule> | ||
<rule ref="category/apex/security.xml"> | ||
</rule> | ||
</ruleset> |
Oops, something went wrong.