GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ci(code-analyzer): report Code Analyzer results from JSON by dschach · Pull Request #352 · dschach/salesforce-trigger-framework

Conversation

@dschach

@dschach dschach commented Oct 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Owner

This PR moves the sfca-analysis job from the SFCA action to the Salesforce Code Analyzer CLI, and the job now reads the Code Analyzer's JSON report instead of SARIF. A new composite action, sf-code-analyzer-report, writes the violation counts and Markdown tables to the job summary, and the job fails when a priority 1 or 2 violation is found.

Changes

BEGIN_NESTED_COMMIT
ci(workflows): run the Code Analyzer CLI and write results to sfca

The sfca-analysis job runs sf code-analyzer run with the Recommended and Custom rules and writes its reports to sfca/. The report step reads sfca/sfca_results.json, and it runs even when the scan fails. The upload step uploads the sfca folder under the artifact name sfca-report, and it also runs even when the scan fails. The job drops the Python setup and the pull-requests permission, which the old SFCA action needed.

END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
feat(ci): add a job summary report for Code Analyzer results

The new sf-code-analyzer-report composite action reads sfca_results.json, writes the violation counts and Markdown tables to the job summary, and exposes the counts and tables as outputs. Each violation links to its line at the commit that ran. An empty severity-cutoff puts every violation in one table.

END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
refactor(ci): read Code Analyzer results from JSON, not SARIF

The new parse-sfca-results composite action counts the JSON report by severity and writes a Markdown table sorted by file and then by line. It replaces pmd-sarif-priorities, which read PMD's SARIF output and is removed. CI does not call parse-sfca-results in this PR.

END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
chore(code-analyzer): remove machine paths from the config on commit

The pre-commit hook deletes the # Last calculated by the config command as: comments from code-analyzer.yml, which record paths from one author's machine. The hook uses perl, which runs on Linux as well as macOS. The ignores list skips docs/, doc-assets/, and sfca* files, and package.json gains a codeanalyzer:run script.

END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
chore(git): ignore the Code Analyzer report folder

Git and Prettier ignore sfca/, so the generated reports stay out of commits and out of the format check.

END_NESTED_COMMIT

Behavior notes

The Code Analyzer scans the whole workspace on every pull request. The SFCA action scanned only the changed files, so runs take longer, and the report includes violations that this PR did not add.

The report step sets severity-cutoff to 2, so priority 1 and 2 violations appear in the first table and fail the job. The run also writes sfca/sfca-report.sarif, which nothing reads. The Code Analyzer's exit status when it finds violations is not yet confirmed, so the first run will show whether the scan step fails before the gate runs.

Test plan

Locally, the shell steps of sf-code-analyzer-report were run against a saved sfca_results.json. They gave 24 violations, the expected tables, and the same counts as the report, with an empty cutoff and with a cutoff of 2. The workflow itself has not run on GitHub yet. Open the pull request and confirm that the sfca-analysis job runs the Code Analyzer, writes both tables to the job summary, and fails only when a priority 1 or 2 violation is present. Confirm that the sfca-report artifact contains the sfca folder with the JSON and HTML reports. The actions/upload-artifact@v7 and actions/setup-java@v5 tags have not been checked against a run.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dschach added 3 commits October 29, 2026 20:38
@dschach
ci(code analyzer): update action to use json output
0b46f28
@dschach
chore(code-analyzer): continue config and sanitize config file on commit
dd18b2f
@dschach
fix: tweak the workflow file
9cd9d75
@dschach dschach self-assigned this Oct 29, 2026
Claude AI @claude
ci(workflows): write Code Analyzer results to sfca
560351c
The job runs sf code-analyzer run directly and writes its reports to sfca/, and the report step reads sfca/sfca_results.json. The upload step now uploads the sfca folder and runs even when the scan fails. Git and Prettier ignore sfca/, and the pre-commit hook uses perl, which runs on Linux as well as macOS.

Co-Authored-By: Claude <[email protected]>
@dschach
dschach merged commit 437f453 into main Oct 29, 2026
6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dschach
dschach deleted the chore/use-code-analyzer branch October 29, 2026 10:54
@github-actions github-actions Bot mentioned this pull request Oct 29, 2026
chore(main): release 1.4.0 #348
Merged
dschach pushed a commit that referenced this pull request Oct 29, 2026
@github-actions
chore(main): release 1.4.0 (#348)
0adece6
🤖 I have created a release *beep* *boop*
---


##
[1.4.0](v1.3.0...v1.4.0)
(2026-10-29)


### Features

* **ci:** Add a job summary report for Code Analyzer results
([437f453](437f453))
* **handler:** Add protected accessors and correct the ApexDoc
([#349](#349))
([d3c42d2](d3c42d2))
* **handler:** Add protected getTriggerEvent and getHandlerName
([d3c42d2](d3c42d2))


### Bug Fixes

* **handler:** Log a warning when the loop limit is exceeded
([d3c42d2](d3c42d2))
* **scripts:** Write highlight.js to doc-assets with portable sed
([032a7b9](032a7b9))


### Miscellaneous Chores

* **apexdox:** Correct 2 stale comments in the ApexDox config
([a15667e](a15667e))
* **code-analyzer:** Install Salesforce Code Analyzer config
([01b0bae](01b0bae))
* **code-analyzer:** Remove machine paths from the config on commit
([437f453](437f453))
* **codecov:** Drop the LWC flag that nothing uploads
([6bd4946](6bd4946))
* **git:** Ignore the Code Analyzer report folder
([437f453](437f453))
* **ignore:** Skip the husky hooks and the LWC config files
([7ec40cd](7ec40cd))
* **pmd:** Move the PMD rulesets to config and add Code Analyzer
([#351](#351))
([01b0bae](01b0bae))
* **pmd:** Move the PMD rulesets under config/pmd
([01b0bae](01b0bae))
* **prettier:** Adopt the shared x2od prettier config
([#359](#359))
([7ec40cd](7ec40cd))
* **prettier:** Correct the comment on the XML print width override
([7ec40cd](7ec40cd))
* **prettier:** Extend the shared x2od Prettier configuration
([7ec40cd](7ec40cd))
* **prettier:** Ignore only what Prettier should skip
([032a7b9](032a7b9))
* **project:** Clean up the tooling scripts, ignore files, and READMEs
([#353](#353))
([032a7b9](032a7b9))
* **project:** Remove template leftovers from the ignore files
([032a7b9](032a7b9))
* **release:** Drop the 2 pre-major release-please flags
([6bd4946](6bd4946))
* **vscode:** Recommend better-comments-next instead of better-comments
([d3c42d2](d3c42d2))


### Code Refactoring

* **ci:** Read Code Analyzer results from JSON, not SARIF
([437f453](437f453))
* **handler:** Simplify setBypass to 4 statements
([d3c42d2](d3c42d2))


### Styles

* **docs:** Reformat the documentation assets to the shared style
([7ec40cd](7ec40cd))
* **pmd:** Rewrap the PMD rulesets at 80 characters
([7ec40cd](7ec40cd))
* **prettier:** Reformat the config and scripts to the shared style
([7ec40cd](7ec40cd))


### Documentation

* **actions:** Show the Code Analyzer CLI in the action examples
([032a7b9](032a7b9))
* **ApexDoc:** Add throws tags to TriggerHandler headers
([01b0bae](01b0bae))
* **changelog:** Link the first release to its release page
([a15667e](a15667e))
* **contributing:** Add a contributing guide for this repository
([a15667e](a15667e))
* **deploy:** Correct the scratch org instructions
([a15667e](a15667e))
* **github:** Add a pull request template
([a15667e](a15667e))
* **github:** Add the code of conduct to this repository
([f1ff40b](f1ff40b))
* **github:** Replace the issue templates with framework issue forms
([a15667e](a15667e))
* **handler:** Correct the ApexDoc statements and examples
([d3c42d2](d3c42d2))
* **handler:** Say when andFinally does not run
([d3c42d2](d3c42d2))
* **license:** Keep the BSD text alone and credit the original in NOTICE
([a15667e](a15667e))
* **project:** Add community files and fix the license and deploy docs
([#355](#355))
([a15667e](a15667e))
* **readme:** Add an API reference and fix the documentation links
([032a7b9](032a7b9))
* **readme:** Correct the bypass, loop count, and handler examples
([032a7b9](032a7b9))
* **sample:** Move the sample README and describe the sample
([032a7b9](032a7b9))


### Build System

* **@x2od/prettier-config:** Update devDependency @x2od/prettier-config
from 0.6.1 to 0.7.0
([#360](#360))
([a4585f7](a4585f7))
* **node:** Update Node.js from v22.22.1 to v24.22.2
([#356](#356))
([f522648](f522648))
* **npm:** Call lint-staged from the hook and prune gone branches
([032a7b9](032a7b9))
* **npm:** Get the Prettier plugins through the shared x2od config
([7ec40cd](7ec40cd))
* **npm:** Remove the local Apex Prettier server scripts
([7ec40cd](7ec40cd))
* **npm:** Run the Prettier scripts on the whole tree
([032a7b9](032a7b9))


### Continuous Integration

* **actions/setup-java:** Update actions/setup-java action from v5 to v6
([#357](#357))
([34c1596](34c1596))
* **apex-tests:** Fetch 2 commits and give Codecov the pull request base
([d3c42d2](d3c42d2))
* **apex-tests:** Pass the Dev Hub secret through stdin
([6bd4946](6bd4946))
* **apex-tests:** Put the stdin flag last so the alias is kept
([6bd4946](6bd4946))
* **code-analyzer:** Report Code Analyzer results from JSON
([#352](#352))
([437f453](437f453))
* **codecov:** Troubleshoot Codecov base commit error
([#350](#350))
([d0f4621](d0f4621))
* **java-jdk:** Update dependency java-jdk from v21 to v25
([#358](#358))
([83abc66](83abc66))
* **workflows:** Give the workflow tokens read-only permissions
([6bd4946](6bd4946))
* **workflows:** Harden the CI workflows and run the checks for every
author
([#347](#347))
([6bd4946](6bd4946))
* **workflows:** Run the Code Analyzer CLI and write results to sfca
([437f453](437f453))
* **workflows:** Run the formatting and PMD checks for every author
([6bd4946](6bd4946))
* **workflows:** Split the Apex tests from CI and drop the residue
([6bd4946](6bd4946))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dschach dschach

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dschach
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.