Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

  • Understand the issue requirements
  • Create .github/workflows/test-coverage-improver.md workflow file
  • Address code review feedback (use cron syntax for schedule)
  • Address additional code review feedback (simplify commands, add concrete examples)
  • Run code review - all issues addressed
  • Run security check (CodeQL) - no code changes to analyze
  • Allow all bash tools per reviewer request
  • Generate GitHub Actions YAML lock file

Summary

Created agentic workflow that:

  • Runs weekly on Monday 9AM UTC (0 9 * * 1) and manual trigger
  • Runs test suite with coverage reporting (npm run test:coverage)
  • Identifies files/modules with <80% coverage
  • Prioritizes security-critical code (iptables, domain validation, Squid config)
  • Creates a PR with new tests to improve coverage
  • Uses safe-outputs.create-pull-request with labels: [testing, ai-generated]
  • Allows all bash commands via bash: ["*"]

Files

  • .github/workflows/test-coverage-improver.md - Agentic workflow specification
  • .github/workflows/test-coverage-improver.lock.yml - Compiled GitHub Actions workflow
Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Create test coverage improver workflow</issue_title>
<issue_description>## Objective

Implement a daily/weekly workflow that identifies under-tested code areas and creates PRs with additional test coverage, prioritizing security-critical paths.

Context

Security tools require comprehensive test coverage. Untested code paths in a firewall represent security risks. This workflow systematically improves coverage by generating targeted tests for under-covered areas.

Approach

Create .github/workflows-agentic/test-coverage-improver.md workflow with:

Triggers:

  • Weekly schedule (to avoid noise)
  • Manual workflow_dispatch

Workflow should:

  1. Run test suite with coverage reporting (npm test -- --coverage)
  2. Identify files/modules with <80% coverage
  3. Analyze uncovered code branches and paths
  4. Generate specific test cases for uncovered scenarios
  5. Create PR with new tests (one PR per run, focused on highest-priority gaps)

Priority Focus:

  1. Security-critical code: iptables rules, domain validation, Squid config generation
  2. Container entrypoints and setup scripts
  3. CLI argument parsing and validation
  4. Error handling paths

Files to Create/Modify

  • Create: .github/workflows-agentic/test-coverage-improver.md
  • May need: Coverage analysis script in scripts/ci/analyze-coverage.ts
  • Reference: Existing test files in tests/ for patterns

Acceptance Criteria

  • Workflow file created with weekly schedule
  • Successfully runs test suite with coverage
  • Identifies files below coverage threshold
  • Prioritizes security-critical code
  • Generates appropriate test cases
  • Creates PR with working tests that increase coverage
  • Safe-outputs configured (max 1 PR per run)
  • At least one successful PR created and reviewed

Example Workflow Structure

---
description: Improve test coverage by adding tests to under-tested areas
on:
  schedule: weekly
  workflow_dispatch:
permissions:
  contents: read
  pull-requests: write
tools:
  bash:
    - "npm test*"
    - "npm run coverage*"
  github:
    toolsets: [default, pull_requests]
safe-outputs:
  create-pull-request:
    labels: [testing, ai-generated]
    max: 1
timeout-minutes: 20
---

Implementation Notes

AI generated by Plan Command for discussion #304

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 17, 2026 21:29
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement test coverage improver workflow feat(ci): add test-coverage-improver agentic workflow Jan 17, 2026
Copilot AI requested a review from Mossaka January 17, 2026 21:37
@Mossaka Mossaka marked this pull request as ready for review January 18, 2026 01:37
Copy link
Collaborator

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

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

@copilot please generate the github action yamls and push

Comment on lines 21 to 30
bash:
- "npm test*"
- "npm run*"
- "npx*"
- "cat*"
- "head*"
- "tail*"
- "grep*"
- "find*"
- "wc*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot please allow all bash tools

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated bash tools to allow all commands with ["*"] in commit 14abcd7.

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 18, 2026

@copilot please generate the github action yamls and push

Generated .github/workflows/test-coverage-improver.lock.yml by running gh aw compile test-coverage-improver in commit 14abcd7.

Copilot AI requested a review from Mossaka January 18, 2026 01:41
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.

[plan] Create test coverage improver workflow

2 participants