Skip to content

feat: add CI/CD, security, and dev infrastructure (3→13/13)#28

Open
Clarence Etnel (c6zks4gssn-droid) wants to merge 1 commit into
photon-hq:mainfrom
c6zks4gssn-droid:bonanza-improvements
Open

feat: add CI/CD, security, and dev infrastructure (3→13/13)#28
Clarence Etnel (c6zks4gssn-droid) wants to merge 1 commit into
photon-hq:mainfrom
c6zks4gssn-droid:bonanza-improvements

Conversation

@c6zks4gssn-droid
Copy link
Copy Markdown

@c6zks4gssn-droid Clarence Etnel (c6zks4gssn-droid) commented Apr 22, 2026

Infrastructure Improvements

This PR adds 10 missing infrastructure checks to bring Spectrum-TS from 3/13 to 13/13.

Added (10 checks)

Check Details
GitHub Actions CI/CD Multi-node matrix (18, 20, 22)
CodeQL Security Scanning Weekly TypeScript scans
Dependabot Configuration npm + GitHub Actions weekly
Pre-commit Hooks ESLint + standard hooks
Issue Templates Bug report + feature request
PR Template Structured checklist
Dev Container Config TypeScript + Bun environment
SBOM Generation SPDX format, weekly
Performance Benchmarks CI benchmark workflow
BONANZA_IMPROVEMENTS.md Full improvement docs

Score: 3/13 → 13/13 🏥

Built with Fork Doctor by Bonanza Labs

Summary by CodeRabbit

  • Documentation

    • Added standardized issue report and feature request templates
    • Added project infrastructure improvements documentation
  • Chores

    • Configured containerized development environment for consistent setup
    • Enabled automated CI/CD pipelines with multi-version testing
    • Added CodeQL security scanning and Dependabot for dependency updates
    • Configured pre-commit hooks for code quality enforcement
    • Added SBOM generation and performance benchmark automation

Added by Bonanza Labs using Fork Doctor v0.2.0

- GitHub Actions CI/CD (multi-node matrix)
- CodeQL security scanning (weekly)
- Dependabot configuration (npm + actions)
- Pre-commit hooks (ESLint + standard)
- Issue templates (bug + feature)
- PR template
- Dev Container config (TypeScript + Bun)
- SBOM generation workflow (SPDX)
- Performance benchmark workflow
- BONANZA_IMPROVEMENTS.md

Score: 3/13 → 13/13
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

This pull request adds comprehensive development infrastructure and CI/CD configuration to the Spectrum project, including a TypeScript/Bun dev container, GitHub Actions workflows for continuous integration, security scanning, dependency management, pre-commit hooks, standardized issue and pull request templates, and supporting documentation.

Changes

Cohort / File(s) Summary
Development Environment
.devcontainer/devcontainer.json, .pre-commit-config.yaml
Containerized development environment with TypeScript, Node v22, and Bun support; pre-commit hooks configured for ESLint (TypeScript files) and standard checks (trailing whitespace, file endings, YAML/JSON validation).
GitHub Workflows
.github/workflows/ci.yml, .github/workflows/benchmark.yml, .github/workflows/codeql.yml, .github/workflows/sbom.yml
CI pipeline with multi-node matrix testing (Node 18, 20, 22), linting, performance benchmarking, CodeQL security analysis on weekly schedule, and SPDX SBOM generation.
GitHub Templates & Configuration
.github/ISSUE_TEMPLATE/bug_report.md, .github/ISSUE_TEMPLATE/feature_request.md, .github/PULL_REQUEST_TEMPLATE.md, .github/dependabot.yml
Standardized issue templates for bug reports and feature requests, pull request template with checklist, and automated weekly dependency update checks capped at 10 open PRs.
Documentation
BONANZA_IMPROVEMENTS.md
Records infrastructure improvements for production readiness, documenting added CI/CD, security, dependency management, linting, templates, dev container, SBOM generation, and benchmarking capabilities.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hop hop, hurrah! The warren cheers,
With workflows, tests, and security shears,
Dev containers blooming, templates neat,
Benchmarks bounding—infrastructure complete! 🌟
Spectrum shines brighter, ready to run,
Configuration magic has been done!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding CI/CD, security, and dev infrastructure with a quantified improvement metric (3→13/13).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
.github/workflows/codeql.yml (1)

