Skip to content

DO NOT MERGE: negative test of CI enforcement - #30

Closed
ldastey-dev wants to merge 3 commits into
mainfrom
ci/negative-test-DO-NOT-MERGE
Closed

ldastey-dev wants to merge 3 commits into
mainfrom
ci/negative-test-DO-NOT-MERGE

Conversation

@ldastey-dev

Copy link
Copy Markdown
Owner

Temporary draft PR verifying that the new workflows actually fail on breakage. Contains a deliberate GNU-only find -perm /111 (must fail macos-bash) and PowerShell 7-only ternary syntax (must fail the 5.1 compatibility gate). Will be closed and deleted.

ldastey-dev and others added 3 commits September 6, 2026 12:17
…anch

deploy.sh and deploy.ps1 are load-bearing for every consumer of this library,
but CI only covered deploy.ps1, only on main and PRs into main, and only when
specific paths changed. deploy.sh was not in the path filter and had no
workflow at all, so it could break without any signal.

Triggers
- Both workflows now run on every push and every pull request, with no branch
  or path filters. Add concurrency groups so in-flight runs are superseded.

New deploy.sh workflow
- shellcheck (--severity=warning) and bash -n over every tracked .sh file, as a
  fast parallel gate.
- End-to-end tests/test-deploy.sh on ubuntu-latest and macos-latest, plus an
  explicit run under macOS /bin/bash 3.2 and a cwd-independence check.

deploy.ps1 workflow
- Add a fast parse + PSScriptAnalyzer compatibility gate (5.1 and 7.0).
- Add macos-pwsh to the matrix alongside Windows PowerShell 5.1.
- Fail if PSScriptAnalyzer is missing, since deploy.Tests.ps1 silently skips
  its compatibility test in that case, hiding 5.1 incompatibilities.

Portability fixes found by the new macOS coverage
- tests/test-deploy.sh used sha256sum and find -perm /111, both GNU-only. macOS
  has neither, so the suite could never have passed there. Replaced with
  helpers that fall back to shasum -a 256 and use -exec test -x for listing.
- deploy.sh: remove a dead 'sequence' assignment so shellcheck is clean at
  warning severity, allowing CI to gate on it.

Docs
- Record the portability constraints, CI enforcement, and the rule against
  narrowing these triggers in the maintainer AGENTS.md.
- Ignore testResults.xml, produced by Invoke-Pester -CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t run

pull_request already fires on the synchronize event, so a push to a branch with
an open pull request was running the full matrix twice — including the ~4 minute
Windows PowerShell 5.1 job. Coverage is unchanged: every pull request from any
branch still runs both workflows on every commit, and main is still protected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 6, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

It introduces confirmed baseline-breaking incompatibilities (BSD find vs -perm /111, and PowerShell 5.1 parse failure) and also deviates from the repo’s documented actions/checkout@v4 convention.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds CI enforcement for deploy script portability/compatibility (macOS bash 3.2 + BSD userland for deploy.sh, and Windows PowerShell 5.1 baseline for deploy.ps1) and updates maintainer guidance accordingly. As written, the PR also includes deliberate incompatibilities that will break the supported baselines (consistent with the PR description’s “negative test” intent).

Changes:

  • Introduces GitHub Actions workflows to lint and run end-to-end tests for deploy.sh (Ubuntu + macOS) and deploy.ps1 (Windows PowerShell 5.1 + pwsh across OSes), with added concurrency controls.
  • Updates tests/test-deploy.sh to use helper functions for tree checksums and executable discovery.
  • Documents portability/compatibility requirements in AGENTS.md and ignores Pester CI output.
File summaries
File Description
tests/test-deploy.sh Adds checksum/executable helper functions and uses them in the idempotency test case.
deploy.sh Minor change in interactive agent selection input handling (removes unused variable initialisation).
deploy.ps1 Adds a variable assignment using PowerShell 7-only ternary syntax (currently breaks 5.1).
AGENTS.md Expands explicit non-negotiables around bash 3.2/BSD portability and PS 5.1 compatibility + CI enforcement.
.gitignore Ignores Pester CI output file testResults.xml.
.github/workflows/deploy-sh-tests.yml New workflow to lint and run deploy.sh tests on Ubuntu + macOS (including /bin/bash).
.github/workflows/deploy-ps1-tests.yml Enhances workflow to remove path filters, add lint gate, expand OS coverage, and harden analyzer availability.
Review details

Suppressed comments (2)

.github/workflows/deploy-sh-tests.yml:76

  • Repo guidance and examples use actions/checkout@v4 (see standards/ci-cd.md:140). Pinning to actions/checkout@v7 deviates from that convention and may reference a non-existent major version.
      - uses: actions/checkout@v7

.github/workflows/deploy-ps1-tests.yml:93

  • Repo guidance and examples use actions/checkout@v4 (see standards/ci-cd.md:140). Pinning to actions/checkout@v7 deviates from that convention and may reference a non-existent major version.
      - uses: actions/checkout@v7
  • Files reviewed: 6/7 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

name: parse and compatibility analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
name: shellcheck and syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
Comment thread deploy.ps1
Comment on lines +550 to 551
$script:NegativeTest = $true ? 'yes' : 'no'
$ScriptDir = $PSScriptRoot
Comment thread tests/test-deploy.sh
Comment on lines +37 to +38
# -exec test -x is portable; GNU -perm /111 and BSD -perm +111 are not interchangeable.
list_executables() { find "$1" -type f -perm /111 | sort; }
@ldastey-dev ldastey-dev closed this Sep 6, 2026
@ldastey-dev
ldastey-dev deleted the ci/negative-test-DO-NOT-MERGE branch September 6, 2026 11:32
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.

2 participants