Skip to content

ci(workflows): make Knip and Jest workflows reusable - #85

Closed
open5588 wants to merge 1 commit into
ubiquity-os:developmentfrom
open5588:feat/issue-13-reusable-knip-jest-workflows
Closed

open5588 wants to merge 1 commit into
ubiquity-os:developmentfrom
open5588:feat/issue-13-reusable-knip-jest-workflows

Conversation

@open5588

Copy link
Copy Markdown

Summary

Converts the .github/workflows/knip.yml and .github/workflows/jest-testing.yml workflows into reusable GitHub Actions workflows (workflow_call) so repositories inheriting from plugin-template can invoke them centrally while customizing their package manager (bun vs yarn), runtime versions, and execution commands.

Changes

  • Added workflow_call triggers to .github/workflows/knip.yml with configurable inputs for package-manager, bun-version, node-version, yarn-version, install-command, knip-command, and knip-json-command.
  • Added workflow_call triggers to .github/workflows/jest-testing.yml with configurable inputs for package-manager, bun-version, node-version, yarn-version, install-command, and test-command.
  • Preserved direct pull_request and workflow_dispatch execution in plugin-template and compatible artifact upload for knip-reporter.yml.

Resolves #13
Fixes #13

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 04dc34c9-5901-4106-ac35-923b9cc2689b
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T10:30:27.483850Z b71c431 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ubiquity-os-beta ubiquity-os-beta Bot closed this Oct 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b71c431428

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

description: "Package manager to use ('bun' or 'yarn')"
required: false
default: "bun"
type: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject unknown managers before skipping Jest

When a reusable caller supplies anything other than the exact bun or yarn strings (for example, a typo), this unrestricted string input passes workflow-call validation, but every setup/install/test branch is skipped; the always-running summary step then exits successfully when no dashboard exists, so the required test check is green without running tests. Add an explicit validation step or a failing fallback branch.

Useful? React with 👍 / 👎.

description: "Package manager to use ('bun' or 'yarn')"
required: false
default: "bun"
type: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject unknown managers before skipping Knip

When a reusable caller passes a misspelled or unsupported package manager, this string input is accepted but all Bun/Yarn setup, install, and Knip steps are skipped; Store PR number still succeeds, so the workflow reports success without performing the analysis. Add input validation or an explicit failing fallback for values other than bun and yarn.

Useful? React with 👍 / 👎.

- name: Run Tests (Yarn)
if: ${{ inputs.package-manager == 'yarn' }}
run: |
${{ inputs.install-command || 'yarn install --immutable' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle Yarn Classic in the Jest install command

When a caller selects yarn and requests a Classic release such as yarn-version: 1.22.22, the default install exits before tests because Yarn Classic does not accept --immutable; its documented lock-preserving option is --frozen-lockfile, while Berry documents that option as the backward-compatible alias for --immutable (details). Either constrain the accepted Yarn versions to Berry or choose the install flag by major version.

Useful? React with 👍 / 👎.


- name: Install toolchain (Yarn)
if: ${{ inputs.package-manager == 'yarn' }}
run: ${{ inputs.install-command || 'yarn install --immutable' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle Yarn Classic in the Knip install command

When a caller selects yarn and requests a Classic release such as yarn-version: 1.22.22, the default install fails before Knip because Yarn Classic does not accept --immutable; its documented lock-preserving option is --frozen-lockfile, while Berry documents that option as the backward-compatible alias for --immutable (details). Either constrain the accepted Yarn versions to Berry or vary the install flag by major version.

Useful? React with 👍 / 👎.

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.

Make Knip and Jest workflows reusable

1 participant