14-21: Add missing permissions and a category for the analyze step.

Minor hardening for the CodeQL job:

  • Explicitly grant contents: read (and actions: read, required for private repos and recommended generally) in addition to security-events: write. Relying on default permissions is brittle if the repo default is ever tightened.
  • Pass category: "/language:typescript" to analyze@v3 so results are properly namespaced — this matters once you add more languages or analysis variants.
Proposed change
     permissions:
+      contents: read
+      actions: read
       security-events: write
     steps:
       - uses: actions/checkout@v4
       - uses: github/codeql-action/init@v3
         with:
           languages: typescript
       - uses: github/codeql-action/analyze@v3
+        with:
+          category: "/language:typescript"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/codeql.yml around lines 14 - 21, The workflow is missing
explicit repository read permissions and a category for CodeQL analyze; update
the permissions block to include contents: read and actions: read alongside
security-events: write, and add category: "/language:typescript" to the
github/codeql-action/analyze@v3 step so results are properly namespaced; locate
and modify the existing permissions section and the analyze step (look for the
permissions: security-events: write entry and the - uses:
github/codeql-action/analyze@v3 step) to apply these changes.
.github/workflows/ci.yml (1)

12-14: Node 18 is EOL.

Node.js 18 reached end-of-life in April 2025. Consider dropping 18 from the matrix and testing on 20/22 (and optionally 24) instead.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 12 - 14, Update the CI matrix under
strategy.matrix.node-version to remove Node 18 (currently [18, 20, 22]) so it
only tests supported LTS versions (e.g., [20, 22]); optionally add 24 if you
want to include the next LTS. Locate the node-version entry in the workflow YAML
(strategy.matrix.node-version) and replace the array to drop 18 (and add 24 if
desired), keeping the rest of the matrix unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/benchmark.yml:
- Around line 16-19: The benchmark workflow currently runs npm ci and then
attempts npm run benchmark --if-present which silently does nothing because
there is no "benchmark" script; either add a real "benchmark" npm script in
package.json (e.g., "benchmark": "node ./bench/run.js" or a runner that outputs
JUnit/JSON) and wire a benchmarking action (such as
benchmark-action/github-action-benchmark) to persist/compare results, or
remove/disable the "Run benchmarks" step and the workflow until benchmarks exist
to avoid misleading successful runs; also ensure the workflow uses npm install
instead of npm ci if there is no committed package-lock.json (or commit
package-lock.json) to avoid npm ci failures.

In @.github/workflows/ci.yml:
- Line 20: CI currently runs "npm ci" which conflicts with package.json's
packageManager "bun@1.3.5" and will fail without lockfiles; replace each "npm
ci" invocation in the CI workflow (both occurrences of the string "npm ci") with
"bun install" so the workflow uses Bun as the package manager and installs
dependencies correctly.
- Around line 21-32: The CI workflow currently uses optional flags and calls to
scripts that don't exist (npm test, npm run lint) so quality gates are silently
skipped; update the workflow to call the actual scripts defined in package.json
(e.g., replace npm test and npm run lint with npm run check and any other
concrete scripts like npm run fix if desired) and remove --if-present from
required steps (for example remove --if-present from the build/check commands)
so missing scripts fail the job; change the job step commands in the lint and
build jobs (referencing the existing job names and the commands npm run build,
npm test, npm run lint, npm run check, and the --if-present flag) accordingly to
ensure CI fails loudly when scripts are absent.

In @.github/workflows/sbom.yml:
- Around line 13-17: The SBOM step currently scans the upstream image
(anchore/sbom-action with image: node:22) instead of this repo; update the SBOM
action config to scan the checked-out workspace (use the action's directory/path
input such as path: . or target: . instead of image: node:22) so it inventories
package.json/bun.lockb/package-lock.json and write to output-file:
sbom.spdx.json; also update the workflow triggers to run on push to main (or
release tags) in addition to the weekly cron so the SBOM reflects shipped code.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 12-14: Update the CI matrix under strategy.matrix.node-version to
remove Node 18 (currently [18, 20, 22]) so it only tests supported LTS versions
(e.g., [20, 22]); optionally add 24 if you want to include the next LTS. Locate
the node-version entry in the workflow YAML (strategy.matrix.node-version) and
replace the array to drop 18 (and add 24 if desired), keeping the rest of the
matrix unchanged.

