Skip to content

Commit b5377db

Browse files
authored
Merge pull request #1711 from forcedotcom/release-4.8.0
RELEASE @W-17291574@ Conducting v4.8.0 release
2 parents f1347aa + 668da56 commit b5377db

22 files changed

+1967
-1569
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ name: create-github-release
22
on:
33
pull_request:
44
branches:
5-
- main
5+
- main-4
66
types:
77
# There's no event type for "merged", so we just run any time a PR is closed, and exit early
88
# if the PR wasn't actually merged.
99
- closed
1010

1111
jobs:
1212
create-github-release:
13-
# Since the workflow runs any time a PR against main is closed, we need this
13+
# Since the workflow runs any time a PR against main-4 is closed, we need this
1414
# `if` to make sure that the workflow only does anything meaningful if the PR
1515
# was actually merged.
1616
if: github.event.pull_request.merged == true
1717
runs-on: ubuntu-latest
1818
permissions:
1919
contents: write
2020
steps:
21-
- name: Checkout main
21+
- name: Checkout main-4
2222
uses: actions/checkout@v4
2323
with:
24-
ref: main
24+
ref: main-4
2525
- name: Get version property
2626
id: get-version-property
2727
run: |
@@ -33,6 +33,6 @@ jobs:
3333
tag_name: v${{ steps.get-version-property.outputs.package_version }}
3434
name: v${{ steps.get-version-property.outputs.package_version }}
3535
body: See [release notes](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/release-notes.html)
36-
target_commitish: main
36+
target_commitish: main-4
3737
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
3838
make_latest: true

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
outputs:
2424
branch-name: ${{ steps.create-branch.outputs.branch_name }}
2525
steps:
26-
# Checkout `dev`
26+
# Checkout `dev-4`
2727
- uses: actions/checkout@v4
2828
with:
29-
ref: 'dev'
29+
ref: 'dev-4'
3030
# We need to set up Node and install our Node dependencies.
3131
- uses: actions/setup-node@v4
3232
with:

.github/workflows/heartbeat-v4.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: heartbeat-v4
2+
on:
3+
workflow_call: # As per documentation, the colon is necessary even though no config is required.
4+
workflow_dispatch: # As per documentation, the colon is necessary even though no config is required.
5+
6+
jobs:
7+
production-heartbeat:
8+
strategy:
9+
# By default, if any job in a matrix fails, all other jobs are immediately cancelled. This makes the jobs run to completion instead.
10+
fail-fast: false
11+
matrix:
12+
os: [{vm: ubuntu-latest, exe: .sh}, {vm: windows-2019, exe: .cmd}]
13+
node: ['lts/*']
14+
runs-on: ${{ matrix.os.vm }}
15+
timeout-minutes: 60
16+
steps:
17+
# === Setup. We need to get the code, set up nodejs, and create the results directory. ===
18+
- uses: actions/checkout@v4
19+
with:
20+
ref: 'main-4'
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node }}
24+
- uses: actions/setup-java@v4
25+
with:
26+
distribution: 'temurin'
27+
java-version: '11'
28+
- run: mkdir smoke-test-results
29+
30+
# === Set our environment variables, either using default values or the repo's secrets ===
31+
- name: Set environment variables
32+
id: env_var_setup
33+
# We'll want to use bash for this, to avoid any cross-platform shenanigans
34+
shell: bash
35+
run: |
36+
# In the following script, the use of the `echo "name=value" >> $GITHUB_ENV` structure is used to set/update
37+
# environment variables. Such updates are visible to all subsequent steps.
38+
#
39+
# If the CLI_VERSION repo secret is set, we want to install that version ofsf-cli, so we set an environment
40+
# variable. Otherwise, we leave the environment variable unset, so it implicitly defaults to `latest`.
41+
# Note: This can be used to intentionally fail the GHA by providing an invalid version number.
42+
if [[ -n "${{ secrets.CLI_VERSION }}" ]]; then
43+
echo "CLI_VERSION=@${{ secrets.CLI_VERSION}}" >> $GITHUB_ENV
44+
fi
45+
# If the SCANNER_VERSION repo secret is set, we want to install that version of sfdx-scanner, so we set an
46+
# environment variable. Otherwise, we leave the environment variable unset, so it implicitly defaults to `latest`.
47+
# Note: This can be used to intentionally fail the GHA by providing an invalid version number.
48+
if [[ -n "${{ secrets.SCANNER_VERSION }}" ]]; then
49+
echo "SCANNER_VERSION=@${{ secrets.SCANNER_VERSION }}" >> $GITHUB_ENV
50+
fi
51+
# If the FAIL_SMOKE_TESTS repo secret is set to ANY value, we should respond by deleting the `test/test-jars`
52+
# folder. The smoke tests expect this folder's contents to exist, so an invocation of `scanner:rule:add` should
53+
# fail, thereby failing the smoke tests as a whole.
54+
# Note: This serves no purpose aside from providing a way to simulate a smoke test failure.
55+
if [[ -n "${{ secrets.FAIL_SMOKE_TESTS }}" ]]; then
56+
rm -rf ./test/test-jars
57+
fi
58+
59+
60+
# === Make three attempts to install SF through npm ===
61+
- name: Install SF
62+
id: sf_install
63+
# If the first attempt fails, wait a minute and try again. After a second failure, wait 5 minutes then try again. Then give up.
64+
# Set an output parameter, `retry_count`, indicating the number of retry attempts that were made.
65+
run: |
66+
(echo "::set-output name=retry_count::0" && npm install -g @salesforce/cli${{ env.CLI_VERSION }}) ||
67+
(echo "::set-output name=retry_count::1" && sleep 60 && npm install -g @salesforce/cli${{ env.CLI_VERSION }}) ||
68+
(echo "::set-output name=retry_count::2" && sleep 300 && npm install -g @salesforce/cli${{ env.CLI_VERSION }})
69+
70+
# === Make three attempts to install the scanner plugin through sf ===
71+
- name: Install Scanner Plugin
72+
id: scanner_install
73+
# If the first attempt fails, wait a minute and try again. After a second failure, wait 5 minutes then try again. Then give up.
74+
# Set an output parameter, `retry_count`, indicating the number of retry attempts that were made.
75+
run: |
76+
(echo "::set-output name=retry_count::0" && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
77+
(echo "::set-output name=retry_count::1" && sleep 60 && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
78+
(echo "::set-output name=retry_count::2" && sleep 300 && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }})
79+
80+
# === Log the installed plugins for easier debugging ===
81+
- name: Log plugins
82+
run: sf plugins
83+
84+
# === Attempt to execute the smoke tests ===
85+
- name: Run smoke tests
86+
id: smoke_tests
87+
run: smoke-tests/smoke-test${{ matrix.os.exe }} sf
88+
89+
# === Upload the smoke-test-results folder as an artifact ===
90+
- name: Upload smoke-test-results folder as artifact
91+
if: ${{ always() }}
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: smoke-test-results-${{ runner.os }}
95+
path: smoke-test-results
96+
97+
# === Report any problems ===
98+
- name: Report problems
99+
# There are problems if any step failed or was skipped.
100+
# Note that the `join()` call omits null values, so if any steps were skipped, they won't have a corresponding
101+
# value in the string.
102+
if: ${{ failure() || cancelled() }}
103+
shell: bash
104+
env:
105+
# Build the status strings for each step as environment variables to save space later. Null retry_count values
106+
# will be replaced with `n/a` to maintain readability in the alert.
107+
CLI_INSTALL_STATUS: ${{ steps.sf_install.outcome }} after ${{ steps.sf_install.outputs.retry_count || 'n/a' }} retries
108+
SCANNER_INSTALL_STATUS: ${{ steps.scanner_install.outcome }} after ${{ steps.scanner_install.outputs.retry_count || 'n/a' }} retries
109+
SMOKE_TESTS_STATUS: ${{ steps.smoke_tests.outcome }}
110+
# A link to this run, so the PagerDuty assignee can quickly get here.
111+
RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
112+
run: |
113+
# GHA env-vars don't have robust conditional logic, so we'll use this if-else branch to define some bash env-vars.
114+
ALERT_SEV="critical"
115+
ALERT_SUMMARY="Production heartbeat script failed on ${{ runner.os }}"
116+
# Define a helper function to create our POST request's data, to sidestep issues with nested quotations.
117+
generate_post_data() {
118+
# This is known as a HereDoc, and it lets us declare multi-line input ending when the specified limit string,
119+
# in this case EOF, is encountered.
120+
cat <<EOF
121+
{"payload": {
122+
"summary": "${ALERT_SUMMARY}",
123+
"source": "Github Actions",
124+
"severity": "${ALERT_SEV}",
125+
"custom_details": "SF install: ${{ env.CLI_INSTALL_STATUS }}. Scanner install: ${{ env.SCANNER_INSTALL_STATUS }}. Smoke tests: ${{ env.SMOKE_TESTS_STATUS }}."
126+
},
127+
"links": [{
128+
"href": "${{ env.RUN_LINK }}",
129+
"text": "Link to action execution"
130+
}],
131+
"event_action": "trigger",
132+
"dedup_key": "GH-HB-${{ matrix.os.vm }}-${{ matrix.node }}",
133+
"routing_key": "${{ secrets.PAGERDUTY_HEARTBEAT_KEY }}"
134+
}
135+
EOF
136+
}
137+
# Make our POST request
138+
curl --request POST --data "$(generate_post_data)" https://events.pagerduty.com/v2/enqueue

.github/workflows/production-heartbeat.yml

Lines changed: 3 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -8,145 +8,7 @@ on:
88
# the jobs run only close to business hours of Central Time.
99
# Days were chosen to run only from Monday through Friday.
1010
- cron: '45 13,17,21 * * 1,2,3,4,5'
11-
jobs:
12-
production-heartbeat:
13-
strategy:
14-
# By default, if any job in a matrix fails, all other jobs are immediately cancelled. This makes the jobs run to completion instead.
15-
fail-fast: false
16-
matrix:
17-
os: [{vm: ubuntu-latest, exe: .sh}, {vm: windows-2019, exe: .cmd}]
18-
node: ['lts/*']
19-
runs-on: ${{ matrix.os.vm }}
20-
timeout-minutes: 60
21-
steps:
22-
# === Setup. We need to get the code, set up nodejs, and create the results directory. ===
23-
- uses: actions/checkout@v4
24-
with:
25-
ref: 'release'
26-
- uses: actions/setup-node@v4
27-
with:
28-
node-version: ${{ matrix.node }}
29-
- uses: actions/setup-java@v4
30-
with:
31-
distribution: 'temurin'
32-
java-version: '11'
33-
- run: mkdir smoke-test-results
34-
35-
# === Set our environment variables, either using default values or the repo's secrets ===
36-
- name: Set environment variables
37-
id: env_var_setup
38-
# We'll want to use bash for this, to avoid any cross-platform shenanigans
39-
shell: bash
40-
run: |
41-
# In the following script, the use of the `echo "name=value" >> $GITHUB_ENV` structure is used to set/update
42-
# environment variables. Such updates are visible to all subsequent steps.
43-
#
44-
# If the CLI_VERSION repo secret is set, we want to install that version ofsf-cli, so we set an environment
45-
# variable. Otherwise, we leave the environment variable unset, so it implicitly defaults to `latest`.
46-
# Note: This can be used to intentionally fail the GHA by providing an invalid version number.
47-
if [[ -n "${{ secrets.CLI_VERSION }}" ]]; then
48-
echo "CLI_VERSION=@${{ secrets.CLI_VERSION}}" >> $GITHUB_ENV
49-
fi
50-
# If the SCANNER_VERSION repo secret is set, we want to install that version of sfdx-scanner, so we set an
51-
# environment variable. Otherwise, we leave the environment variable unset, so it implicitly defaults to `latest`.
52-
# Note: This can be used to intentionally fail the GHA by providing an invalid version number.
53-
if [[ -n "${{ secrets.SCANNER_VERSION }}" ]]; then
54-
echo "SCANNER_VERSION=@${{ secrets.SCANNER_VERSION }}" >> $GITHUB_ENV
55-
fi
56-
# If the FAIL_SMOKE_TESTS repo secret is set to ANY value, we should respond by deleting the `test/test-jars`
57-
# folder. The smoke tests expect this folder's contents to exist, so an invocation of `scanner:rule:add` should
58-
# fail, thereby failing the smoke tests as a whole.
59-
# Note: This serves no purpose aside from providing a way to simulate a smoke test failure.
60-
if [[ -n "${{ secrets.FAIL_SMOKE_TESTS }}" ]]; then
61-
rm -rf ./test/test-jars
62-
fi
63-
64-
65-
# === Make three attempts to install SF through npm ===
66-
- name: Install SF
67-
id: sf_install
68-
# If the first attempt fails, wait a minute and try again. After a second failure, wait 5 minutes then try again. Then give up.
69-
# Set an output parameter, `retry_count`, indicating the number of retry attempts that were made.
70-
run: |
71-
(echo "::set-output name=retry_count::0" && npm install -g @salesforce/cli${{ env.CLI_VERSION }}) ||
72-
(echo "::set-output name=retry_count::1" && sleep 60 && npm install -g @salesforce/cli${{ env.CLI_VERSION }}) ||
73-
(echo "::set-output name=retry_count::2" && sleep 300 && npm install -g @salesforce/cli${{ env.CLI_VERSION }})
74-
75-
# === Make three attempts to install the scanner plugin through sf ===
76-
- name: Install Scanner Plugin
77-
id: scanner_install
78-
# If the first attempt fails, wait a minute and try again. After a second failure, wait 5 minutes then try again. Then give up.
79-
# Set an output parameter, `retry_count`, indicating the number of retry attempts that were made.
80-
run: |
81-
(echo "::set-output name=retry_count::0" && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
82-
(echo "::set-output name=retry_count::1" && sleep 60 && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
83-
(echo "::set-output name=retry_count::2" && sleep 300 && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }})
8411

85-
# === Log the installed plugins for easier debugging ===
86-
- name: Log plugins
87-
run: sf plugins
88-
89-
# === Attempt to execute the smoke tests ===
90-
- name: Run smoke tests
91-
id: smoke_tests
92-
run: smoke-tests/smoke-test${{ matrix.os.exe }} sf
93-
94-
# === Upload the smoke-test-results folder as an artifact ===
95-
- name: Upload smoke-test-results folder as artifact
96-
if: ${{ always() }}
97-
uses: actions/upload-artifact@v4
98-
with:
99-
name: smoke-test-results-${{ runner.os }}
100-
path: smoke-test-results
101-
102-
# === Report any problems ===
103-
- name: Report problems
104-
# There are problems if any step failed or was skipped.
105-
# Note that the `join()` call omits null values, so if any steps were skipped, they won't have a corresponding
106-
# value in the string.
107-
if: ${{ failure() || cancelled() }}
108-
shell: bash
109-
env:
110-
# If we're here because steps failed or were skipped, then that's a critical problem. Otherwise it's a normal one.
111-
# We can't use the `failure()` or `cancelled()` convenience methods outside of the `if` condition, hence the
112-
# `contains()` calls.
113-
IS_CRITICAL: ${{ contains(join(steps.*.outcome), 'failure') || contains(join(steps.*.outcome), 'skipped') }}
114-
# Build the status strings for each step as environment variables to save space later. Null retry_count values
115-
# will be replaced with `n/a` to maintain readability in the alert.
116-
CLI_INSTALL_STATUS: ${{ steps.sf_install.outcome }} after ${{ steps.sf_install.outputs.retry_count || 'n/a' }} retries
117-
SCANNER_INSTALL_STATUS: ${{ steps.scanner_install.outcome }} after ${{ steps.scanner_install.outputs.retry_count || 'n/a' }} retries
118-
SMOKE_TESTS_STATUS: ${{ steps.smoke_tests.outcome }}
119-
# A link to this run, so the PagerDuty assignee can quickly get here.
120-
RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
121-
run: |
122-
# GHA env-vars don't have robust conditional logic, so we'll use this if-else branch to define some bash env-vars.
123-
if [[ ${{ env.IS_CRITICAL }} == true ]]; then
124-
ALERT_SEV="critical"
125-
ALERT_SUMMARY="Production heartbeat script failed on ${{ runner.os }}"
126-
else
127-
ALERT_SEV="info"
128-
ALERT_SUMMARY="Production heartbeat script succeeded with retries on ${{ runner.os }}"
129-
fi
130-
# Define a helper function to create our POST request's data, to sidestep issues with nested quotations.
131-
generate_post_data() {
132-
# This is known as a HereDoc, and it lets us declare multi-line input ending when the specified limit string,
133-
# in this case EOF, is encountered.
134-
cat <<EOF
135-
{"payload": {
136-
"summary": "${ALERT_SUMMARY}",
137-
"source": "Github Actions",
138-
"severity": "${ALERT_SEV}",
139-
"custom_details": "SF install: ${{ env.CLI_INSTALL_STATUS }}. Scanner install: ${{ env.SCANNER_INSTALL_STATUS }}. Smoke tests: ${{ env.SMOKE_TESTS_STATUS }}."
140-
},
141-
"links": [{
142-
"href": "${{ env.RUN_LINK }}",
143-
"text": "Link to action execution"
144-
}],
145-
"event_action": "trigger",
146-
"dedup_key": "GH-HB-${{ matrix.os.vm }}-${{ matrix.node }}",
147-
"routing_key": "${{ secrets.PAGERDUTY_HEARTBEAT_KEY }}"
148-
}
149-
EOF
150-
}
151-
# Make our POST request
152-
curl --request POST --data "$(generate_post_data)" https://events.pagerduty.com/v2/enqueue
12+
jobs:
13+
invoke-heartbeat-v4:
14+
uses: ./.github/workflows/heartbeat-v4.yml

0 commit comments

Comments
 (0)