Skip to content

Commit c0b5f56

Browse files
authored
Merge pull request #1313 from forcedotcom/dev
RELEASE: @W-14750116@: Merging dev to release for v3.20.0 release.
2 parents 82c40f4 + 5047815 commit c0b5f56

File tree

246 files changed

+11772
-8731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+11772
-8731
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"extends": [
44
"eslint:recommended",
55
"plugin:@typescript-eslint/recommended",
6-
"plugin:@typescript-eslint/recommended-requiring-type-checking"
6+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
7+
"plugin:sf-plugin/migration"
78
],
89
"parserOptions": {
910
"sourceType": "module",

.github/ISSUE_TEMPLATE/0scanner_run_bug.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
name: Report a Bug with scanner:run
3-
about: Report an issue with the scanner:run command.
2+
name: Report a Bug with scanner run
3+
about: Report an issue with the scanner run command.
44
title: "[BUG]"
55
labels: ''
66
assignees: ''
77
---
88
<!--
9-
### Try These Steps to Resolve Issues with `scanner:run`
9+
### Try These Steps to Resolve Issues with `scanner run`
1010
11-
Oftentimes, you can resolve `scanner:run` issues on your own. Follow these steps.
11+
Oftentimes, you can resolve `scanner run` issues on your own. Follow these steps.
1212
1313
1. Read the error message.
1414
2. Read [Salesforce Code Analyzer](https://forcedotcom.github.io/sfdx-scanner/) documentation.
@@ -22,15 +22,15 @@ Oftentimes, you can resolve `scanner:run` issues on your own. Follow these steps
2222
2323
If you're listing a managed package on AppExchange, prepare for the security review by following the instructions in the [Scan Your Solution with Salesforce Code Analyzer](https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/security_review_code_analyzer_scan.htm) section of the ISVforce Guide.
2424
25-
### Log a `scanner:run` Issue
26-
If you're still having trouble after following the troubleshooting steps and checking that there's no existing issue that covers your situation, log a new `scanner:run` issue.
25+
### Log a `scanner run` Issue
26+
If you're still having trouble after following the troubleshooting steps and checking that there's no existing issue that covers your situation, log a new `scanner run` issue.
2727
28-
1. Fill out the `scanner:run` Issue Template.
28+
1. Fill out the `scanner run` Issue Template.
2929
2. Attach your code with your issue.
3030
3. If you can't publicly share the code that causes the issue, reproduce it in code that you can publicly share. Attach this substitute code to your issue.
3131
4. Give your issue a clear and specific title. Example: "InternalExecutionError when scanning XYZ code".
3232
-->
33-
### `scanner:run` Issue Template
33+
### `scanner run` Issue Template
3434

3535
Fill out this template to submit your Code Analyzer issue.
3636

.github/ISSUE_TEMPLATE/1scanner_run_dfa_bug.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
name: Report a Bug with scanner:run:dfa
3-
about: Report an issue with the scanner:run:dfa command.
2+
name: Report a Bug with scanner run dfa
3+
about: Report an issue with the scanner run dfa command.
44
title: "[BUG]"
55
labels: ''
66
assignees: ''
77
---
88
<!--
9-
### Try These Steps to Resolve Issues with `scanner:run:dfa`
9+
### Try These Steps to Resolve Issues with `scanner run dfa`
1010
11-
Oftentimes, you can resolve `scanner:run:dfa` issues on your own. Follow these steps.
11+
Oftentimes, you can resolve `scanner run dfa` issues on your own. Follow these steps.
1212
1313
1. Read the error message.
1414
2. Read [Salesforce Graph Engine](https://forcedotcom.github.io/sfdx-scanner/en/v3.x/salesforce-graph-engine/introduction/) documentation.
@@ -27,15 +27,15 @@ If you're listing a managed package on AppExchange, prepare for the security rev
2727
2828
**Note: In your scan report, if you see an InternalExecutionError or a LimitReached error, you can still submit for AppExchange security review. These errors aren't blockers.**
2929
30-
### Log a `scanner:run:dfa` Issue
31-
If you're still having trouble after following the troubleshooting steps and checking that there's no existing issue that covers your situation, log a new `scanner:run:dfa` issue.
30+
### Log a `scanner run dfa` Issue
31+
If you're still having trouble after following the troubleshooting steps and checking that there's no existing issue that covers your situation, log a new `scanner run dfa` issue.
3232
33-
1. Fill out the `scanner:run:dfa` Issue Template.
33+
1. Fill out the `scanner run dfa` Issue Template.
3434
2. Attach your code with your issue.
3535
3. If you can't publicly share the code that causes the issue, reproduce it in code that you can publicly share. Attach this substitute code to your issue.
3636
4. Give your issue a clear and specific title. Example: InternalExecutionError when scanning XYZ code.
3737
-->
38-
### `scanner:run:dfa` Issue Template
38+
### `scanner run dfa` Issue Template
3939

4040
Fill out this template to submit your Code Analyzer issue.
4141

.github/ISSUE_TEMPLATE/2scanner_run_false_result.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
name: Report a scanner:run False Result
3-
about: Report false results in scanner:run scan reports. If you’re submitting your managed package for AppExchange security review, include documentation of your false results with your submission.
2+
name: Report a scanner run False Result
3+
about: Report false results in scanner run scan reports. If you’re submitting your managed package for AppExchange security review, include documentation of your false results with your submission.
44
title: "[False Result]"
55
labels: ''
66
assignees: ''

.github/ISSUE_TEMPLATE/3scanner_run_dfa_false_result.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
name: Report a scanner:run:dfa False Result
3-
about: Report false results returned in scanner:run:dfa scan reports. If you’re submitting for AppExchange security review, include documentation of your false results with your submission.
2+
name: Report a scanner run dfa False Result
3+
about: Report false results returned in scanner run dfa scan reports. If you’re submitting for AppExchange security review, include documentation of your false results with your submission.
44
title: "[False Result]"
55
labels: ''
66
assignees: ''
77
---
8-
### `scanner:run:dfa` False Positives Template
8+
### `scanner run dfa` False Positives Template
99

1010
**Description:**
1111
<!--Provide a clear and concise description of what the bug is.-->

.github/ISSUE_TEMPLATE/4feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77
---
88

99
**Is your feature request related to an issue that you encountered with Salesforce Code Analyzer?**
10-
<!--Provide a clear and concise description of what the problem is. Example: When I run `scanner:run:describe`, I want to see a sorted list of commands.-->
10+
<!--Provide a clear and concise description of what the problem is. Example: When I run `scanner run describe`, I want to see a sorted list of commands.-->
1111

1212
**Describe the solution that you want:**
1313
<!--Describe the clear and concise description of the result that you expect from your feature request.-->

.github/workflows/production-heartbeat.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# In the following script, the use of the `echo "name=value" >> $GITHUB_ENV` structure is used to set/update
3838
# environment variables. Such updates are visible to all subsequent steps.
3939
#
40-
# If the CLI_VERSION repo secret is set, we want to install that version of sfdx-cli, so we set an environment
40+
# If the CLI_VERSION repo secret is set, we want to install that version ofsf-cli, so we set an environment
4141
# variable. Otherwise, we leave the environment variable unset, so it implicitly defaults to `latest`.
4242
# Note: This can be used to intentionally fail the GHA by providing an invalid version number.
4343
if [[ -n "${{ secrets.CLI_VERSION }}" ]]; then
@@ -58,34 +58,34 @@ jobs:
5858
fi
5959
6060
61-
# === Make three attempts to install sfdx through npm ===
62-
- name: Install SFDX
63-
id: sfdx_install
61+
# === Make three attempts to install SF through npm ===
62+
- name: Install SF
63+
id: sf_install
6464
# If the first attempt fails, wait a minute and try again. After a second failure, wait 5 minutes then try again. Then give up.
6565
# Set an output parameter, `retry_count`, indicating the number of retry attempts that were made.
6666
run: |
67-
(echo "::set-output name=retry_count::0" && npm install -g sfdx-cli${{ env.CLI_VERSION }}) ||
68-
(echo "::set-output name=retry_count::1" && sleep 60 && npm install -g sfdx-cli${{ env.CLI_VERSION }}) ||
69-
(echo "::set-output name=retry_count::2" && sleep 300 && npm install -g sfdx-cli${{ env.CLI_VERSION }})
67+
(echo "::set-output name=retry_count::0" && npm install -g @salesforce/cli${{ env.CLI_VERSION }}) ||
68+
(echo "::set-output name=retry_count::1" && sleep 60 && npm install -g @salesforce/cli${{ env.CLI_VERSION }}) ||
69+
(echo "::set-output name=retry_count::2" && sleep 300 && npm install -g @salesforce/cli${{ env.CLI_VERSION }})
7070
71-
# === Make three attempts to install the scanner plugin through sfdx ===
71+
# === Make three attempts to install the scanner plugin through sf ===
7272
- name: Install Scanner Plugin
7373
id: scanner_install
7474
# If the first attempt fails, wait a minute and try again. After a second failure, wait 5 minutes then try again. Then give up.
7575
# Set an output parameter, `retry_count`, indicating the number of retry attempts that were made.
7676
run: |
77-
(echo "::set-output name=retry_count::0" && sfdx plugins:install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
78-
(echo "::set-output name=retry_count::1" && sleep 60 && sfdx plugins:install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
79-
(echo "::set-output name=retry_count::2" && sleep 300 && sfdx plugins:install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }})
77+
(echo "::set-output name=retry_count::0" && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
78+
(echo "::set-output name=retry_count::1" && sleep 60 && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
79+
(echo "::set-output name=retry_count::2" && sleep 300 && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }})
8080
8181
# === Log the installed plugins for easier debugging ===
8282
- name: Log plugins
83-
run: sfdx plugins
83+
run: sf plugins
8484

8585
# === Attempt to execute the smoke tests ===
8686
- name: Run smoke tests
8787
id: smoke_tests
88-
run: smoke-tests/smoke-test${{ matrix.os.exe }} sfdx
88+
run: smoke-tests/smoke-test${{ matrix.os.exe }} sf
8989

9090
# === Upload the smoke-test-results folder as an artifact ===
9191
- name: Upload smoke-test-results folder as artifact
@@ -109,7 +109,7 @@ jobs:
109109
IS_CRITICAL: ${{ contains(join(steps.*.outcome), 'failure') || contains(join(steps.*.outcome), 'skipped') }}
110110
# Build the status strings for each step as environment variables to save space later. Null retry_count values
111111
# will be replaced with `n/a` to maintain readability in the alert.
112-
CLI_INSTALL_STATUS: ${{ steps.sfdx_install.outcome }} after ${{ steps.sfdx_install.outputs.retry_count || 'n/a' }} retries
112+
CLI_INSTALL_STATUS: ${{ steps.sf_install.outcome }} after ${{ steps.sf_install.outputs.retry_count || 'n/a' }} retries
113113
SCANNER_INSTALL_STATUS: ${{ steps.scanner_install.outcome }} after ${{ steps.scanner_install.outputs.retry_count || 'n/a' }} retries
114114
SMOKE_TESTS_STATUS: ${{ steps.smoke_tests.outcome }}
115115
# A link to this run, so the PagerDuty assignee can quickly get here.
@@ -126,13 +126,13 @@ jobs:
126126
# Define a helper function to create our POST request's data, to sidestep issues with nested quotations.
127127
generate_post_data() {
128128
# This is known as a HereDoc, and it lets us declare multi-line input ending when the specified limit string,
129-
# in this case EOF, is encoutered.
129+
# in this case EOF, is encountered.
130130
cat <<EOF
131131
{"payload": {
132132
"summary": "${ALERT_SUMMARY}",
133133
"source": "Github Actions",
134134
"severity": "${ALERT_SEV}",
135-
"custom_details": "SFDX install: ${{ env.CLI_INSTALL_STATUS }}. Scanner install: ${{ env.SCANNER_INSTALL_STATUS }}. Smoke tests: ${{ env.SMOKE_TESTS_STATUS }}."
135+
"custom_details": "SF install: ${{ env.CLI_INSTALL_STATUS }}. Scanner install: ${{ env.SCANNER_INSTALL_STATUS }}. Smoke tests: ${{ env.SMOKE_TESTS_STATUS }}."
136136
},
137137
"links": [{
138138
"href": "${{ env.RUN_LINK }}",

.github/workflows/publish-to-npm.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ jobs:
7373
with:
7474
distribution: 'temurin'
7575
java-version: '11' # For now, Java version is hardcoded.
76-
# Install SFDX, and the release candidate version.
77-
- run: npm install -g sfdx-cli
78-
- run: sfdx plugins:install @salesforce/sfdx-scanner@latest-rc
76+
# Install SF, and the release candidate version.
77+
- run: npm install -g @salesforce/cli
78+
- run: sf plugins install @salesforce/sfdx-scanner@latest-rc
7979
# Log the installed plugins for easier debugging.
80-
- run: sfdx plugins
80+
- run: sf plugins
8181
# Attempt to run the smoke tests.
82-
- run: smoke-tests/smoke-test${{ matrix.os.exe }} sfdx
82+
- run: smoke-tests/smoke-test${{ matrix.os.exe }} sf
8383
# Upload the smoke test result as an artifact, so it's visible for later.
8484
- uses: actions/upload-artifact@v3
8585
if: ${{ always() }}

.github/workflows/run-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
# NOTE: We're choosing not to cache Node dependencies, because it seems to be more
7373
# trouble than it's worth. If we see serious performance problems, we can
7474
# reconsider that assessment.
75-
- run: yarn
75+
- run: yarn --network-timeout 600000
7676
# Download the dist artifact, to save ourselves the trouble of rebuilding our
7777
# Java dependencies from scratch.
7878
- uses: actions/download-artifact@v3
@@ -196,7 +196,7 @@ jobs:
196196
distribution: 'temurin'
197197
java-version: ${{ matrix.java }} # Java version is a matrix.
198198
# Install Salesforce CLI via NPM
199-
- run: npm install -g sfdx-cli
199+
- run: npm install -g @salesforce/cli
200200
# Download and install the tarball artifact built during setup.
201201
- uses: actions/download-artifact@v3
202202
id: download
@@ -217,11 +217,11 @@ jobs:
217217
# If the path starts with C:, we need to rip that off (needed for Windows).
218218
ADJUSTED_TARBALL_PATH=`[[ $RAW_TARBALL_PATH = C* ]] && echo $RAW_TARBALL_PATH | cut -d':' -f 2 || echo $RAW_TARBALL_PATH`
219219
# Pipe in a `y` to simulate agreeing to install an unsigned package. Use a URI of the file's full path.
220-
echo y | sfdx plugins:install "file://${ADJUSTED_TARBALL_PATH}/${TARBALL_NAME}"
220+
echo y | sf plugins install "file://${ADJUSTED_TARBALL_PATH}/${TARBALL_NAME}"
221221
# The results directory needs to exist.
222222
- run: mkdir smoke-test-results
223223
# Attempt to execute the smoke tests against the plugin, using the specified script.
224-
- run: smoke-tests/smoke-test${{ matrix.os.exe }} sfdx
224+
- run: smoke-tests/smoke-test${{ matrix.os.exe }} sf
225225
- uses: actions/upload-artifact@v3
226226
if: ${{ always() }}
227227
with:
@@ -257,7 +257,7 @@ jobs:
257257
- run: mkdir test-results
258258
- name: Self-evaluation
259259
id: self-eval
260-
run: bin/run.js scanner:run --target ./src --format junit --outfile ./test-results/src.xml --severity-threshold 3
260+
run: bin/dev.js scanner run --target ./src --format junit --outfile ./test-results/src.xml --severity-threshold 3
261261
# TODO: In the future, we could replace this step with a JS-based one that uses `core.setFailed()` to set a failure
262262
# message in the annotations.
263263
- name: Log results

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ yarn-debug.log*
2424
yarn-error.log*
2525
lerna-debug.log*
2626

27+
# Temporary test logs
28+
stderr*.txt
29+
stdout*.txt
30+
2731
# Ignore jekyll cache and _site for doc
2832
docs/.jekyll-cache/
2933
docs/_site/

0 commit comments

Comments
 (0)