Repository navigation
Add PR CI: script linting/syntax checks and JS unit tests - #7
Merged
Merged
Conversation
Introduces a GitHub Actions workflow (.github/workflows/ci.yml) that runs on pull requests and pushes to master: - syntax: bash -n / node --check / py_compile for every script, discovering shell scripts by shebang so extension-less bash files are covered. - shellcheck: ShellCheck at --severity=error (conservative first gate; tighten over time as findings are cleaned up). - powershell: PSScriptAnalyzer (Error severity) on publish.ps1. - js-tests: `node --test` via `npm test`. Adds the first unit tests: ci/add-plugin-installer-script.test.js exercises the package.json transformer end-to-end as a subprocess (scoped-name stripping, script creation, field preservation). Adds a root package.json with the test script and ignores node_modules. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ShellCheck at --severity=error flags the unquoted ${@:3} expansion.
Quoting as "${@:3}" expands each remaining commitish as its own word
without re-splitting or globbing (behavior-preserving), and lets the
new shellcheck CI job pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This pull request introduces a comprehensive CI workflow and adds foundational project files to support testing and script validation for the repository. The main changes are the addition of a GitHub Actions workflow for CI, a
package.jsonto enable Node.js-based testing, and an initial test suite for theadd-plugin-installer-script.jsscript.CI/CD and Testing Infrastructure:
.github/workflows/ci.ymlworkflow that runs syntax checks for shell, JavaScript, and Python scripts, lints shell scripts with ShellCheck, analyzes PowerShell scripts with PSScriptAnalyzer, and runs JavaScript tests using Node.js 20.package.jsonfile to define the project as a private Node.js package, describe its purpose, and add a test script using Node.js's built-in test runner.Test Coverage:
ci/add-plugin-installer-script.test.js, providing end-to-end tests for theadd-plugin-installer-script.jsscript. These tests verify that the script correctly adds an install script, handles scoped and unscoped package names, preserves existing fields, and creates thescriptsobject if missing.Test Plan
Security Impact
For assistance, see this wiki page.
PBI/Bug: AB#
Task: AB#