Skip to content

[Fleet Monitor] petry-projects/google-app-scripts β€” .github/workflows/nodejs-tests.ymlΒ #388

Description

@don-petry

🟠 DEGRADED: petry-projects/google-app-scripts / .github/workflows/nodejs-tests.yml

Metric Value
Failure Rate 33.3% (12 / 36 runs)
Status DEGRADED
p50 Duration 36s
p95 Duration 149s
Successful Runs 24
Cancelled Runs 0

Workflow: .github/workflows/nodejs-tests.yml

Last updated by Fleet Monitor run on 2026-06-15.
Threshold: failure rate > 10% over the monitored window.

Activity

  1. don-petry commented on Jun 15, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead Implementation Plan

    Issue: #388 β€” [Fleet Monitor] petry-projects/google-app-scripts β€” .github/workflows/nodejs-tests.yml

    Root-cause analysis

    • The 12 runs the monitor counts as failures all have conclusion action_required with zero jobs executed β€” they are PR runs gated behind GitHub's "approve workflow run" setting, not test failures. There are 0 failure conclusions in the window (68 success, 12 action_required). Approval-gating is a repository Actions setting and cannot be changed from a workflow file.
    • However, nodejs-tests.yml has a genuine reliability/correctness defect: the "Discover packages" step only finds top-level directories containing a tests/ subdir (deploy, gas-installer) and then runs npx jest "<pkg>/tests" with a loose path-regex. As a result CI executes only 87 of 301 tests β€” the calendar-to-briefing-doc, calendar-to-sheets, and gmail-to-drive-by-labels packages are never run in CI. The discovery also depends on fs.readdirSync ordering, making it non-deterministic.
    • coverage.yml already runs the full suite deterministically with npm test -- --coverage, confirming the brittle discovery here is unnecessary.

    Scope

    Make nodejs-tests.yml run the full Jest suite deterministically (matching the project's npm test entry point) and drop the unused elevated actions: write permission.

    Implementation Checklist

    • Replace the brittle "Discover packages" + per-package loop in .github/workflows/nodejs-tests.yml with a single deterministic npm test invocation
    • Remove the unused actions: write job permission (least privilege; matches coverage.yml)

    Tests to Write

    • tests/workflows/nodejs-tests-workflow.test.js β€” assert the workflow runs the full suite via npm test, does not use the brittle top-level discovery pattern, and does not grant actions: write

    Test Command

    npm test

  2. don-petry commented on Jun 15, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Implementation Complete

    Root cause

    The 12 runs the Fleet Monitor counts as failures all have conclusion action_required with zero jobs executed β€” they are PR runs gated behind GitHub's "approve workflow run" setting (a repository Actions setting), not test failures. The window has 0 failure conclusions (68 success, 12 action_required). That gating cannot be changed from a workflow file.

    Separately, nodejs-tests.yml had a real reliability/correctness defect: the "Discover packages" step only found top-level directories containing a tests/ subdir (deploy, gas-installer) and ran npx jest "<pkg>/tests" with a loose path-regex. Net effect: CI executed only 87 of 301 tests β€” calendar-to-briefing-doc, calendar-to-sheets, and gmail-to-drive-by-labels were never run in CI β€” and discovery depended on non-deterministic fs.readdirSync ordering. coverage.yml already runs the full suite deterministically via npm test, confirming the brittle discovery was unnecessary.

    Plan Execution

    • Replaced the brittle "Discover packages" + per-package loop with a single deterministic npm test -- --colors (runs all packages via Jest testMatch)
    • Removed the unused actions: write job permission (least privilege; matches coverage.yml)
    • Added a regression test guarding the workflow against the brittle pattern

    Test Results

    > jest --runInBand
    
    
    Test Suites: 13 passed, 13 total
    Tests:       304 passed, 304 total
    Snapshots:   0 total
    Time:        1.691 s, estimated 4 s
    Ran all test suites.
    
    • Coverage: statements 98.91%, branches 90.00%, functions 98.00%, lines 100% β€” all thresholds met (node scripts/check-coverage.js).
    • npm run check (prettier + eslint): 0 errors.

    Files Changed

    • .github/workflows/nodejs-tests.yml: replaced FS-order-dependent discovery + loop (which silently skipped 3 of 5 test packages) with deterministic npm test -- --colors; dropped unused actions: write permission.
    • tests/workflows/nodejs-tests-workflow.test.js: new test asserting the workflow runs the full suite via npm test, avoids the brittle top-level discovery, and grants no actions: write.

    Notes

    • The monitor's "failure" signal is GitHub's action_required approval gate on PR runs β€” a repository setting outside any workflow file's control. The change here fixes the genuine workflow defects (non-deterministic, partial-coverage test execution) that left CI unable to actually validate most of the codebase.
    • .dev-lead/scripts/dev-lead-lint.sh reports pre-existing SC2043 shellcheck warnings in scripts/apply-repo-settings.sh and scripts/setup-code-quality-ruleset.sh. These files are unrelated to this issue and unchanged vs main; left untouched per the "do not modify unrelated files" constraint.
  3. don-petry commented on Jun 15, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Lint Check Failed

    The implementation for issue #388 contained lint errors. The commit was aborted to prevent a CI failure.

      [lint] shellcheck on 4 file(s)...
    
    In scripts/apply-repo-settings.sh line 40:
    for cmd in gh; do
               ^-- SC2043 (warning): This loop will only ever run once. Bad quoting or missing glob/expansion?
    
    
    In scripts/setup-code-quality-ruleset.sh line 39:
    for cmd in gh; do
               ^-- SC2043 (warning): This loop will only ever run once. Bad quoting or missing glob/expansion?
    
    For more information:
      https://www.shellcheck.net/wiki/SC2043 -- This loop will only ever run once...
    

    To retry: fix the lint errors locally (or re-apply the dev-lead label β€” the agent will try again).

  4. don-petry commented on Jul 15, 2026

    @don-petry
    CollaboratorAuthor

    βœ… Auto-resolved by Fleet Monitor. This workflow's failure rate has been below the 10% threshold (or the workflow was removed) since 2026-06-15 (30 days) β€” the monitor stopped flagging it. Closing. It will reopen automatically if the workflow crosses the threshold again.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions