Skip to content

Commit d206ab4

Browse files
authored
Merge pull request #1710 from forcedotcom/release-5.0.0-beta.0
RELEASE @W-17291574@ Conducting v5.0.0-beta.0 release
2 parents 8ba0c4f + 034b4e9 commit d206ab4

File tree

118 files changed

+3723
-2232
lines changed

Some content is hidden

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

118 files changed

+3723
-2232
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: automated-release-tasks
2+
on:
3+
schedule:
4+
# Cron syntax is "minute[0-59] hour[0-23] date[1-31] month[1-12] day[0-6]". '*' is 'any value,' and multiple values
5+
# can be specified with comma-separated lists. All times are UTC.
6+
# So this expression means "run at 12 PM UTC, every Friday".
7+
- cron: "0 12 * * 5"
8+
9+
10+
jobs:
11+
# Depending on circumstances, we may want to exit early instead of running the workflow to completion.
12+
verify-should-run:
13+
runs-on: macos-latest
14+
outputs:
15+
should-run: ${{ steps.main.outputs.should_run }}
16+
steps:
17+
- id: main
18+
run: |
19+
# `date -u` returns UTC datetime, and `%u` formats the output to be the day of the week, with 1 being Monday,
20+
# 2 being Tuesday, etc.
21+
TODAY_DOW=$(date -u +%u)
22+
# This `date` expression returns the last Tuesday of the month, which is our Release Day. %d formats the output
23+
# as the day of the month (1-31).
24+
NEXT_RELEASE_DATE=$(date -u -v1d -v+1m -v-1d -v-tue +%d)
25+
# This `date` expression returns next Tuesday, and `%d` formats the output as the day of the month (1-31).
26+
NEXT_TUESDAY_DATE=$(date -u -v+tue +%d)
27+
# This workflow should only be allowed to run to completion on the Friday before Release Day.
28+
[[ $TODAY_DOW != 5 || $NEXT_RELEASE_DATE != $NEXT_TUESDAY_DATE ]] && echo "should_run=false" >> "$GITHUB_OUTPUT" || echo "should_run=true" >> "$GITHUB_OUTPUT"
29+
create-v5-release-branch:
30+
runs-on: macos-latest
31+
needs: verify-should-run
32+
if: ${{ needs.verify-should-run.outputs.should-run == 'true' }}
33+
steps:
34+
- name: Invoke v5 beta workflow
35+
uses: actions/github-script@v6
36+
with:
37+
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
38+
script: |
39+
await github.rest.actions.createWorkflowDispatch({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
workflow_id: 'create-release-branch.yml',
43+
ref: 'dev'
44+
});
45+
create-v4-release-branch:
46+
runs-on: macos-latest
47+
needs: verify-should-run
48+
if: ${{ needs.verify-should-run.outputs.should-run == 'true' }}
49+
steps:
50+
- name: Invoke v4 GA workflow
51+
uses: actions/github-script@v6
52+
with:
53+
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
54+
script: |
55+
await github.rest.actions.createWorkflowDispatch({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
workflow_id: 'create-release-branch.yml',
59+
ref: 'dev-4',
60+
inputs: {
61+
"release-type": "minor"
62+
}
63+
});

.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
5+
- main
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-5 is closed, we need this
13+
# Since the workflow runs any time a PR against main 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-5
21+
- name: Checkout main
2222
uses: actions/checkout@v4
2323
with:
24-
ref: main-5
24+
ref: main
2525
- name: Get version property
2626
id: get-version-property
2727
run: |
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
tag_name: v${{ steps.get-version-property.outputs.package_version }}
3434
name: v${{ steps.get-version-property.outputs.package_version }}
35-
target_commitish: main-5
35+
target_commitish: main
3636
body: See [release notes](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/release-notes.html)
3737
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
3838
make_latest: true

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
outputs:
1313
branch-name: ${{ steps.create-branch.outputs.branch_name }}
1414
steps:
15-
# Checkout `dev-5`
15+
# Checkout `dev`
1616
- uses: actions/checkout@v4
1717
with:
18-
ref: 'dev-5'
18+
ref: 'dev'
1919
# We need to set up Node and install our Node dependencies.
2020
- uses: actions/setup-node@v4
2121
with:
@@ -24,7 +24,7 @@ jobs:
2424
# Increment the version as desired locally, without actually committing anything.
2525
- name: Locally increment version
2626
run: |
27-
npm --no-git-tag-version version prerelease --preid alpha
27+
npm --no-git-tag-version version prerelease --preid beta
2828
# The branch protection rule for `release-x.y.z` branches prevents pushing commits directly. To work around this,
2929
# we create an interim branch that we _can_ push commits to, and we'll do our version bookkeeping in that branch
3030
# instead.

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,17 @@ jobs:
1212
uses: ./.github/workflows/run-tests.yml
1313
with:
1414
node-matrix: "[{version: 'lts/*', artifact: 'lts'}, {version: 'latest', artifact: 'latest'}]"
15-
java-matrix: "['11']"
15+
v4-smoke-test:
16+
runs-on: macos-latest
17+
steps:
18+
- name: Invoke v4 smoke tests
19+
uses: actions/github-script@v6
20+
with:
21+
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
22+
script: |
23+
await github.rest.actions.createWorkflowDispatch({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
workflow_id: 'daily-smoke-tests.yml',
27+
ref: 'dev-4'
28+
});

.github/workflows/production-heartbeat.yml

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

0 commit comments

Comments
 (0)