Skip to content

Commit 23cda30

Browse files
authored
Merge pull request #276 from forcedotcom/release-1.10.0
RELEASE @W-19156628@ Preparing for Release 1.10.0
2 parents 7449e06 + d89abf4 commit 23cda30

File tree

72 files changed

+5096
-5693
lines changed

Some content is hidden

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

72 files changed

+5096
-5693
lines changed

.git2gus/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"productTag": "a1aEE000000ZZanYAG",
3-
"defaultBuild": "scanner 2.0",
3+
"defaultBuild": "[SFCA] Code Analyzer 5.x",
44
"hideWorkItemUrl": true,
55
"issueTypeLabels": {
66
"type:feature": "USER STORY",

.github/workflows/build-tarball.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,8 @@ jobs:
3232
git clone -b ${{ inputs.target-branch }} https://github.com/forcedotcom/code-analyzer.git code-analyzer
3333
cd code-analyzer
3434
# Install and build dependencies.
35-
if [[ "${{ inputs.target-branch}}" == "dev-4" ]]; then
36-
yarn
37-
yarn build
38-
else
39-
npm install
40-
npm run build
41-
fi
35+
npm install
36+
npm run build
4237
# Create the tarball.
4338
npm pack
4439
# Upload the tarball as an artifact so it's usable elsewhere.

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

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ jobs:
9191
MESSAGE="Preparing for v$NEW_VERSION release."
9292
# GraphQL needs the latest versions of the files we changed, as Base64 encoded strings.
9393
NEW_PACKAGE="$(cat package.json | base64)"
94+
NEW_LOCKFILE="$(cat package-lock.json | base64)"
9495
gh api graphql -F message="$MESSAGE" -F oldOid=`git rev-parse HEAD` -F branch="$BRANCH" \
95-
-F newPackage="$NEW_PACKAGE" \
96+
-F newPackage="$NEW_PACKAGE" -F newLockfile="$NEW_LOCKFILE" \
9697
-f query='
97-
mutation ($message: String!, $oldOid: GitObjectID!, $branch: String!, $newPackage: Base64String!) {
98+
mutation ($message: String!, $oldOid: GitObjectID!, $branch: String!, $newPackage: Base64String!, $newLockfile: Base64String!) {
9899
createCommitOnBranch(input: {
99100
branch: {
100101
repositoryNameWithOwner: "forcedotcom/sfdx-code-analyzer-vscode",
@@ -108,6 +109,9 @@ jobs:
108109
{
109110
path: "package.json",
110111
contents: $newPackage
112+
}, {
113+
path: "package-lock.json",
114+
contents: $newLockfile
111115
}
112116
]
113117
},
@@ -133,19 +137,9 @@ jobs:
133137
git push -d origin ${NEW_VERSION}-interim
134138
# Output the release branch name so we can use it in later jobs.
135139
echo "branch_name=release-$NEW_VERSION" >> "$GITHUB_OUTPUT"
136-
# Build the tarballs so they can be installed locally when we run tests.
137-
build-v4-scanner-tarball:
138-
name: 'Build v4 scanner tarball'
139-
needs: verify-should-run
140-
uses: ./.github/workflows/build-tarball.yml
141-
with:
142-
# Note: Using `dev-4` here is technically incorrect. For full completeness's sake, we should probably be
143-
# using the branch corresponding to the upcoming scanner release. However, identifying that branch is
144-
# non-trivial, and there are unlikely to be major differences between the two that appear in the few days
145-
# between creating the branch and releasing it, so it _should_ be fine.
146-
target-branch: 'dev-4'
147-
build-v5-code-analyzer-tarball:
148-
name: 'Build v5 code-analyzer tarball'
140+
# Build the tarball so it can be installed locally when we run tests.
141+
build-code-analyzer-tarball:
142+
name: 'Build code-analyzer tarball'
149143
needs: verify-should-run
150144
uses: ./.github/workflows/build-tarball.yml
151145
with:
@@ -157,12 +151,11 @@ jobs:
157151
# Run all the various tests against the newly created branch.
158152
test-release-branch:
159153
name: 'Run unit tests'
160-
needs: [build-v4-scanner-tarball, build-v5-code-analyzer-tarball, create-release-branch]
154+
needs: [build-code-analyzer-tarball, create-release-branch]
161155
uses: ./.github/workflows/run-tests.yml
162156
with:
163157
# We want to validate the extension against whatever version of code analyzer we *plan* to publish,
164158
# not what's *already* published.
165159
use-tarballs: true
166-
v4-tarball-suffix: 'dev-4'
167-
v5-tarball-suffix: 'dev'
160+
tarball-suffix: 'dev'
168161
target-branch: ${{ needs.create-release-branch.outputs.branch-name }}

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

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,52 @@ on:
1010

1111
jobs:
1212
# Step 1: Build the tarballs so they can be installed locally.
13-
build-v4-tarball:
14-
name: 'Build v4 scanner tarball'
15-
uses: ./.github/workflows/build-tarball.yml
16-
with:
17-
target-branch: 'dev-4'
18-
build-v5-tarball:
19-
name: 'Build v5 code analyzer tarball'
13+
build-code-analyzer-tarball:
14+
name: Build code analyzer tarball
2015
uses: ./.github/workflows/build-tarball.yml
2116
with:
2217
target-branch: 'dev'
2318
# Step 2: Actually run the tests.
2419
smoke-test:
25-
name: 'Run smoke tests'
26-
needs: [build-v4-tarball, build-v5-tarball]
20+
name: Run smoke tests
21+
needs: [build-code-analyzer-tarball]
2722
uses: ./.github/workflows/run-tests.yml
2823
with:
2924
use-tarballs: true
30-
v4-tarball-suffix: 'dev-4'
31-
v5-tarball-suffix: 'dev'
25+
tarball-suffix: 'dev'
3226
secrets: inherit
33-
# Step 3: Build a VSIX artifact for use if needed.
27+
# Step 3: Retry on failure after install timeout or flaky tests
28+
retry-on-failure:
29+
name: Retry on failure
30+
runs-on: ubuntu-latest
31+
needs: [build-code-analyzer-tarball, smoke-test]
32+
if: failure() && fromJSON(github.run_attempt) < 3
33+
steps:
34+
- name: Trigger retry workflow
35+
env:
36+
GH_REPO: ${{ github.repository }}
37+
GH_TOKEN: ${{ github.token }}
38+
run: |
39+
gh workflow run retry.yml -F github_run_id=${{ github.run_id }}
40+
# Step 4: Build a VSIX artifact for use if needed.
3441
create-vsix-artifact:
3542
name: 'Upload VSIX as artifact'
3643
uses: ./.github/workflows/create-vsix-artifact.yml
3744
secrets: inherit
38-
# Step 4: Report any problems
45+
# Step 5: Report any problems
3946
report-problems:
40-
name: 'Report problems'
47+
name: Report problems
4148
runs-on: ubuntu-latest
42-
needs: [build-v4-tarball, build-v5-tarball, smoke-test, create-vsix-artifact]
43-
if: ${{ failure() || cancelled() }}
49+
needs: [build-code-analyzer-tarball, smoke-test, create-vsix-artifact]
50+
if: failure() && fromJSON(github.run_attempt) >= 3
4451
steps:
4552
- name: Report problems
4653
shell: bash
4754
env:
4855
RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
4956
run: |
5057
ALERT_SEV="info"
51-
ALERT_SUMMARY="Daily smoke test failed on ${{ runner.os }}"
58+
ALERT_SUMMARY="Daily smoke test failed after 3 attempts on ${{ runner.os }}"
5259
5360
generate_post_data() {
5461
cat <<EOF

.github/workflows/production-heartbeat.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
fi
9292
shell: bash
9393

94-
# 3 Install VS Code and Extension on macOS
94+
# 3 Install and Verify VS Code and Extension on macOS
9595
- name: Install VS Code on macOS
9696
if: runner.os == 'macOS'
9797
run: |
@@ -111,21 +111,35 @@ jobs:
111111
echo "::error Extension installation failed" && exit 1
112112
fi
113113
114-
# === Report any problems ===
114+
# Retry on failure after matrix is complete
115+
retry-on-failure:
116+
name: Retry on failure
117+
runs-on: ubuntu-latest
118+
needs: [production-heartbeat]
119+
if: failure() && fromJSON(github.run_attempt) < 3
120+
steps:
121+
- name: Trigger retry workflow
122+
env:
123+
GH_REPO: ${{ github.repository }}
124+
GH_TOKEN: ${{ github.token }}
125+
run: |
126+
gh workflow run retry.yml -F github_run_id=${{ github.run_id }}
127+
128+
# Report problems after retry mechanism is complete
129+
report-problems:
130+
name: Report problems
131+
runs-on: ubuntu-latest
132+
needs: [production-heartbeat, retry-on-failure]
133+
if: failure() && fromJSON(github.run_attempt) >= 3
134+
steps:
115135
- name: Report problems
116-
# There are problems if any step failed or was skipped.
117-
# Note that the `join()` call omits null values, so if any steps were skipped, they won't have a corresponding
118-
# value in the string.
119-
if: ${{ failure() || cancelled() }}
120136
shell: bash
121137
env:
122138
# A link to this run, so the PagerDuty assignee can quickly get here.
123139
RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
124-
125140
run: |
126-
127141
ALERT_SEV="info"
128-
ALERT_SUMMARY="Production heartbeat script failed on ${{ runner.os }}"
142+
ALERT_SUMMARY="Production heartbeat script failed after 3 attempts on ${{ runner.os }}"
129143
# Define a helper function to create our POST request's data, to sidestep issues with nested quotations.
130144
generate_post_data() {
131145
# This is known as a HereDoc, and it lets us declare multi-line input ending when the specified limit string,

.github/workflows/retry.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This workflow is used in order to retry a failed workflow run.
2+
name: Retry workflow
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
github_run_id:
7+
required: true
8+
description: "The ID of the workflow run to retry"
9+
jobs:
10+
Retry:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Retry Github Action ${{ inputs.github_run_id }}
14+
env:
15+
GH_REPO: ${{ github.repository }}
16+
GH_TOKEN: ${{ github.token }}
17+
GH_DEBUG: api # Used for verbose output
18+
run: |
19+
gh run watch ${{ inputs.github_run_id }} > /dev/null 2>&1
20+
gh run rerun ${{ inputs.github_run_id }} --failed

.github/workflows/run-tests.yml

Lines changed: 10 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ on:
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'
10+
tarball-suffix:
11+
description: 'The suffix attached to the name of the code-analyzer tarball'
1712
required: false
1813
type: string
1914
default: 'dev'
@@ -57,60 +52,32 @@ jobs:
5752
# of the tests are integration tests.
5853
# NOTE: SFCA can come from a tarball built in a previous step,
5954
# or be installed as the currently-latest version.
60-
- name: Download v4 Scanner Tarball
55+
- name: Download Code Analyzer Tarball
6156
if: ${{ inputs.use-tarballs == true }}
62-
id: download-v4
57+
id: download-tarball
6358
uses: actions/download-artifact@v4
6459
with:
65-
name: tarball-${{ inputs.v4-tarball-suffix}}
60+
name: tarball-${{ inputs.tarball-suffix }}
6661
# Download the tarball to a subdirectory of HOME, so it's guaranteed
6762
# to be somewhere the installation command can see.
68-
path: ~/downloads/tarball-v4
69-
- name: Install v4 Scanner Tarball
63+
path: ~/downloads/tarball
64+
- name: Install Code Analyzer Tarball
7065
if: ${{ inputs.use-tarballs == true }}
7166
shell: bash
7267
run: |
7368
# Determine the tarball's name.
74-
TARBALL_NAME=$(ls ~/downloads/tarball-v4/code-analyzer | grep salesforce-.*\\.tgz)
69+
TARBALL_NAME=$(ls ~/downloads/tarball/code-analyzer | grep salesforce-.*\\.tgz)
7570
echo $TARBALL_NAME
7671
# Figure out where the tarball was downloaded to.
7772
# To allow compatibility with Windows, replace backslashes with forward slashes
7873
# and rip off a leading `C:` if present.
79-
DOWNLOAD_PATH=`echo '${{ steps.download-v4.outputs.download-path }}' | tr '\\' '/'`
74+
DOWNLOAD_PATH=`echo '${{ steps.download-tarball.outputs.download-path }}' | tr '\\' '/'`
8075
echo $DOWNLOAD_PATH
8176
DOWNLOAD_PATH=`[[ $DOWNLOAD_PATH = C* ]] && echo $DOWNLOAD_PATH | cut -d':' -f 2 || echo $DOWNLOAD_PATH`
8277
echo $DOWNLOAD_PATH
8378
# Pipe in a `y` to simulate agreeing to install an unsigned package. Use a URI of the file's full path.
8479
echo y | sf plugins install "file://${DOWNLOAD_PATH}/code-analyzer/${TARBALL_NAME}"
85-
- name: Download v5 Code Analyzer Tarball
86-
if: ${{ inputs.use-tarballs == true }}
87-
id: download-v5
88-
uses: actions/download-artifact@v4
89-
with:
90-
name: tarball-${{ inputs.v5-tarball-suffix }}
91-
# Download the tarball to a subdirectory of HOME, so it's guaranteed
92-
# to be somewhere the installation command can see.
93-
path: ~/downloads/tarball-v5
94-
- name: Install v5 Code Analyzer Tarball
95-
if: ${{ inputs.use-tarballs == true }}
96-
shell: bash
97-
run: |
98-
# Determine the tarball's name.
99-
TARBALL_NAME=$(ls ~/downloads/tarball-v5/code-analyzer | grep salesforce-.*\\.tgz)
100-
echo $TARBALL_NAME
101-
# Figure out where the tarball was downloaded to.
102-
# To allow compatibility with Windows, replace backslashes with forward slashes
103-
# and rip off a leading `C:` if present.
104-
DOWNLOAD_PATH=`echo '${{ steps.download-v5.outputs.download-path }}' | tr '\\' '/'`
105-
echo $DOWNLOAD_PATH
106-
DOWNLOAD_PATH=`[[ $DOWNLOAD_PATH = C* ]] && echo $DOWNLOAD_PATH | cut -d':' -f 2 || echo $DOWNLOAD_PATH`
107-
echo $DOWNLOAD_PATH
108-
# Pipe in a `y` to simulate agreeing to install an unsigned package. Use a URI of the file's full path.
109-
echo y | sf plugins install "file://${DOWNLOAD_PATH}/code-analyzer/${TARBALL_NAME}"
110-
- name: Install Production scanner v4
111-
if: ${{ inputs.use-tarballs == false }}
112-
run: sf plugins install @salesforce/sfdx-scanner
113-
- name: Install Production code-analyzer v5
80+
- name: Install Production code-analyzer
11481
if: ${{ inputs.use-tarballs == false }}
11582
run: sf plugins install code-analyzer
11683
# Run the tests. (Linux and non-Linux need slightly different commands.)

.github/workflows/validate-pr.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,21 @@ jobs:
4747
echo "Valid PR title: '$title'"
4848
# RUN TESTS
4949
# Step 1: Build the tarball so it can be installed locally.
50-
build_v4_scanner_tarball:
51-
name: 'Build v4 scanner tarball'
52-
uses: ./.github/workflows/build-tarball.yml
53-
with:
54-
target-branch: 'dev-4'
55-
build_v5_code_analyzer_tarball:
56-
name: 'Build v5 code analyzer tarball'
50+
build_code_analyzer_tarball:
51+
name: 'Build code analyzer tarball'
5752
uses: ./.github/workflows/build-tarball.yml
5853
with:
5954
target-branch: 'dev'
6055
# Step 2: Actually run the tests.
6156
run_tests:
6257
name: 'Run unit tests'
63-
needs: [build_v4_scanner_tarball, build_v5_code_analyzer_tarball]
58+
needs: [build_code_analyzer_tarball]
6459
uses: ./.github/workflows/run-tests.yml
6560
with:
6661
# We want to validate the extension against whatever version of code analyzer we
6762
# *plan* to publish, not what's *already* published.
6863
use-tarballs: true
69-
v4-tarball-suffix: 'dev-4'
70-
v5-tarball-suffix: 'dev'
64+
tarball-suffix: 'dev'
7165
# BUILD A VSIX ARTIFACT
7266
# Additionally, build a VSIX that can be downloaded by the user if needed.
7367
create-vsix-artifact:

SHA256.md

Lines changed: 1 addition & 1 deletion
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-
112139aa0cd29e64729aceaea9fc1c19c072b95af7eda751ca9ad92a346a9783 ./extensions/sfdx-code-analyzer-vscode-1.8.0.vsix
18+
a26fa56962cc53dfd3deeb0a32f184218e71b0110eb96b1a56966d363538fee6 ./extensions/sfdx-code-analyzer-vscode-1.9.0.vsix
1919
4. Change the filename extension for the file that you downloaded from .zip to
2020
.vsix.
2121

jest.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const config = {
55
testMatch: ['**/*.test.ts'],
66
collectCoverage: true,
77
collectCoverageFrom: [
8-
'src/**/*.ts',
8+
'./src/**/*.ts',
99
],
1010
coveragePathIgnorePatterns: [
1111
'/src/test/',

0 commit comments

Comments
 (0)