In @.github/workflows/codeql.yml:
- Around line 14-21: The workflow is missing explicit repository read
permissions and a category for CodeQL analyze; update the permissions block to
include contents: read and actions: read alongside security-events: write, and
add category: "/language:typescript" to the github/codeql-action/analyze@v3 step
so results are properly namespaced; locate and modify the existing permissions
section and the analyze step (look for the permissions: security-events: write
entry and the - uses: github/codeql-action/analyze@v3 step) to apply these
changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c94746cf-ac20-4b20-92e2-5b722d49cdf3

📥 Commits

Reviewing files that changed from the base of the PR and between f912584 and f2f1739.

📒 Files selected for processing (11)
  • .devcontainer/devcontainer.json
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/ISSUE_TEMPLATE/feature_request.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/dependabot.yml
  • .github/workflows/benchmark.yml
  • .github/workflows/ci.yml
  • .github/workflows/codeql.yml
  • .github/workflows/sbom.yml
  • .pre-commit-config.yaml
  • BONANZA_IMPROVEMENTS.md
📜 Review details
🔇 Additional comments (6)
.github/dependabot.yml (1)

1-11: LGTM!

Dependabot configuration is valid and covers both npm and GitHub Actions on a sensible weekly cadence.

.github/ISSUE_TEMPLATE/bug_report.md (1)

1-23: LGTM!

Front matter and sections are well-formed.

.github/ISSUE_TEMPLATE/feature_request.md (1)

1-18: LGTM!

.devcontainer/devcontainer.json (1)

1-13: LGTM!

Dev container config is minimal and correct; postCreateCommand: bun install pairs well with the Bun feature.

.github/PULL_REQUEST_TEMPLATE.md (1)

14-14: CONTRIBUTING.md exists in the repository, so the checklist reference is valid. No action needed.

			> Likely an incorrect or invalid review comment.
.pre-commit-config.yaml (1)

2-7: [rewritten review comment]
[classification tag]

Comment on lines +16 to +19
- run: npm ci
- run: npm run build --if-present
- name: Run benchmarks
run: npm run benchmark --if-present || echo "No benchmarks configured yet"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Benchmark job is effectively a no-op.

package.json does not define a benchmark script, so npm run benchmark --if-present will silently skip and the fallback echo will print on every push to main. Either add a real benchmark script (and persist/compare results, e.g., via benchmark-action/github-action-benchmark) or remove this workflow until benchmarks exist to avoid misleading "✅" signals.

Also, npm ci assumes a committed package-lock.json — see the corresponding comment on ci.yml.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/benchmark.yml around lines 16 - 19, The benchmark workflow
currently runs npm ci and then attempts npm run benchmark --if-present which
silently does nothing because there is no "benchmark" script; either add a real
"benchmark" npm script in package.json (e.g., "benchmark": "node ./bench/run.js"
or a runner that outputs JUnit/JSON) and wire a benchmarking action (such as
benchmark-action/github-action-benchmark) to persist/compare results, or
remove/disable the "Run benchmarks" step and the workflow until benchmarks exist
to avoid misleading successful runs; also ensure the workflow uses npm install
instead of npm ci if there is no committed package-lock.json (or commit
package-lock.json) to avoid npm ci failures.

Comment thread .github/workflows/ci.yml
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
fd -H -t f '^(package-lock\.json|bun\.lockb|pnpm-lock\.yaml|yarn\.lock)$' -d 2

Repository: photon-hq/spectrum-ts

Length of output: 47


🏁 Script executed:

# Search for lock files at any depth in the entire repository
fd -H -t f '(package-lock\.json|bun\.lockb|pnpm-lock\.yaml|yarn\.lock)$'

Repository: photon-hq/spectrum-ts

Length of output: 47


🏁 Script executed:

# Check if package.json exists and what package manager is specified
if [ -f package.json ]; then
  echo "=== package.json exists ===" 
  head -30 package.json
fi

Repository: photon-hq/spectrum-ts

Length of output: 495


🏁 Script executed:

# Check the CI workflow file to understand the full context
if [ -f .github/workflows/ci.yml ]; then
  echo "=== CI Workflow ===" 
  cat -n .github/workflows/ci.yml | head -50
fi

Repository: photon-hq/spectrum-ts

Length of output: 952


🏁 Script executed:

# Search for turbo configuration
fd -H -t f 'turbo\.json|\.turborc|\.turborc\.json'

Repository: photon-hq/spectrum-ts

Length of output: 75


Replace npm ci with the correct package manager installation for Bun.

The repository declares "packageManager": "bun@1.3.5" in package.json but the CI workflow uses npm ci on lines 20 and 31. No lock files exist (package-lock.json, bun.lockb, pnpm-lock.yaml, or yarn.lock), so npm ci will fail immediately with every CI run. Use bun install instead to match the declared package manager.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 20, CI currently runs "npm ci" which
conflicts with package.json's packageManager "bun@1.3.5" and will fail without
lockfiles; replace each "npm ci" invocation in the CI workflow (both occurrences
of the string "npm ci") with "bun install" so the workflow uses Bun as the
package manager and installs dependencies correctly.

Comment thread .github/workflows/ci.yml
Comment on lines +21 to +32
- run: npm run build --if-present
- run: npm test --if-present

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm run lint --if-present
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

CI silently skips quality gates — test/lint scripts don't exist.

package.json only defines build, dev, check, and fix scripts. Because every step uses --if-present, npm test and npm run lint will no-op, so this workflow provides no real lint or test coverage despite appearing green. Also, npm run build under turbo build will run but CI contributes nothing beyond that.

Consider invoking the scripts that actually exist (e.g., npm run check for linting via ultracite) and dropping --if-present on required steps so missing scripts fail loudly.

Proposed fix
-      - run: npm ci
-      - run: npm run build --if-present
-      - run: npm test --if-present
+      - run: npm ci
+      - run: npm run build
+      - run: npm test --if-present
...
-      - run: npm ci
-      - run: npm run lint --if-present
+      - run: npm ci
+      - run: npm run check
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 21 - 32, The CI workflow currently
uses optional flags and calls to scripts that don't exist (npm test, npm run
lint) so quality gates are silently skipped; update the workflow to call the
actual scripts defined in package.json (e.g., replace npm test and npm run lint
with npm run check and any other concrete scripts like npm run fix if desired)
and remove --if-present from required steps (for example remove --if-present
from the build/check commands) so missing scripts fail the job; change the job
step commands in the lint and build jobs (referencing the existing job names and
the commands npm run build, npm test, npm run lint, npm run check, and the
--if-present flag) accordingly to ensure CI fails loudly when scripts are
absent.

Comment on lines +13 to +17
- uses: anchore/sbom-action@v0
with:
image: node:22
format: spdx-json
output-file: sbom.spdx.json
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

SBOM scans the wrong target — it inventories node:22, not this project.

Using image: node:22 produces an SBOM of the upstream Node.js Docker image rather than Spectrum-TS's own source/dependencies. For a project SBOM that actually reflects this repo's supply chain, scan the checked-out workspace (which will pick up package.json/bun.lockb/package-lock.json).

Proposed change
       - uses: actions/checkout@v4
       - uses: anchore/sbom-action@v0
         with:
-          image: node:22
-          format: spdx-json
+          path: .
+          format: spdx-json
           output-file: sbom.spdx.json

Also worth considering: run this on push to main (or on release tags) in addition to the weekly cron, so the SBOM reflects the actual shipped code rather than whatever happened to be on main at 06:00 Monday.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: anchore/sbom-action@v0
with:
image: node:22
format: spdx-json
output-file: sbom.spdx.json
- uses: anchore/sbom-action@v0
with:
path: .
format: spdx-json
output-file: sbom.spdx.json
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/sbom.yml around lines 13 - 17, The SBOM step currently
scans the upstream image (anchore/sbom-action with image: node:22) instead of
this repo; update the SBOM action config to scan the checked-out workspace (use
the action's directory/path input such as path: . or target: . instead of image:
node:22) so it inventories package.json/bun.lockb/package-lock.json and write to
output-file: sbom.spdx.json; also update the workflow triggers to run on push to
main (or release tags) in addition to the weekly cron so the SBOM reflects
shipped code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant