Skip to content

Commit 8365d40

Browse files
authored
Merge pull request #176 from forcedotcom/release-1.4.0
RELEASE @W-17831303@ Conducting Release 1.4.0
2 parents 38d6425 + fb5e855 commit 8365d40

39 files changed

+3531
-1760
lines changed

.eslintrc.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
"**/*.d.ts",
2121
"src/test",
2222
"esbuild.js"
23-
]
23+
],
24+
"rules": {
25+
"@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_"}]
26+
}
2427
}

.github/workflows/build-scanner-tarball.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
description: "Which branch of the scanner should be built?"
77
required: false
88
type: string
9-
default: "dev"
9+
default: "dev-4"
1010

1111
jobs:
1212
build-tarball:
@@ -25,9 +25,8 @@ jobs:
2525
- name: 'Check out, build, pack'
2626
run: |
2727
# Check out the target branch.
28-
git clone https://github.com/forcedotcom/sfdx-scanner.git sfdx-scanner
28+
git clone -b ${{ inputs.target-branch }} https://github.com/forcedotcom/sfdx-scanner.git sfdx-scanner
2929
cd sfdx-scanner
30-
git checkout ${{ inputs.target-branch }}
3130
# Install and build dependencies.
3231
yarn
3332
yarn build
@@ -36,5 +35,5 @@ jobs:
3635
# Upload the tarball as an artifact so it's usable elsewhere.
3736
- uses: actions/upload-artifact@v4
3837
with:
39-
name: scanner-tarball
40-
path: ./**/salesforce-sfdx-scanner-*.tgz
38+
name: scanner-tarball-${{ inputs.target-branch }}
39+
path: ./**/salesforce-*.tgz

.github/workflows/create-github-release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
name: 'Upload VSIX as artifact'
2323
needs: verify-should-run
2424
uses: ./.github/workflows/create-vsix-artifact.yml
25+
secrets: inherit
2526
create-github-release:
2627
runs-on: ubuntu-latest
2728
needs: create-vsix-artifact

.github/workflows/create-release-branch.yml

+18-6
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- uses: actions/setup-node@v4
6161
with:
6262
node-version: 'lts/*' # Always use Node LTS for building dependencies.
63-
- run: yarn
63+
- run: yarn install --frozen-lockfile
6464
# Increment the version as desired locally, without actually committing anything.
6565
- name: Locally increment version
6666
run: |
@@ -141,9 +141,19 @@ jobs:
141141
git push -d origin ${NEW_VERSION}-interim
142142
# Output the release branch name so we can use it in later jobs.
143143
echo "branch_name=release-$NEW_VERSION" >> "$GITHUB_OUTPUT"
144-
# Build the scanner tarball so it can be installed locally when we run tests.
145-
build-scanner-tarball:
146-
name: 'Build scanner tarball'
144+
# Build the scanner tarballs so they can be installed locally when we run tests.
145+
build-v4-scanner-tarball:
146+
name: 'Build v4 scanner tarball'
147+
needs: verify-should-run
148+
uses: ./.github/workflows/build-scanner-tarball.yml
149+
with:
150+
# Note: Using `dev-4` here is technically incorrect. For full completeness's sake, we should probably be
151+
# using the branch corresponding to the upcoming scanner release. However, identifying that branch is
152+
# non-trivial, and there are unlikely to be major differences between the two that appear in the few days
153+
# between creating the branch and releasing it, so it _should_ be fine.
154+
target-branch: 'dev-4'
155+
build-v5-scanner-tarball:
156+
name: 'Build v5 scanner tarball'
147157
needs: verify-should-run
148158
uses: ./.github/workflows/build-scanner-tarball.yml
149159
with:
@@ -155,10 +165,12 @@ jobs:
155165
# Run all the various tests against the newly created branch.
156166
test-release-branch:
157167
name: 'Run unit tests'
158-
needs: [build-scanner-tarball, create-release-branch]
168+
needs: [build-v4-scanner-tarball, build-v5-scanner-tarball, create-release-branch]
159169
uses: ./.github/workflows/run-tests.yml
160170
with:
161171
# We want to validate the extension against whatever version of the scanner we *plan* to publish,
162172
# not what's *already* published.
163-
use-scanner-tarball: true
173+
use-scanner-tarballs: true
174+
v4-tarball-suffix: 'dev-4'
175+
v5-tarball-suffix: 'dev'
164176
target-branch: ${{ needs.create-release-branch.outputs.branch-name }}

.github/workflows/daily-smoke-test.yml

+21-18
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,53 @@ on:
44
schedule:
55
# Cron syntax is "minute[0-59] hour[0-23] date[1-31] month[1-12] day[0-6]". '*' is 'any value', and multiple values
66
# can be specified with comma-separated lists. All times are UTC.
7-
# So this expression means "run at 13:30 UTC every day". This time was chosen because it corresponds to
8-
# 8:30AM CDT, meaning that any issues will be surfaced towards the start of business.
9-
- cron: "30 13 * * *"
7+
# So this expression means "run at 17:30 UTC every day". This time was chosen because it corresponds to
8+
# 9:30AM PST, meaning that any issues will be surfaced on working days when people are likely to be awake and online.
9+
- cron: "30 17 * * 1-5"
1010

1111
jobs:
12-
# Step 1: Build the scanner tarball so it can be installed locally.
13-
build-scanner-tarball:
14-
name: 'Build scanner tarball'
12+
# Step 1: Build the scanner tarballs so they can be installed locally.
13+
build-v4-scanner-tarball:
14+
name: 'Build v4 scanner tarball'
15+
uses: ./.github/workflows/build-scanner-tarball.yml
16+
with:
17+
target-branch: 'dev-4'
18+
build-v5-scanner-tarball:
19+
name: 'Build v5 scanner tarball'
1520
uses: ./.github/workflows/build-scanner-tarball.yml
1621
with:
1722
target-branch: 'dev'
1823
# Step 2: Actually run the tests.
1924
smoke-test:
2025
name: 'Run smoke tests'
21-
needs: build-scanner-tarball
26+
needs: [build-v4-scanner-tarball, build-v5-scanner-tarball]
2227
uses: ./.github/workflows/run-tests.yml
2328
with:
2429
# For daily builds, we want to make sure we haven't pushed a breaking change
25-
# to the scanner's `dev` branch.
26-
use-scanner-tarball: true
30+
# to the scanner's `dev-4` branch.
31+
use-scanner-tarballs: true
32+
v4-tarball-suffix: 'dev-4'
33+
v5-tarball-suffix: 'dev'
34+
secrets: inherit
2735
# Step 3: Build a VSIX artifact for use if needed.
2836
create-vsix-artifact:
2937
name: 'Upload VSIX as artifact'
3038
uses: ./.github/workflows/create-vsix-artifact.yml
39+
secrets: inherit
3140
# Step 4: Report any problems
3241
report-problems:
3342
name: 'Report problems'
3443
runs-on: ubuntu-latest
35-
needs: [build-scanner-tarball, smoke-test, create-vsix-artifact]
44+
needs: [build-v4-scanner-tarball, build-v5-scanner-tarball, smoke-test, create-vsix-artifact]
3645
if: ${{ failure() || cancelled() }}
3746
steps:
3847
- name: Report problems
3948
shell: bash
4049
env:
41-
IS_CRITICAL: ${{ contains(join(steps.*.outcome), 'failure') || contains(join(steps.*.outcome), 'skipped') }}
4250
RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
4351
run: |
44-
if [[ ${{ env.IS_CRITICAL }} == true ]]; then
45-
ALERT_SEV="critical"
46-
ALERT_SUMMARY="Daily smoke test failed on ${{ runner.os }}"
47-
else
48-
ALERT_SEV="info"
49-
ALERT_SUMMARY="Daily smoke test succeeded with retries on ${{ runner.os }}"
50-
fi
52+
ALERT_SEV="critical"
53+
ALERT_SUMMARY="Daily smoke test failed on ${{ runner.os }}"
5154
5255
generate_post_data() {
5356
cat <<EOF

.github/workflows/production-heartbeat.yml

+2-12
Original file line numberDiff line numberDiff line change
@@ -118,23 +118,13 @@ jobs:
118118
if: ${{ failure() || cancelled() }}
119119
shell: bash
120120
env:
121-
# If we're here because steps failed or were skipped, then that's a critical problem. Otherwise it's a normal one.
122-
# We can't use the `failure()` or `cancelled()` convenience methods outside of the `if` condition, hence the
123-
# `contains()` calls.
124-
IS_CRITICAL: ${{ contains(join(steps.*.outcome), 'failure') || contains(join(steps.*.outcome), 'skipped') }}
125121
# A link to this run, so the PagerDuty assignee can quickly get here.
126122
RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
127123

128124
run: |
129125
130-
if [[ ${{ env.IS_CRITICAL }} == true ]]; then
131-
ALERT_SEV="critical"
132-
ALERT_SUMMARY="Production heartbeat script failed on ${{ runner.os }}"
133-
else
134-
# Leaving the else part here to help with running end-to-end sanity test with real alerts being created.
135-
ALERT_SEV="info"
136-
ALERT_SUMMARY="Production heartbeat script succeeded with retries on ${{ runner.os }}"
137-
fi
126+
ALERT_SEV="critical"
127+
ALERT_SUMMARY="Production heartbeat script failed on ${{ runner.os }}"
138128
# Define a helper function to create our POST request's data, to sidestep issues with nested quotations.
139129
generate_post_data() {
140130
# This is known as a HereDoc, and it lets us declare multi-line input ending when the specified limit string,

.github/workflows/publish.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,19 @@ jobs:
5858
with:
5959
# Before publishing, we want to test the extension against whatever
6060
# version of the scanner is currently live.
61-
use-scanner-tarball: false
61+
use-scanner-tarballs: false
6262

6363
publish-vscode:
6464
name: 'Publish to VSCode Marketplace'
6565
needs: [ 'run-tests' ]
6666
runs-on: ubuntu-latest
6767
env:
6868
VSCE_PERSONAL_ACCESS_TOKEN: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }}
69-
GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
7069
steps:
7170
- name: Checkout the release tag
7271
uses: actions/checkout@v4
7372
with:
7473
ref: ${{ github.event.release.tag_name || inputs.tag }}
75-
token: ${{ env.GITHUB_TOKEN }}
7674
# Set up node and install dependencies.
7775
- uses: actions/setup-node@v4
7876
with:
@@ -99,13 +97,11 @@ jobs:
9997
runs-on: ubuntu-latest
10098
env:
10199
IDEE_OVSX_PAT: ${{ secrets.IDEE_OVSX_PAT }}
102-
GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
103100
steps:
104101
- name: Checkout the release tag
105102
uses: actions/checkout@v4
106103
with:
107104
ref: ${{ github.event.release.tag_name || inputs.tag }}
108-
token: ${{ env.GITHUB_TOKEN }}
109105
# Set up node and install dependencies.
110106
- uses: actions/setup-node@v4
111107
with:

.github/workflows/run-tests.yml

+53-12
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@ name: run-tests
22
on:
33
workflow_call:
44
inputs:
5-
use-scanner-tarball:
5+
use-scanner-tarballs:
66
description: 'If true, install scanner via tarball'
77
required: false
88
type: boolean
99
default: false
10+
v4-tarball-suffix:
11+
description: 'The suffix attached to the name of the v4 tarball'
12+
required: false
13+
type: string
14+
default: 'dev-4'
15+
v5-tarball-suffix:
16+
description: 'The suffix attached to the name of the v5 tarball'
17+
required: false
18+
type: string
19+
default: 'dev'
1020
target-branch:
1121
description: "What branch should be checked out?"
1222
required: false
@@ -34,6 +44,9 @@ jobs:
3444
with:
3545
distribution: 'temurin'
3646
java-version: '11' # Always use Java v11 for running tests.
47+
- uses: actions/setup-python@v5
48+
with:
49+
python-version: 3.12
3750
- name: 'Install node module dependencies'
3851
run: yarn install --frozen-lockfile
3952
# We'll need to install the CLI tool, since some of the tests
@@ -44,34 +57,62 @@ jobs:
4457
# of the tests are integration tests.
4558
# NOTE: SFCA can come from a tarball built in a previous step,
4659
# or be installed as the currently-latest version.
47-
- name: Download Scanner Tarball
48-
if: ${{ inputs.use-scanner-tarball == true }}
49-
id: download
60+
- name: Download v4 Scanner Tarball
61+
if: ${{ inputs.use-scanner-tarballs == true }}
62+
id: download-v4
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: scanner-tarball-${{ inputs.v4-tarball-suffix}}
66+
# Download the tarball to a subdirectory of HOME, so it's guaranteed
67+
# to be somewhere the installation command can see.
68+
path: ~/downloads/tarball-v4
69+
- name: Install v4 Scanner Tarball
70+
if: ${{ inputs.use-scanner-tarballs == true }}
71+
shell: bash
72+
run: |
73+
# Determine the tarball's name.
74+
TARBALL_NAME=$(ls ~/downloads/tarball-v4/sfdx-scanner | grep salesforce-.*\\.tgz)
75+
echo $TARBALL_NAME
76+
# Figure out where the tarball was downloaded to.
77+
# To allow compatibility with Windows, replace backslashes with forward slashes
78+
# and rip off a leading `C:` if present.
79+
DOWNLOAD_PATH=`echo '${{ steps.download-v4.outputs.download-path }}' | tr '\\' '/'`
80+
echo $DOWNLOAD_PATH
81+
DOWNLOAD_PATH=`[[ $DOWNLOAD_PATH = C* ]] && echo $DOWNLOAD_PATH | cut -d':' -f 2 || echo $DOWNLOAD_PATH`
82+
echo $DOWNLOAD_PATH
83+
# Pipe in a `y` to simulate agreeing to install an unsigned package. Use a URI of the file's full path.
84+
echo y | sf plugins install "file://${DOWNLOAD_PATH}/sfdx-scanner/${TARBALL_NAME}"
85+
- name: Download v5 Scanner Tarball
86+
if: ${{ inputs.use-scanner-tarballs == true }}
87+
id: download-v5
5088
uses: actions/download-artifact@v4
5189
with:
52-
name: scanner-tarball
90+
name: scanner-tarball-${{ inputs.v5-tarball-suffix }}
5391
# Download the tarball to a subdirectory of HOME, so it's guaranteed
5492
# to be somewhere the installation command can see.
55-
path: ~/downloads/tarball
56-
- name: Install Scanner Tarball
57-
if: ${{ inputs.use-scanner-tarball == true }}
93+
path: ~/downloads/tarball-v5
94+
- name: Install v5 Scanner Tarball
95+
if: ${{ inputs.use-scanner-tarballs == true }}
5896
shell: bash
5997
run: |
6098
# Determine the tarball's name.
61-
TARBALL_NAME=$(ls ~/downloads/tarball/sfdx-scanner | grep salesforce-sfdx-scanner-[0-9]*\\.[0-9]*\\.[0-9]*\\.tgz)
99+
TARBALL_NAME=$(ls ~/downloads/tarball-v5/sfdx-scanner | grep salesforce-.*\\.tgz)
62100
echo $TARBALL_NAME
63101
# Figure out where the tarball was downloaded to.
64102
# To allow compatibility with Windows, replace backslashes with forward slashes
65103
# and rip off a leading `C:` if present.
66-
DOWNLOAD_PATH=`echo '${{ steps.download.outputs.download-path }}' | tr '\\' '/'`
104+
DOWNLOAD_PATH=`echo '${{ steps.download-v5.outputs.download-path }}' | tr '\\' '/'`
67105
echo $DOWNLOAD_PATH
68106
DOWNLOAD_PATH=`[[ $DOWNLOAD_PATH = C* ]] && echo $DOWNLOAD_PATH | cut -d':' -f 2 || echo $DOWNLOAD_PATH`
69107
echo $DOWNLOAD_PATH
70108
# Pipe in a `y` to simulate agreeing to install an unsigned package. Use a URI of the file's full path.
71109
echo y | sf plugins install "file://${DOWNLOAD_PATH}/sfdx-scanner/${TARBALL_NAME}"
72-
- name: Install Production scanner
73-
if: ${{ inputs.use-scanner-tarball == false }}
110+
- name: Install Production scanner v4
111+
if: ${{ inputs.use-scanner-tarballs == false }}
74112
run: sf plugins install @salesforce/sfdx-scanner
113+
- name: Install Production scanner v5
114+
if: ${{ inputs.use-scanner-tarballs == false }}
115+
run: sf plugins install code-analyzer
75116
# Run the tests. (Linux and non-Linux need slightly different commands.)
76117
- name: 'Run Tests (Linux)'
77118
run: xvfb-run -a yarn test

.github/workflows/validate-pr.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,27 @@ jobs:
1717
id: verify_pr_title
1818
# RUN TESTS
1919
# Step 1: Build the scanner tarball so it can be installed locally.
20-
build_scanner_tarball:
21-
name: 'Build scanner tarball'
20+
build_v4_scanner_tarball:
21+
name: 'Build v4 scanner tarball'
22+
uses: ./.github/workflows/build-scanner-tarball.yml
23+
with:
24+
target-branch: 'dev-4'
25+
build_v5_scanner_tarball:
26+
name: 'Build v5 scanner tarball'
2227
uses: ./.github/workflows/build-scanner-tarball.yml
2328
with:
2429
target-branch: 'dev'
2530
# Step 2: Actually run the tests.
2631
run_tests:
2732
name: 'Run unit tests'
28-
needs: build_scanner_tarball
33+
needs: [build_v4_scanner_tarball, build_v5_scanner_tarball]
2934
uses: ./.github/workflows/run-tests.yml
3035
with:
3136
# We want to validate the extension against whatever version of the scanner we
3237
# *plan* to publish, not what's *already* published.
33-
use-scanner-tarball: true
38+
use-scanner-tarballs: true
39+
v4-tarball-suffix: 'dev-4'
40+
v5-tarball-suffix: 'dev'
3441
# BUILD A VSIX ARTIFACT
3542
# Additionally, build a VSIX that can be downloaded by the user if needed.
3643
create-vsix-artifact:

SHA256.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ make sure that their SHA values match the values in the list below.
1515
shasum -a 256 <location_of_the_downloaded_file>
1616

1717
3. Confirm that the SHA in your output matches the value in this list of SHAs.
18-
146d022eebef24a355b117ad38713ac53a006f8e74cae178c6364a302878d3bc ./extensions/sfdx-code-analyzer-vscode-1.2.0.vsix
18+
9fd5830fd646e931d9b7156f97c15872e3739b0d5bfe3085fb65128b6829b3f4 ./extensions/sfdx-code-analyzer-vscode-1.3.0.vsix
1919
4. Change the filename extension for the file that you downloaded from .zip to
2020
.vsix.
2121

0 commit comments

Comments
 (0)