From bc1d1228c6eec632676cf1bc9db98c7d6154b005 Mon Sep 17 00:00:00 2001 From: Randi Wilson Date: Wed, 30 Apr 2025 14:09:57 -0400 Subject: [PATCH 01/10] CHANGE: @W-18394257@ Update DevOps Post-GA --- ...ture_request.yml => 1-feature_request.yml} | 0 .github/ISSUE_TEMPLATE/1-scanner_run_bug.yml | 104 ---------------- .github/ISSUE_TEMPLATE/2-general_feedback.yml | 36 ++++++ .../ISSUE_TEMPLATE/2-scanner_run_dfa_bug.yml | 117 ------------------ .../3-scanner_run_false_result.yml | 98 --------------- .../4-scanner_run_dfa_false_result.yml | 94 -------------- .../workflows/apply-npm-tag-to-version.yml | 18 +-- .github/workflows/automated-release-tasks.yml | 38 +----- .github/workflows/daily-smoke-tests-v4.yml | 29 ----- .github/workflows/production-heartbeat.yml | 20 +-- .github/workflows/validate-pr.yml | 10 -- .../test/verifyMain2DevPrTitle.test.ts | 30 ++--- .../test/verifyReleasePrTitle.test.ts | 20 +-- 13 files changed, 73 insertions(+), 541 deletions(-) rename .github/ISSUE_TEMPLATE/{5-feature_request.yml => 1-feature_request.yml} (100%) delete mode 100644 .github/ISSUE_TEMPLATE/1-scanner_run_bug.yml create mode 100644 .github/ISSUE_TEMPLATE/2-general_feedback.yml delete mode 100644 .github/ISSUE_TEMPLATE/2-scanner_run_dfa_bug.yml delete mode 100644 .github/ISSUE_TEMPLATE/3-scanner_run_false_result.yml delete mode 100644 .github/ISSUE_TEMPLATE/4-scanner_run_dfa_false_result.yml delete mode 100644 .github/workflows/daily-smoke-tests-v4.yml diff --git a/.github/ISSUE_TEMPLATE/5-feature_request.yml b/.github/ISSUE_TEMPLATE/1-feature_request.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/5-feature_request.yml rename to .github/ISSUE_TEMPLATE/1-feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/1-scanner_run_bug.yml b/.github/ISSUE_TEMPLATE/1-scanner_run_bug.yml deleted file mode 100644 index 5712d7fcf..000000000 --- a/.github/ISSUE_TEMPLATE/1-scanner_run_bug.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Report a Bug with scanner run -description: Report an issue with the scanner run command. -title: "[BUG][scanner run] " -labels: [] -body: -- type: dropdown - attributes: - label: Have you tried to resolve this issue yourself first? - description: | - Oftentimes, you can resolve `scanner run` issues on your own. Follow these steps: - 1. Read the error message. - 2. Read [Salesforce Code Analyzer](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview) documentation. - 3. Double-check the command that you ran. Ensure that items like file names, method names, and category names are correctly spelled and cased. - 4. Verify that your code is syntactically valid. - 5. Verify that the error is reproducible on another machine. - 6. Attempt to reproduce the error by running against that engine directly instead of via the Code Analyzer. If you can reproduce the error, create an issue on that engine's repo instead of on Code Analyzer's repo. - 7. Check open and closed [issues](https://github.com/forcedotcom/sfdx-scanner/issues) to see if your issue is already logged. - - If you're listing a managed package on AppExchange, prepare for the security review by following the instructions in the [Scan Your Solution with Salesforce Code Analyzer](https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/security_review_code_analyzer_scan.htm) section of the ISVforce Guide. - - **I confirm that I have gone through these steps and still have an issue to report.** - (You must select "Yes" to create an issue.) - options: - - '' - - "Yes" - validations: - required: true -- type: textarea - attributes: - label: Bug Description - description: Provide a clear and concise description of what the bug is. - validations: - required: true -- type: textarea - attributes: - label: Output / Logs - description: Attach any output or logs here - placeholder: | - Add log output here or drag files here. -- type: textarea - attributes: - label: Steps To Reproduce - description: List out the steps that you used to reproduce the bug behavior. Be as specific and clear as possible. - placeholder: | - 1. I first do ... - 2. Then I do ... - 3. Lastly, I do ... - validations: - required: true -- type: textarea - attributes: - label: Expected Behavior - description: Provide a clear and concise description of what you expected to happen. - validations: - required: true -- type: input - attributes: - label: Operating System - description: | - What is your machine's operating system? - placeholder: | - Example: MacOS Sonoma 14.4.1 - validations: - required: true -- type: input - attributes: - label: Salesforce CLI Version - description: | - What do you get from the command "sf --version"? - placeholder: | - Example: @salesforce/cli/2.40.7 darwin-arm64 node-v20.12.2 - validations: - required: true -- type: input - attributes: - label: Code Analyzer Plugin (@salesforce/sfdx-scanner) Version - description: | - What do you get from the command "sf plugins"? - placeholder: | - Example: @salesforce/sfdx-scanner 4.1.0 (latest-beta) - validations: - required: true -- type: textarea - attributes: - label: Additional Context (Screenshots, Files, etc) - description: Add any other context about the problem. - placeholder: | - Drag any files or screenshots you have here. -- type: textarea - attributes: - label: Workaround - description: What ways have you found to sidestep the problem? If you haven't found a workaround, what have you tried so far? -- type: dropdown - attributes: - label: Urgency - description: What is the severity of the problem? - options: - - Low - - Moderate - - High - - Critical - default: 0 - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/2-general_feedback.yml b/.github/ISSUE_TEMPLATE/2-general_feedback.yml new file mode 100644 index 000000000..d53e7eed0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-general_feedback.yml @@ -0,0 +1,36 @@ +name: General Feedback +description: Share general feedback, comments, or questions about Salesforce Code Analyzer. +title: "[Feedback] " +labels: ['FEEDBACK'] +body: +- type: textarea + attributes: + label: Feedback + description: Share your thoughts, comments, or questions about Salesforce Code Analyzer. + placeholder: I'd like to share some feedback about... + validations: + required: true +- type: textarea + attributes: + label: Context + description: Provide any relevant context such as your use case, environment, or specific scenario. + placeholder: I'm using Salesforce Code Analyzer in the following context... +- type: textarea + attributes: + label: Suggestions + description: Do you have any suggestions for improvement? + placeholder: I think it would be better if... +- type: textarea + attributes: + label: Additional Information + description: Add any other information, screenshots, or examples. + placeholder: | + Drag any files or screenshots you have here. +- type: dropdown + attributes: + label: Are you interested in contributing to this project? + options: + - Yes, I'd like to contribute + - Maybe in the future + - No, just providing feedback + default: 0 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/2-scanner_run_dfa_bug.yml b/.github/ISSUE_TEMPLATE/2-scanner_run_dfa_bug.yml deleted file mode 100644 index 877e9d07d..000000000 --- a/.github/ISSUE_TEMPLATE/2-scanner_run_dfa_bug.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Report a Bug with scanner run dfa -description: Report an issue with the scanner run dfa command. -title: "[BUG][scanner run dfa] " -labels: [] -body: -- type: dropdown - attributes: - label: Have you tried to resolve this issue yourself first? - description: | - Oftentimes, you can resolve `scanner run dfa` issues on your own. Follow these steps: - 1. Read the error message. - 2. Read [Salesforce Graph Engine](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/salesforce-graph-engine.html) documentation. - 3. Read our guide for [troubleshooting Graph Engine errors](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/troubleshooting.html). - 4. Read our guidelines to resolve [LimitReached errors](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/working-with-graph-engine.html#limitreached-errors) and [path evaluation timeouts](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/troubleshooting.html#issues-using-salesforce-graph-engine). - 5. Read our [Guide to Writing Graph Engine-Friendly Code](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/graph-engine-friendly-code.html). - 6. Double-check the command that you entered. Ensure that items like file names, method names, and category names are correctly spelled and cased. - 7. Verify that your code is syntactically valid. - 8. Verify that the error is reproducible on another machine. - 9. Check open and closed [issues](https://github.com/forcedotcom/sfdx-scanner/issues) to see if your issue is already logged. - 10. If there's no existing issue that covers your situation, log a new issue. - - If you're listing a managed package on AppExchange, prepare for the security review by following the instructions in the [Scan Your Solution with Salesforce Code Analyzer](https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/security_review_code_analyzer_scan.htm) section of the ISVforce Guide. - *Note: In your scan report, if you see an InternalExecutionError or a LimitReached error, you can still submit for AppExchange security review. These errors aren't blockers.* - - **I confirm that I have gone through these steps and still have an issue to report.** - (You must select "Yes" to create an issue.) - options: - - '' - - "Yes" - validations: - required: true -- type: textarea - attributes: - label: Bug Description - description: Provide a clear and concise description of what the bug is. - validations: - required: true -- type: textarea - attributes: - label: Output / Logs - description: Attach any output or logs here. The log for the Salesforce Graph Engine can be found in `~/.sfdx-scanner/sfge.log`. If the error message mentions a specific graph vertex, check its DefiningType and BeginLine properties and include the code at that line. - placeholder: | - Add log output here or drag files here. -- type: textarea - attributes: - label: Steps To Reproduce - description: List out the steps that you used to reproduce the bug behavior. Be as specific and clear as possible. - placeholder: | - 1. I first do ... - 2. Then I do ... - 3. Lastly, I do ... - validations: - required: true -- type: textarea - attributes: - label: Expected Behavior - description: Provide a clear and concise description of what you expected to happen. - validations: - required: true -- type: input - attributes: - label: Operating System - description: | - What is your machine's operating system? - placeholder: | - Example: MacOS Sonoma 14.4.1 - validations: - required: true -- type: input - attributes: - label: Salesforce CLI Version - description: | - What do you get from the command "sf --version"? - placeholder: | - Example: @salesforce/cli/2.40.7 darwin-arm64 node-v20.12.2 - validations: - required: true -- type: input - attributes: - label: Code Analyzer Plugin (@salesforce/sfdx-scanner) Version - description: | - What do you get from the command "sf plugins"? - placeholder: | - Example: @salesforce/sfdx-scanner 4.1.0 (latest-beta) - validations: - required: true -- type: input - attributes: - label: Java Version - description: | - What do you get from the command "java -version"? - placeholder: | - Example: openjdk version "11.0.17.0.1" 2022-10-18 LTS - validations: - required: true -- type: textarea - attributes: - label: Additional Context (Screenshots, Files, etc) - description: Add any other context about the problem. - placeholder: | - Drag any files or screenshots you have here. -- type: textarea - attributes: - label: Workaround - description: What ways have you found to sidestep the problem? If you haven't found a workaround, what have you tried so far? -- type: dropdown - attributes: - label: Urgency - description: What is the severity of the problem? - options: - - Low - - Moderate - - High - - Critical - default: 0 - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/3-scanner_run_false_result.yml b/.github/ISSUE_TEMPLATE/3-scanner_run_false_result.yml deleted file mode 100644 index 94bfd571f..000000000 --- a/.github/ISSUE_TEMPLATE/3-scanner_run_false_result.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Report a False Result with scanner run -description: Report false results in scanner run scan reports. If you're submitting your managed package for AppExchange security review, include documentation of your false results with your submission. -title: "[False Result][scanner run] " -labels: [] -body: -- type: dropdown - attributes: - label: Have you verified this is Salesforce Code Analyzer specific? - description: | - Oftentimes, a rule is not directly owned by Salesforce Code Analyzer but instead owned by the underlying tool associated with the rule (like PMD or eslint for example). Before reporting this issue, please check to see if running the corresponding tool separate from Salesforce Code Analyzer also gives you a false positive. If so, then please create an issue with that corresponding tool instead of here. Otherwise, create your issue here. - - **I have verified that the issue is only reproducible when running through Salesforce Code Analyzer.** - (You must select "Yes" to create an issue.) - options: - - '' - - "Yes" - validations: - required: true -- type: textarea - attributes: - label: Description - description: Provide a clear and concise description of what the bug is. - validations: - required: true -- type: textarea - attributes: - label: Output / Logs - description: Attach any output or logs here - placeholder: | - Add log output here or drag files here. -- type: textarea - attributes: - label: Steps To Reproduce - description: List out the steps that you used to reproduce the bug behavior. Be as specific and clear as possible. - placeholder: | - 1. I first do ... - 2. Then I do ... - 3. Lastly, I do ... - validations: - required: true -- type: textarea - attributes: - label: Expected Behavior - description: Provide a clear and concise description of why you believe this is a false result. - placeholder: | - I expected the result to be ... - I believe the provide result is wrong because ... - validations: - required: true -- type: input - attributes: - label: Operating System - description: | - What is your machine's operating system? - placeholder: | - Example: MacOS Sonoma 14.4.1 - validations: - required: true -- type: input - attributes: - label: Salesforce CLI Version - description: | - What do you get from the command "sf --version"? - placeholder: | - Example: @salesforce/cli/2.40.7 darwin-arm64 node-v20.12.2 - validations: - required: true -- type: input - attributes: - label: Code Analyzer Plugin (@salesforce/sfdx-scanner) Version - description: | - What do you get from the command "sf plugins"? - placeholder: | - Example: @salesforce/sfdx-scanner 4.1.0 (latest-beta) - validations: - required: true -- type: textarea - attributes: - label: Additional Context (Screenshots, Files, etc) - description: Add any other context about the problem. - placeholder: | - Drag any files or screenshots you have here. -- type: textarea - attributes: - label: Workaround - description: What ways have you found to sidestep the problem? If you haven't found a workaround, what have you tried so far? -- type: dropdown - attributes: - label: Urgency - description: What is the severity of the problem? - options: - - Low - - Moderate - - High - - Critical - default: 0 - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/4-scanner_run_dfa_false_result.yml b/.github/ISSUE_TEMPLATE/4-scanner_run_dfa_false_result.yml deleted file mode 100644 index 6369e7dd0..000000000 --- a/.github/ISSUE_TEMPLATE/4-scanner_run_dfa_false_result.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Report a False Result with scanner run dfa -description: Report false results returned in scanner run dfa scan reports. If you're submitting for AppExchange security review, include documentation of your false results with your submission. -title: "[False Result][scanner run dfa] " -labels: [] -body: -- type: textarea - attributes: - label: Bug Description - description: Provide a clear and concise description of what the bug is. - validations: - required: true -- type: textarea - attributes: - label: Output / Logs - description: Attach any output or logs here. The log for the Salesforce Graph Engine can be found in `~/.sfdx-scanner/sfge.log`. If the error message mentions a specific graph vertex, check its DefiningType and BeginLine properties and include the code at that line. - placeholder: | - Add log output here or drag files here. -- type: textarea - attributes: - label: Steps To Reproduce - description: List out the steps that you used to reproduce the bug behavior. Be as specific and clear as possible. - placeholder: | - 1. I first do ... - 2. Then I do ... - 3. Lastly, I do ... - validations: - required: true -- type: textarea - attributes: - label: Expected Behavior - description: Provide a clear and concise description of why you believe this is a false result. - placeholder: | - I expected the result to be ... - I believe the provide result is wrong because ... - validations: - required: true -- type: input - attributes: - label: Operating System - description: | - What is your machine's operating system? - placeholder: | - Example: MacOS Sonoma 14.4.1 - validations: - required: true -- type: input - attributes: - label: Salesforce CLI Version - description: | - What do you get from the command "sf --version"? - placeholder: | - Example: @salesforce/cli/2.40.7 darwin-arm64 node-v20.12.2 - validations: - required: true -- type: input - attributes: - label: Code Analyzer Plugin (@salesforce/sfdx-scanner) Version - description: | - What do you get from the command "sf plugins"? - placeholder: | - Example: @salesforce/sfdx-scanner 4.1.0 (latest-beta) - validations: - required: true -- type: input - attributes: - label: Java Version - description: | - What do you get from the command "java -version"? - placeholder: | - Example: openjdk version "11.0.17.0.1" 2022-10-18 LTS - validations: - required: true -- type: textarea - attributes: - label: Additional Context (Screenshots, Files, etc) - description: Add any other context about the problem. - placeholder: | - Drag any files or screenshots you have here. -- type: textarea - attributes: - label: Workaround - description: What ways have you found to sidestep the problem? If you haven't found a workaround, what have you tried so far? -- type: dropdown - attributes: - label: Urgency - description: What is the severity of the problem? - options: - - Low - - Moderate - - High - - Critical - default: 0 - validations: - required: true diff --git a/.github/workflows/apply-npm-tag-to-version.yml b/.github/workflows/apply-npm-tag-to-version.yml index b31110d0b..fb199f4e1 100644 --- a/.github/workflows/apply-npm-tag-to-version.yml +++ b/.github/workflows/apply-npm-tag-to-version.yml @@ -2,14 +2,6 @@ name: apply-npm-tag-to-version on: workflow_dispatch: inputs: - package_name: - description: 'Select Package Name:' - required: true - type: choice - options: - - '@salesforce/plugin-code-analyzer' - # TODO: Remove after April Release - - '@salesforce/sfdx-scanner' tag_name: description: 'Tag Name (ex: latest):' required: true @@ -39,17 +31,11 @@ jobs: echo "::error::You did not confirm, so dist-tag not called." exit 1 - - name: Validate package name (sanity check) - if: ${{ github.event.inputs.package_name != '@salesforce/plugin-code-analyzer' && github.event.inputs.package_name != '@salesforce/sfdx-scanner' }} - run: | - echo "Invalid package name. Please choose one of the allowed package names." - exit 1 - - name: Prepare NPM Credentials run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - name: Apply tag run: | - echo "You have confirmed that using this action is only recommended for emergency rollback situations and that you are responsible for manually applying the ${{ github.event.inputs.tag_name }} tag to ${{ github.event.inputs.package_name }}@${{ github.event.inputs.version }}." + echo "You have confirmed that using this action is only recommended for emergency rollback situations and that you are responsible for manually applying the ${{ github.event.inputs.tag_name }} tag to @salesforce/plugin-code-analyzer@${{ github.event.inputs.version }}." echo "Applying tag..." - npm dist-tag add ${{ github.event.inputs.package_name }}@${{ github.event.inputs.version }} ${{ github.event.inputs.tag_name }} + npm dist-tag add @salesforce/plugin-code-analyzer@${{ github.event.inputs.version }} ${{ github.event.inputs.tag_name }} diff --git a/.github/workflows/automated-release-tasks.yml b/.github/workflows/automated-release-tasks.yml index a747a3396..5e089734e 100644 --- a/.github/workflows/automated-release-tasks.yml +++ b/.github/workflows/automated-release-tasks.yml @@ -31,38 +31,8 @@ jobs: needs: verify-should-run if: ${{ needs.verify-should-run.outputs.should-run == 'true' }} steps: - - name: Invoke v5 workflow - uses: actions/github-script@v6 + - name: Create release branch + uses: ./.github/workflows/create-release-branch.yml + secrets: inherit with: - github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }} - # TODO: remove inputs after April Release; will default to minor - script: | - await github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'create-release-branch.yml', - ref: 'dev', - inputs: { - "release-type": "patch" - } - }); -# TODO: Remove this after last v4.x release in April - 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" - } - }); + release-type: minor diff --git a/.github/workflows/daily-smoke-tests-v4.yml b/.github/workflows/daily-smoke-tests-v4.yml deleted file mode 100644 index 284f4d2fa..000000000 --- a/.github/workflows/daily-smoke-tests-v4.yml +++ /dev/null @@ -1,29 +0,0 @@ -#TODO: remove v4 with April Release -name: daily-smoke-tests-v4 -on: - workflow_dispatch: # As per documentation, the colon is necessary even though no config is required. - 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 13:30 UTC every day". This time was chosen because it corresponds to - # 8:30AM CDT, meaning that any issues will be surfaced before the start of business. - - cron: "30 13 * * *" -jobs: - smoke-test: - uses: ./.github/workflows/run-tests.yml - with: - node-matrix: "[{version: 'lts/*', artifact: 'lts'}, {version: 'latest', artifact: 'latest'}]" - 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' - }); diff --git a/.github/workflows/production-heartbeat.yml b/.github/workflows/production-heartbeat.yml index 1cb5500be..47a52a523 100644 --- a/.github/workflows/production-heartbeat.yml +++ b/.github/workflows/production-heartbeat.yml @@ -9,17 +9,9 @@ on: # Days were chosen to run only from Monday through Friday. - cron: '45 13,17,21 * * 1,2,3,4,5' jobs: - production-heartbeat: - runs-on: macos-latest - steps: - - name: Invoke v4 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: 'production-heartbeat.yml', - ref: 'dev-4' - }); + smoke-test: + # We run the daily smoke tests against 'main' to validate that the code currently in production is valid + uses: ./.github/workflows/run-tests.yml + with: + node-matrix: "[{version: 'lts/*', artifact: 'lts'}, {version: 'latest', artifact: 'latest'}]" + target-branch: main \ No newline at end of file diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 6657b984a..1c1fa8873 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -4,16 +4,6 @@ on: types: [edited, opened, reopened, synchronize] jobs: - # We want to prevent cross-contamination between the 4.x and 5.x pipelines. So we should prevent PRs - # based on this flow to merge into `dev-4` or `main-4`. - # TODO: Remove this after the April release, since we won't care after that to maintain v4 - verify_target_branch: - runs-on: ubuntu-latest - steps: - - if: ${{ github.base_ref == 'dev-4' || github.base_ref == 'main-4' }} - run: | - echo "Forbidden to merge this branch into dev-4 or release-4" - exit 1 # We need to verify that the Pull Request's title matches the desired format. verify_pr_title: runs-on: ubuntu-latest diff --git a/github-actions/verify-pr-title/test/verifyMain2DevPrTitle.test.ts b/github-actions/verify-pr-title/test/verifyMain2DevPrTitle.test.ts index 4082d7b16..614629ff2 100644 --- a/github-actions/verify-pr-title/test/verifyMain2DevPrTitle.test.ts +++ b/github-actions/verify-pr-title/test/verifyMain2DevPrTitle.test.ts @@ -4,11 +4,11 @@ import {verifyMain2DevPrTitle} from "../src/verifyMain2DevPrTitle"; describe('#verifyMain2DevPrTitle', () => { /** * The Type portion is the first part of the title. - * E.g., in "Main2Dev @W-1234@ - v4.2.0", the Type portion is "Main2Dev". + * E.g., in "Main2Dev @W-1234@ - v5.2.0", the Type portion is "Main2Dev". * Only acceptable value is Main2Dev, with flexible casing. */ describe('Type portion', () => { - const restOfTitle = "@W-111111@ Merging after v4.2.0"; + const restOfTitle = "@W-111111@ Merging after v5.2.0"; describe('Valid types', () => { it('Uppercase: MAIN2DEV', () => { const title = `MAIN2DEV ${restOfTitle}` @@ -101,17 +101,17 @@ describe('#verifyMain2DevPrTitle', () => { * The Scope portion is not used for Release pull requests. */ it('Scope portion is rejected', () => { - const title = "Main2Dev (PMD) @W-1234@ Merging after v4.2.0"; + const title = "Main2Dev (PMD) @W-1234@ Merging after v5.2.0"; expect(verifyMain2DevPrTitle(title)).toEqual(false); }); /** * The Work Item portion is the third part of the title. - * E.g., in "Main2Dev @W-1234@ - Merging after v4.2.0", the Work Item portion is "@W-1234@". + * E.g., in "Main2Dev @W-1234@ - Merging after v5.2.0", the Work Item portion is "@W-1234@". */ describe('Work Item portion', () => { function createTitle(workItem: string): string { - return `Main2Dev ${workItem} Merging after v4.2.0`; + return `Main2Dev ${workItem} Merging after v5.2.0`; } it('Work Item cannot be absent', () => { @@ -157,7 +157,7 @@ describe('#verifyMain2DevPrTitle', () => { /** * The Description portion is the fourth (and last) part of the title. - * E.g., in "Main2Dev @W-1234@ - Merging after v4.2.0", the Description portion is "Merging after v4.2.0" + * E.g., in "Main2Dev @W-1234@ - Merging after v5.2.0", the Description portion is "Merging after v5.2.0" */ describe('Description portion', () => { const restOfTitle = "Main2Dev @W-123456@"; @@ -173,7 +173,7 @@ describe('#verifyMain2DevPrTitle', () => { }); it('Description must contain "merging"', () => { - const title = `${restOfTitle} after v4.2.0`; + const title = `${restOfTitle} after v5.2.0`; expect(verifyMain2DevPrTitle(title)).toEqual(false); }); @@ -183,7 +183,7 @@ describe('#verifyMain2DevPrTitle', () => { }) it('Description can contain any character classes', () => { - const title = `${restOfTitle} merging asdfasdf334 v4.2.0 @@$%#!{}`; + const title = `${restOfTitle} merging asdfasdf334 v5.2.0 @@$%#!{}`; expect(verifyMain2DevPrTitle(title)).toEqual(true); }); }); @@ -191,37 +191,37 @@ describe('#verifyMain2DevPrTitle', () => { /** * The portions should be separated from each other by either whitespace or a flexible group * of special characters. - * E.g., "Main2Dev ; @W-1234@ . Merging after v4.2.0". + * E.g., "Main2Dev ; @W-1234@ . Merging after v5.2.0". */ describe('Portion separation', () => { it('Space (" ") separation is allowed', () => { - const title = "Main2Dev @W-1234@ merging after v4.2.0"; + const title = "Main2Dev @W-1234@ merging after v5.2.0"; expect(verifyMain2DevPrTitle(title)).toEqual(true); }); describe('Separator characters are allowed', () => { it('n-dash (-)', () => { - const title = "Main2Dev - @W-1234@ - merging after v4.2.0"; + const title = "Main2Dev - @W-1234@ - merging after v5.2.0"; expect(verifyMain2DevPrTitle(title)).toEqual(true); }); it('period (.)', () => { - const title = "Main2Dev.@W-1234@.merging after v4.2.0"; + const title = "Main2Dev.@W-1234@.merging after v5.2.0"; expect(verifyMain2DevPrTitle(title)).toEqual(true); }); it('comma (,)', () => { - const title = "Main2Dev,@W-1234@,merging after v4.2.0"; + const title = "Main2Dev,@W-1234@,merging after v5.2.0"; expect(verifyMain2DevPrTitle(title)).toEqual(true); }); it('colon (:)', () => { - const title = "Main2Dev:@W-1234@:merging after v4.2.0"; + const title = "Main2Dev:@W-1234@:merging after v5.2.0"; expect(verifyMain2DevPrTitle(title)).toEqual(true); }); it('semi colon (;)', () => { - const title = "Main2Dev;@W-1234@;merging after v4.2.0"; + const title = "Main2Dev;@W-1234@;merging after v5.2.0"; expect(verifyMain2DevPrTitle(title)).toEqual(true); }); }); diff --git a/github-actions/verify-pr-title/test/verifyReleasePrTitle.test.ts b/github-actions/verify-pr-title/test/verifyReleasePrTitle.test.ts index 0cc801c2e..6bf282473 100644 --- a/github-actions/verify-pr-title/test/verifyReleasePrTitle.test.ts +++ b/github-actions/verify-pr-title/test/verifyReleasePrTitle.test.ts @@ -3,7 +3,7 @@ import {verifyReleasePrTitle} from "../src/verifyReleasePrTitle"; describe('#verifyReleasePrTitle', () => { /** * The Type portion is the first part of the title. - * E.g., in "RELEASE @W-1234@ - v4.2.0", the Type portion is "RELEASE". + * E.g., in "RELEASE @W-1234@ - v5.2.0", the Type portion is "RELEASE". * Only acceptable value is RELEASE, with flexible casing. */ describe('Type portion', () => { @@ -100,13 +100,13 @@ describe('#verifyReleasePrTitle', () => { * The Scope portion is not used for Release pull requests. */ it('Scope portion is rejected', () => { - const title = "RELEASE (PMD) @W-1234@ v4.2.0"; + const title = "RELEASE (PMD) @W-1234@ v5.2.0"; expect(verifyReleasePrTitle(title)).toEqual(false); }); /** * The Work Item portion is the third part of the title. - * E.g., in "RELEASE @W-1234@ - v4.2.0", the Work Item portion is "@W-1234@". + * E.g., in "RELEASE @W-1234@ - v5.2.0", the Work Item portion is "@W-1234@". */ describe('Work Item portion', () => { function createTitle(workItem: string): string { @@ -156,7 +156,7 @@ describe('#verifyReleasePrTitle', () => { /** * The Description portion is the fourth (and last) part of the title. - * E.g., in "RELEASE @W-1234@ - v4.2.0", the Description portion is "v4.2.0" + * E.g., in "RELEASE @W-1234@ - v5.2.0", the Description portion is "v5.2.0" */ describe('Description portion', () => { const restOfTitle = "RELEASE @W-123456@"; @@ -184,33 +184,33 @@ describe('#verifyReleasePrTitle', () => { */ describe('Portion separation', () => { it('Space (" ") separation is allowed', () => { - const title = "RELEASE @W-1234@ v4.2.0"; + const title = "RELEASE @W-1234@ v5.2.0"; expect(verifyReleasePrTitle(title)).toEqual(true); }); describe('Separator characters are allowed', () => { it('n-dash (-)', () => { - const title = "RELEASE - @W-1234@ - v4.2.0"; + const title = "RELEASE - @W-1234@ - v5.2.0"; expect(verifyReleasePrTitle(title)).toEqual(true); }); it('period (.)', () => { - const title = "RELEASE.@W-1234@.v4.2.0"; + const title = "RELEASE.@W-1234@.v5.2.0"; expect(verifyReleasePrTitle(title)).toEqual(true); }); it('comma (,)', () => { - const title = "RELEASE,@W-1234@,v4.2.0"; + const title = "RELEASE,@W-1234@,v5.2.0"; expect(verifyReleasePrTitle(title)).toEqual(true); }); it('colon (:)', () => { - const title = "RELEASE:@W-1234@:v4.2.0"; + const title = "RELEASE:@W-1234@:v5.2.0"; expect(verifyReleasePrTitle(title)).toEqual(true); }); it('semi colon (;)', () => { - const title = "RELEASE;@W-1234@;v4.2.0"; + const title = "RELEASE;@W-1234@;v5.2.0"; expect(verifyReleasePrTitle(title)).toEqual(true); }); }); From 170ffbf325e6ab75497dbbc6c876cd3494348c15 Mon Sep 17 00:00:00 2001 From: Randi Wilson Date: Thu, 1 May 2025 10:59:19 -0400 Subject: [PATCH 02/10] Rename issue templates --- .../{1-feature_request.yml => 5-feature_request.yml} | 0 .../{2-general_feedback.yml => 6-general_feedback.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATE/{1-feature_request.yml => 5-feature_request.yml} (100%) rename .github/ISSUE_TEMPLATE/{2-general_feedback.yml => 6-general_feedback.yml} (100%) diff --git a/.github/ISSUE_TEMPLATE/1-feature_request.yml b/.github/ISSUE_TEMPLATE/5-feature_request.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/1-feature_request.yml rename to .github/ISSUE_TEMPLATE/5-feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/2-general_feedback.yml b/.github/ISSUE_TEMPLATE/6-general_feedback.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/2-general_feedback.yml rename to .github/ISSUE_TEMPLATE/6-general_feedback.yml From 7da703f4aadcb1cdc855b01e1181d52c57a34dca Mon Sep 17 00:00:00 2001 From: Randi Wilson Date: Fri, 2 May 2025 14:24:13 -0400 Subject: [PATCH 03/10] Update release branch actions --- .github/workflows/automated-release-tasks.yml | 14 +++++--------- .github/workflows/create-release-branch.yml | 5 +++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/automated-release-tasks.yml b/.github/workflows/automated-release-tasks.yml index 5e089734e..2e4d5b849 100644 --- a/.github/workflows/automated-release-tasks.yml +++ b/.github/workflows/automated-release-tasks.yml @@ -6,7 +6,6 @@ on: # 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: @@ -26,13 +25,10 @@ jobs: 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 + create-release-branch: needs: verify-should-run if: ${{ needs.verify-should-run.outputs.should-run == 'true' }} - steps: - - name: Create release branch - uses: ./.github/workflows/create-release-branch.yml - secrets: inherit - with: - release-type: minor + uses: ./.github/workflows/create-release-branch.yml + secrets: inherit + with: + release-type: minor diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index 1c6692633..e09538a7c 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -12,6 +12,11 @@ on: - minor - patch required: true + workflow_call: + inputs: + release-type: + type: string + required: true jobs: create-release-branch: From 722b6a9e4005d11059f2c4f31efc6d1286b72a74 Mon Sep 17 00:00:00 2001 From: Randi Wilson Date: Fri, 2 May 2025 14:26:58 -0400 Subject: [PATCH 04/10] Put back validate pr step --- .github/workflows/validate-pr.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 1c1fa8873..7dc88aae6 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -4,6 +4,14 @@ on: types: [edited, opened, reopened, synchronize] jobs: + # Prevent merging to dev-4 or main-4 to preserve until we're ready to delete + verify_target_branch: + runs-on: ubuntu-latest + steps: + - if: ${{ github.base_ref == 'dev-4' || github.base_ref == 'main-4' }} + run: | + echo "Forbidden to merge this branch into dev-4 or main-4" + exit 1 # We need to verify that the Pull Request's title matches the desired format. verify_pr_title: runs-on: ubuntu-latest From 28992591e4e52e2dac96571e8b4711b95d4756aa Mon Sep 17 00:00:00 2001 From: Randi Wilson Date: Fri, 2 May 2025 15:10:04 -0400 Subject: [PATCH 05/10] Add heartbeat --- .github/workflows/heartbeat-tests.yml | 138 +++++++++++++++++++++ .github/workflows/production-heartbeat.yml | 11 +- 2 files changed, 142 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/heartbeat-tests.yml diff --git a/.github/workflows/heartbeat-tests.yml b/.github/workflows/heartbeat-tests.yml new file mode 100644 index 000000000..c60efac02 --- /dev/null +++ b/.github/workflows/heartbeat-tests.yml @@ -0,0 +1,138 @@ +name: heartbeat-tests +on: + workflow_call: # As per documentation, the colon is necessary even though no config is required. + workflow_dispatch: # As per documentation, the colon is necessary even though no config is required. + +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 + steps: + # === Setup. We need to get the code, set up nodejs, and create the results directory. === + - uses: actions/checkout@v4 + with: + ref: 'dev' + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '11' + - 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 of sf-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 CODE_ANALYZER_VERSION repo secret is set, we want to install that version of code-analyzer, 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.CODE_ANALYZER_VERSION }}" ]]; then + echo "CODE_ANALYZER_VERSION=@${{ secrets.CODE_ANALYZER_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 any command 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 code analyzer plugin through sf === + - name: Install Code Analyzer Plugin + id: code_analyzer_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 code-analyzer${{ env.CODE_ANALYZER_VERSION }}) || + (echo "::set-output name=retry_count::1" && sleep 60 && sf plugins install code-analyzer${{ env.CODE_ANALYZER_VERSION }}) || + (echo "::set-output name=retry_count::2" && sleep 300 && sf plugins install code-analyzer${{ env.CODE_ANALYZER_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: + # 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 + CODE_ANALYZER_INSTALL_STATUS: ${{ steps.code_analyzer_install.outcome }} after ${{ steps.code_analyzer_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. + ALERT_SEV="critical" + ALERT_SUMMARY="Production heartbeat script failed on ${{ runner.os }}" + # 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 < Date: Mon, 19 May 2025 10:51:22 -0400 Subject: [PATCH 06/10] Update .github/workflows/heartbeat-tests.yml Should not use critical severity --- .github/workflows/heartbeat-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/heartbeat-tests.yml b/.github/workflows/heartbeat-tests.yml index c60efac02..8656896e0 100644 --- a/.github/workflows/heartbeat-tests.yml +++ b/.github/workflows/heartbeat-tests.yml @@ -111,7 +111,7 @@ jobs: 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. - ALERT_SEV="critical" + ALERT_SEV="info" ALERT_SUMMARY="Production heartbeat script failed on ${{ runner.os }}" # Define a helper function to create our POST request's data, to sidestep issues with nested quotations. generate_post_data() { From 7e75a56c2d9925e62774198bdaf7198dac704016 Mon Sep 17 00:00:00 2001 From: Randi Wilson Date: Mon, 19 May 2025 13:51:32 -0400 Subject: [PATCH 07/10] Requirements feedback --- .../ISSUE_TEMPLATE/0-code_analyzer_bug.yml | 5 +- .github/ISSUE_TEMPLATE/1-scanner_bug.yml | 127 ++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/workflows/create-release-branch.yml | 2 +- .github/workflows/heartbeat-tests.yml | 13 +- .github/workflows/production-heartbeat.yml | 14 -- package.json | 2 +- 7 files changed, 143 insertions(+), 21 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/1-scanner_bug.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/workflows/production-heartbeat.yml diff --git a/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml b/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml index 22edf105f..4433c3d7b 100644 --- a/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml +++ b/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml @@ -1,4 +1,4 @@ -name: Report a Bug with a code-analyzer command +name: Report a Bug with a code-analyzer command (v5) description: Report an issue with a code-analyzer command. title: "[BUG][code-analyzer] " labels: [] @@ -13,12 +13,11 @@ body: 3. Double-check the command that you ran. Ensure that items like file names, method names, and category names are correctly spelled and cased. 4. Verify that your code is syntactically valid. 5. Verify that the error is reproducible on another machine. - 6. Check open and closed [issues](https://github.com/forcedotcom/sfdx-scanner/issues) to see if your issue is already logged. + 6. Check open and closed [issues](https://github.com/forcedotcom/code-analyzer/issues) to see if your issue is already logged. **I confirm that I have gone through these steps and still have an issue to report.** (You must select "Yes" to create an issue.) options: - - '' - "Yes" validations: required: true diff --git a/.github/ISSUE_TEMPLATE/1-scanner_bug.yml b/.github/ISSUE_TEMPLATE/1-scanner_bug.yml new file mode 100644 index 000000000..54f16a1ed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-scanner_bug.yml @@ -0,0 +1,127 @@ +name: Report a Bug with a scanner command (v4) +description: Report an issue with a scanner command. +title: "[BUG][scanner] " +labels: [] +body: + - type: dropdown + attributes: + label: Have you tried to resolve this issue yourself first? + description: | + Oftentimes, you can resolve `scanner` issues on your own. Follow these steps: + 1. Read the error message. + 2. Read [Salesforce Code Analyzer](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview) documentation. + 3. Double-check the command that you ran. Ensure that items like file names, method names, and category names are correctly spelled and cased. + 4. Verify that your code is syntactically valid. + 5. Verify that the error is reproducible on another machine. + 6. Check open and closed [issues](https://github.com/forcedotcom/code-analyzer/issues) to see if your issue is already logged. + + **I confirm that I have gone through these steps and still have an issue to report.** + (You must select "Yes" to create an issue.) + options: + - "Yes" + validations: + required: true + - type: textarea + attributes: + label: Bug Description + description: Provide a clear and concise description of what the bug is and include the exact command that you ran. + validations: + required: true + - type: textarea + attributes: + label: Output / Logs + description: Attach any output or logs here + placeholder: | + Add log output here or drag files here. + - type: textarea + attributes: + label: Steps To Reproduce + description: List out the steps that you used to reproduce the bug behavior. Be as specific and clear as possible. + placeholder: | + 1. I first do ... + 2. Then I do ... + 3. Lastly, I do ... + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: Provide a clear and concise description of what you expected to happen. + validations: + required: true + - type: input + attributes: + label: Operating System + description: | + What is your machine's operating system? + placeholder: | + Example: MacOS Sonoma 14.4.1 + validations: + required: true + - type: input + attributes: + label: Salesforce CLI Version + description: | + What do you get from the command "sf --version"? + placeholder: | + Example: @salesforce/cli/2.40.7 darwin-arm64 node-v20.12.2 + validations: + required: true + - type: input + attributes: + label: Scanner Plugin Version + description: | + What do you get from the command "sf plugins"? + placeholder: | + Example: @salesforce/sfdx-scanner/4.10.0 + validations: + required: true + - type: input + attributes: + label: Node Version + description: | + What do you get from the command "node --version"? + placeholder: | + Example: v23.4.0 + validations: + required: false + - type: input + attributes: + label: Java Version + description: | + What do you get from the command "java -version"? + placeholder: | + Example: openjdk version "11.0.17.0.1" 2022-10-18 LTS + validations: + required: false + - type: input + attributes: + label: Python Version + description: | + What do you get from the command "python --version"? + placeholder: | + Example: Python 3.11.8 + validations: + required: false + - type: textarea + attributes: + label: Additional Context (Screenshots, Files, etc) + description: Add any other context about the problem. + placeholder: | + Drag any files or screenshots you have here. + - type: textarea + attributes: + label: Workaround + description: What ways have you found to sidestep the problem? If you haven't found a workaround, what have you tried so far? + - type: dropdown + attributes: + label: Urgency + description: What is the severity of the problem? + options: + - Low + - Moderate + - High + - Critical + default: 0 + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..ec4bb386b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index e09538a7c..f069e84cb 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -77,7 +77,7 @@ jobs: mutation ($message: String!, $oldOid: GitObjectID!, $branch: String!, $newPackage: Base64String!) { createCommitOnBranch(input: { branch: { - repositoryNameWithOwner: "forcedotcom/sfdx-scanner", + repositoryNameWithOwner: "forcedotcom/code-analyzer", branchName: $branch }, message: { diff --git a/.github/workflows/heartbeat-tests.yml b/.github/workflows/heartbeat-tests.yml index 8656896e0..13b38f865 100644 --- a/.github/workflows/heartbeat-tests.yml +++ b/.github/workflows/heartbeat-tests.yml @@ -1,7 +1,13 @@ name: heartbeat-tests on: - workflow_call: # As per documentation, the colon is necessary even though no config is required. workflow_dispatch: # As per documentation, the colon is necessary even though no config is required. + 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 45 minutes past 1, 5, and 9 AM/PM UTC". The hours were chosen so that + # the jobs run only close to business hours of Central Time. + # Days were chosen to run only from Monday through Friday. + - cron: "45 13,17,21 * * 1,2,3,4,5" jobs: production-heartbeat: @@ -14,7 +20,7 @@ jobs: runs-on: ${{ matrix.os.vm }} timeout-minutes: 60 steps: - # === Setup. We need to get the code, set up nodejs, and create the results directory. === + # === Setup. We need to get the code, set up nodejs, java, and python, and create the results directory. === - uses: actions/checkout@v4 with: ref: 'dev' @@ -25,6 +31,9 @@ jobs: with: distribution: 'temurin' java-version: '11' + - uses: actions/setup-python@v5 + with: + python-version: '3.10' - run: mkdir smoke-test-results # === Set our environment variables, either using default values or the repo's secrets === diff --git a/.github/workflows/production-heartbeat.yml b/.github/workflows/production-heartbeat.yml deleted file mode 100644 index 135ef235f..000000000 --- a/.github/workflows/production-heartbeat.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: production-heartbeat -on: - workflow_dispatch: # As per documentation, the colon is necessary even though no config is required. - 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 45 minutes past 1, 5, and 9 AM/PM UTC". The hours were chosen so that - # the jobs run only close to business hours of Central Time. - # Days were chosen to run only from Monday through Friday. - - cron: "45 13,17,21 * * 1,2,3,4,5" -jobs: - invoke-heartbeat: - secrets: inherit - uses: ./.github/workflows/heartbeat-tests.yml diff --git a/package.json b/package.json index 22e2da5ff..95731d835 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Static code scanner that applies quality and security rules to Apex code, and provides feedback.", "version": "5.0.0", "author": "Salesforce Code Analyzer Team", - "bugs": "https://github.com/forcedotcom/sfdx-scanner/issues", + "bugs": "https://github.com/forcedotcom/code-analyzer/issues", "dependencies": { "@oclif/core": "3.27.0", "@salesforce/code-analyzer-core": "0.29.0", From f6a7f2b7e5deba43418483ff5ee0a82febe9024f Mon Sep 17 00:00:00 2001 From: Randi Wilson Date: Mon, 19 May 2025 14:07:13 -0400 Subject: [PATCH 08/10] Update to checkboxes --- .github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml | 12 ++++-------- .github/ISSUE_TEMPLATE/1-scanner_bug.yml | 8 +++----- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml b/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml index 4433c3d7b..b464b6ef9 100644 --- a/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml +++ b/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml @@ -1,9 +1,9 @@ -name: Report a Bug with a code-analyzer command (v5) +name: Report a Bug with a code-analyzer command description: Report an issue with a code-analyzer command. title: "[BUG][code-analyzer] " labels: [] body: - - type: dropdown + - type: checkboxes attributes: label: Have you tried to resolve this issue yourself first? description: | @@ -14,13 +14,9 @@ body: 4. Verify that your code is syntactically valid. 5. Verify that the error is reproducible on another machine. 6. Check open and closed [issues](https://github.com/forcedotcom/code-analyzer/issues) to see if your issue is already logged. - - **I confirm that I have gone through these steps and still have an issue to report.** - (You must select "Yes" to create an issue.) options: - - "Yes" - validations: - required: true + - label: I confirm I have gone through the above steps and still have an issue to report + required: true - type: textarea attributes: label: Bug Description diff --git a/.github/ISSUE_TEMPLATE/1-scanner_bug.yml b/.github/ISSUE_TEMPLATE/1-scanner_bug.yml index 54f16a1ed..ca8a73b90 100644 --- a/.github/ISSUE_TEMPLATE/1-scanner_bug.yml +++ b/.github/ISSUE_TEMPLATE/1-scanner_bug.yml @@ -3,7 +3,7 @@ description: Report an issue with a scanner command. title: "[BUG][scanner] " labels: [] body: - - type: dropdown + - type: checkboxes attributes: label: Have you tried to resolve this issue yourself first? description: | @@ -14,11 +14,9 @@ body: 4. Verify that your code is syntactically valid. 5. Verify that the error is reproducible on another machine. 6. Check open and closed [issues](https://github.com/forcedotcom/code-analyzer/issues) to see if your issue is already logged. - - **I confirm that I have gone through these steps and still have an issue to report.** - (You must select "Yes" to create an issue.) options: - - "Yes" + - label: I confirm I have gone through the above steps and still have an issue to report + required: true validations: required: true - type: textarea From d50a8a42b5499d409533a60186d5a6ff4b1d6bd5 Mon Sep 17 00:00:00 2001 From: Randi Wilson Date: Mon, 19 May 2025 14:11:53 -0400 Subject: [PATCH 09/10] Validations cleanup --- .github/ISSUE_TEMPLATE/1-scanner_bug.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/1-scanner_bug.yml b/.github/ISSUE_TEMPLATE/1-scanner_bug.yml index ca8a73b90..c3b45ff4c 100644 --- a/.github/ISSUE_TEMPLATE/1-scanner_bug.yml +++ b/.github/ISSUE_TEMPLATE/1-scanner_bug.yml @@ -17,8 +17,6 @@ body: options: - label: I confirm I have gone through the above steps and still have an issue to report required: true - validations: - required: true - type: textarea attributes: label: Bug Description From a3fd3d4f2cc560ace54e21f947435b9776fa751e Mon Sep 17 00:00:00 2001 From: Randi Wilson Date: Mon, 19 May 2025 14:42:53 -0400 Subject: [PATCH 10/10] Remove python from scanner issue --- .github/ISSUE_TEMPLATE/1-scanner_bug.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/1-scanner_bug.yml b/.github/ISSUE_TEMPLATE/1-scanner_bug.yml index c3b45ff4c..6113ab0f3 100644 --- a/.github/ISSUE_TEMPLATE/1-scanner_bug.yml +++ b/.github/ISSUE_TEMPLATE/1-scanner_bug.yml @@ -90,15 +90,6 @@ body: Example: openjdk version "11.0.17.0.1" 2022-10-18 LTS validations: required: false - - type: input - attributes: - label: Python Version - description: | - What do you get from the command "python --version"? - placeholder: | - Example: Python 3.11.8 - validations: - required: false - type: textarea attributes: label: Additional Context (Screenshots, Files, etc)