Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7a46f29
FIX @W-17014756@ Smoke tests can be invoked manually.
jfeingold35 Oct 28, 2024
f4d7923
Merge pull request #1659 from forcedotcom/d/W-17014756-c
jfeingold35 Oct 28, 2024
51a0bda
Merge branch 'dev-5' into m2d/v5.0.0-alpha.3
stephen-carter-at-sf Oct 29, 2024
bfd3124
Merge pull request #1663 from forcedotcom/m2d/v5.0.0-alpha.3
stephen-carter-at-sf Oct 29, 2024
ee09e28
CHANGE @W-17052870@ Polished config output
jfeingold35 Oct 30, 2024
cbcf4a6
CHANGE @W-17052870@ Removed orphaned message
jfeingold35 Oct 30, 2024
69a623b
Merge pull request #1665 from forcedotcom/d/W-17052870
jfeingold35 Oct 30, 2024
f755f67
CHANGE @W-17052953@ Polished output for rules command.
jfeingold35 Nov 1, 2024
cebd1e9
Merge pull request #1666 from forcedotcom/d/W-17052953
jfeingold35 Nov 1, 2024
8a26778
CHANGE @W-17052953@ Removed redundant information from rules output
jfeingold35 Nov 4, 2024
865619b
Merge pull request #1668 from forcedotcom/d/W-17052953-b
jfeingold35 Nov 4, 2024
4981ee1
NEW @W-17042397@ Detail output now has multilocation support (#1673)
jfeingold35 Nov 15, 2024
2bbb76f
CHANGE @W-17053004@ Polished run command output (#1669)
jfeingold35 Nov 15, 2024
c11ca62
NEW: @W-17100389@: Add in feedback url to help text and log
stephen-carter-at-sf Nov 15, 2024
812864d
Implement review feedback
stephen-carter-at-sf Nov 15, 2024
a132990
Merge pull request #1674 from forcedotcom/sc/W-17100389
stephen-carter-at-sf Nov 15, 2024
676a2b8
CHANGE @W-17100347@ Removed mentions of JUnit from CLI (#1675)
jfeingold35 Nov 18, 2024
d4daca7
@W-17281128@ Reworked interaction between -v and -f (#1676)
jfeingold35 Nov 20, 2024
6028a4d
CHANGE: @W-17272495@: Remove usage of RuleType and update dependencies
stephen-carter-at-sf Nov 20, 2024
d4e8d9a
Add in .npmrc file so that registry stays fixed
stephen-carter-at-sf Nov 20, 2024
0b225e1
Merge pull request #1677 from forcedotcom/sc/removeRuleType
stephen-carter-at-sf Nov 20, 2024
065608a
CHANGE: @W-17272495@: Polish detail view output
stephen-carter-at-sf Nov 20, 2024
c294715
Make detail view have relative paths to runDir
stephen-carter-at-sf Nov 20, 2024
b9f8764
Merge pull request #1678 from forcedotcom/sc/polishDetailView
stephen-carter-at-sf Nov 20, 2024
5df9dae
NEW @W-17100664@ Integrated FlowTest engine (#1679)
jfeingold35 Nov 21, 2024
e1e84f2
CHANGE @W-17100664@ Updating to latest version (#1680)
jfeingold35 Nov 21, 2024
2c59eb7
CHANGE: @W-17321151@: Only show fields in --detail view of rules comm…
stephen-carter-at-sf Nov 26, 2024
be7eb26
Merge pull request #1684 from forcedotcom/sc/W-17321151
stephen-carter-at-sf Nov 27, 2024
3ae4cd6
CHANGE: @W-17293079@: Update dependencies, refactor config command th…
stephen-carter-at-sf Dec 5, 2024
f3cb27f
Some refactoring
stephen-carter-at-sf Dec 5, 2024
219e83a
Final polish
stephen-carter-at-sf Dec 5, 2024
a8be747
Simplify comments for config based fields
stephen-carter-at-sf Dec 5, 2024
abbf926
FIX
stephen-carter-at-sf Dec 5, 2024
f105bfe
Merge pull request #1691 from forcedotcom/sc/W-17293079
stephen-carter-at-sf Dec 5, 2024
d06b633
@W-17159591@ Enabled SARIF output format (#1690)
jfeingold35 Dec 5, 2024
c4b9e64
@W-17312010@ Preparing dev-5 to replace dev as v5 home branch (#1696)
jfeingold35 Dec 12, 2024
7be3a6e
CHANGE @W-17312010@ Adding PMD AppExchange rule docs to keep links fu…
jfeingold35 Dec 12, 2024
b7be283
FIX @W-17312010@ Fixing production heartbeat invocation (#1698)
jfeingold35 Dec 13, 2024
2988644
CHANGE: @W-17386449@: Update cli to use latest core and engine depend…
stephen-carter-at-sf Dec 13, 2024
5beeffb
Merge pull request #1699 from forcedotcom/sc/updateDependencies
stephen-carter-at-sf Dec 13, 2024
0a92c72
CHANGE: @W-17310939@: Update to use latest core and pmd engine
stephen-carter-at-sf Dec 20, 2024
38f03f4
Fix test by updating stub
stephen-carter-at-sf Dec 20, 2024
17d7cff
Merge pull request #1701 from forcedotcom/sc/UpdateToLatest
stephen-carter-at-sf Dec 20, 2024
7e4cd83
CHANGE @W-17386357@ Updated core dependencies. (#1704)
jfeingold35 Dec 27, 2024
16ca560
FIX: @W-16371174@: Fix bug with config commands case insensitivity
stephen-carter-at-sf Dec 27, 2024
48922f2
Update release state message to Beta
stephen-carter-at-sf Dec 27, 2024
73c463e
Merge pull request #1705 from forcedotcom/sc/updateDependencies
stephen-carter-at-sf Dec 27, 2024
bf0747b
Preparing for v5.0.0-beta.0 release.
github-actions[bot] Dec 30, 2024
034b4e9
@W-17291574@ Fixed regex that broke smoke tests (#1708)
jfeingold35 Dec 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/automated-release-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: automated-release-tasks
on:
schedule:
# Cron syntax is "minute[0-59] hour[0-23] date[1-31] month[1-12] day[0-6]". '*' is 'any value,' and multiple values
# can be specified with comma-separated lists. All times are UTC.
# So this expression means "run at 12 PM UTC, every Friday".
- cron: "0 12 * * 5"


jobs:
# Depending on circumstances, we may want to exit early instead of running the workflow to completion.
verify-should-run:
runs-on: macos-latest
outputs:
should-run: ${{ steps.main.outputs.should_run }}
steps:
- id: main
run: |
# `date -u` returns UTC datetime, and `%u` formats the output to be the day of the week, with 1 being Monday,
# 2 being Tuesday, etc.
TODAY_DOW=$(date -u +%u)
# This `date` expression returns the last Tuesday of the month, which is our Release Day. %d formats the output
# as the day of the month (1-31).
NEXT_RELEASE_DATE=$(date -u -v1d -v+1m -v-1d -v-tue +%d)
# This `date` expression returns next Tuesday, and `%d` formats the output as the day of the month (1-31).
NEXT_TUESDAY_DATE=$(date -u -v+tue +%d)
# This workflow should only be allowed to run to completion on the Friday before Release Day.
[[ $TODAY_DOW != 5 || $NEXT_RELEASE_DATE != $NEXT_TUESDAY_DATE ]] && echo "should_run=false" >> "$GITHUB_OUTPUT" || echo "should_run=true" >> "$GITHUB_OUTPUT"
create-v5-release-branch:
runs-on: macos-latest
needs: verify-should-run
if: ${{ needs.verify-should-run.outputs.should-run == 'true' }}
steps:
- name: Invoke v5 beta workflow
uses: actions/github-script@v6
with:
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'create-release-branch.yml',
ref: 'dev'
});
create-v4-release-branch:
runs-on: macos-latest
needs: verify-should-run
if: ${{ needs.verify-should-run.outputs.should-run == 'true' }}
steps:
- name: Invoke v4 GA workflow
uses: actions/github-script@v6
with:
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'create-release-branch.yml',
ref: 'dev-4',
inputs: {
"release-type": "minor"
}
});
10 changes: 5 additions & 5 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ name: create-github-release
on:
pull_request:
branches:
- main-5
- main
types:
# There's no event type for "merged", so we just run any time a PR is closed, and exit early
# if the PR wasn't actually merged.
- closed

jobs:
create-github-release:
# Since the workflow runs any time a PR against main-5 is closed, we need this
# Since the workflow runs any time a PR against main is closed, we need this
# `if` to make sure that the workflow only does anything meaningful if the PR
# was actually merged.
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main-5
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main-5
ref: main
- name: Get version property
id: get-version-property
run: |
Expand All @@ -32,7 +32,7 @@ jobs:
with:
tag_name: v${{ steps.get-version-property.outputs.package_version }}
name: v${{ steps.get-version-property.outputs.package_version }}
target_commitish: main-5
target_commitish: main
body: See [release notes](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/release-notes.html)
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
make_latest: true
6 changes: 3 additions & 3 deletions .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
outputs:
branch-name: ${{ steps.create-branch.outputs.branch_name }}
steps:
# Checkout `dev-5`
# Checkout `dev`
- uses: actions/checkout@v4
with:
ref: 'dev-5'
ref: 'dev'
# We need to set up Node and install our Node dependencies.
- uses: actions/setup-node@v4
with:
Expand All @@ -24,7 +24,7 @@ jobs:
# Increment the version as desired locally, without actually committing anything.
- name: Locally increment version
run: |
npm --no-git-tag-version version prerelease --preid alpha
npm --no-git-tag-version version prerelease --preid beta
# The branch protection rule for `release-x.y.z` branches prevents pushing commits directly. To work around this,
# we create an interim branch that we _can_ push commits to, and we'll do our version bookkeeping in that branch
# instead.
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/daily-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,17 @@ jobs:
uses: ./.github/workflows/run-tests.yml
with:
node-matrix: "[{version: 'lts/*', artifact: 'lts'}, {version: 'latest', artifact: 'latest'}]"
java-matrix: "['11']"
v4-smoke-test:
runs-on: macos-latest
steps:
- name: Invoke v4 smoke tests
uses: actions/github-script@v6
with:
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'daily-smoke-tests.yml',
ref: 'dev-4'
});
145 changes: 11 additions & 134 deletions .github/workflows/production-heartbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,139 +10,16 @@ on:
- cron: '45 13,17,21 * * 1,2,3,4,5'
jobs:
production-heartbeat:
strategy:
# By default, if any job in a matrix fails, all other jobs are immediately cancelled. This makes the jobs run to completion instead.
fail-fast: false
matrix:
os: [{vm: ubuntu-latest, exe: .sh}, {vm: windows-2019, exe: .cmd}]
node: ['lts/*']
runs-on: ${{ matrix.os.vm }}
timeout-minutes: 60
runs-on: macos-latest
steps:
# === Setup. We need to get the code, set up nodejs, and create the results directory. ===
- uses: actions/checkout@v4
- name: Invoke v4 workflow
uses: actions/github-script@v6
with:
ref: 'release'
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: mkdir smoke-test-results

# === Set our environment variables, either using default values or the repo's secrets ===
- name: Set environment variables
id: env_var_setup
# We'll want to use bash for this, to avoid any cross-platform shenanigans
shell: bash
run: |
# In the following script, the use of the `echo "name=value" >> $GITHUB_ENV` structure is used to set/update
# environment variables. Such updates are visible to all subsequent steps.
#
# If the CLI_VERSION repo secret is set, we want to install that version ofsf-cli, so we set an environment
# variable. Otherwise, we leave the environment variable unset, so it implicitly defaults to `latest`.
# Note: This can be used to intentionally fail the GHA by providing an invalid version number.
if [[ -n "${{ secrets.CLI_VERSION }}" ]]; then
echo "CLI_VERSION=@${{ secrets.CLI_VERSION}}" >> $GITHUB_ENV
fi
# If the SCANNER_VERSION repo secret is set, we want to install that version of sfdx-scanner, so we set an
# environment variable. Otherwise, we leave the environment variable unset, so it implicitly defaults to `latest`.
# Note: This can be used to intentionally fail the GHA by providing an invalid version number.
if [[ -n "${{ secrets.SCANNER_VERSION }}" ]]; then
echo "SCANNER_VERSION=@${{ secrets.SCANNER_VERSION }}" >> $GITHUB_ENV
fi
# If the FAIL_SMOKE_TESTS repo secret is set to ANY value, we should respond by deleting the `test/test-jars`
# folder. The smoke tests expect this folder's contents to exist, so an invocation of `scanner:rule:add` should
# fail, thereby failing the smoke tests as a whole.
# Note: This serves no purpose aside from providing a way to simulate a smoke test failure.
if [[ -n "${{ secrets.FAIL_SMOKE_TESTS }}" ]]; then
rm -rf ./test/test-jars
fi


# === Make three attempts to install SF through npm ===
- name: Install SF
id: sf_install
# If the first attempt fails, wait a minute and try again. After a second failure, wait 5 minutes then try again. Then give up.
# Set an output parameter, `retry_count`, indicating the number of retry attempts that were made.
run: |
(echo "::set-output name=retry_count::0" && npm install -g @salesforce/cli${{ env.CLI_VERSION }}) ||
(echo "::set-output name=retry_count::1" && sleep 60 && npm install -g @salesforce/cli${{ env.CLI_VERSION }}) ||
(echo "::set-output name=retry_count::2" && sleep 300 && npm install -g @salesforce/cli${{ env.CLI_VERSION }})

# === Make three attempts to install the scanner plugin through sf ===
- name: Install Scanner Plugin
id: scanner_install
# If the first attempt fails, wait a minute and try again. After a second failure, wait 5 minutes then try again. Then give up.
# Set an output parameter, `retry_count`, indicating the number of retry attempts that were made.
run: |
(echo "::set-output name=retry_count::0" && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
(echo "::set-output name=retry_count::1" && sleep 60 && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }}) ||
(echo "::set-output name=retry_count::2" && sleep 300 && sf plugins install @salesforce/sfdx-scanner${{ env.SCANNER_VERSION }})

# === Log the installed plugins for easier debugging ===
- name: Log plugins
run: sf plugins

# === Attempt to execute the smoke tests ===
- name: Run smoke tests
id: smoke_tests
run: smoke-tests/smoke-test${{ matrix.os.exe }} sf

# === Upload the smoke-test-results folder as an artifact ===
- name: Upload smoke-test-results folder as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: smoke-test-results-${{ runner.os }}
path: smoke-test-results

# === Report any problems ===
- name: Report problems
# There are problems if any step failed or was skipped.
# Note that the `join()` call omits null values, so if any steps were skipped, they won't have a corresponding
# value in the string.
if: ${{ failure() || cancelled() }}
shell: bash
env:
# If we're here because steps failed or were skipped, then that's a critical problem. Otherwise it's a normal one.
# We can't use the `failure()` or `cancelled()` convenience methods outside of the `if` condition, hence the
# `contains()` calls.
IS_CRITICAL: ${{ contains(join(steps.*.outcome), 'failure') || contains(join(steps.*.outcome), 'skipped') }}
# Build the status strings for each step as environment variables to save space later. Null retry_count values
# will be replaced with `n/a` to maintain readability in the alert.
CLI_INSTALL_STATUS: ${{ steps.sf_install.outcome }} after ${{ steps.sf_install.outputs.retry_count || 'n/a' }} retries
SCANNER_INSTALL_STATUS: ${{ steps.scanner_install.outcome }} after ${{ steps.scanner_install.outputs.retry_count || 'n/a' }} retries
SMOKE_TESTS_STATUS: ${{ steps.smoke_tests.outcome }}
# A link to this run, so the PagerDuty assignee can quickly get here.
RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
# GHA env-vars don't have robust conditional logic, so we'll use this if-else branch to define some bash env-vars.
if [[ ${{ env.IS_CRITICAL }} == true ]]; then
ALERT_SEV="critical"
ALERT_SUMMARY="Production heartbeat script failed on ${{ runner.os }}"
else
ALERT_SEV="info"
ALERT_SUMMARY="Production heartbeat script succeeded with retries on ${{ runner.os }}"
fi
# Define a helper function to create our POST request's data, to sidestep issues with nested quotations.
generate_post_data() {
# This is known as a HereDoc, and it lets us declare multi-line input ending when the specified limit string,
# in this case EOF, is encountered.
cat <<EOF
{"payload": {
"summary": "${ALERT_SUMMARY}",
"source": "Github Actions",
"severity": "${ALERT_SEV}",
"custom_details": "SF install: ${{ env.CLI_INSTALL_STATUS }}. Scanner install: ${{ env.SCANNER_INSTALL_STATUS }}. Smoke tests: ${{ env.SMOKE_TESTS_STATUS }}."
},
"links": [{
"href": "${{ env.RUN_LINK }}",
"text": "Link to action execution"
}],
"event_action": "trigger",
"dedup_key": "GH-HB-${{ matrix.os.vm }}-${{ matrix.node }}",
"routing_key": "${{ secrets.PAGERDUTY_HEARTBEAT_KEY }}"
}
EOF
}
# Make our POST request
curl --request POST --data "$(generate_post_data)" https://events.pagerduty.com/v2/enqueue
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'production-heartbeat.yml',
ref: 'dev-4'
});
Loading
Loading