Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

Commit 24c8751

Browse files
Copilotunclesp1d3rcursoragentdependabot[bot]
authored
Fix PR review findings, CI stabilization, and docs consolidation (#80)
## Summary - Resolve all CodeRabbit and manual PR review findings across CI, runtime safety, and documentation - Stabilize all CI workflows (Linux, macOS, Windows, docs, release) to pass consistently - Consolidate CLAUDE.md session learnings into AGENTS.md for all AI assistants ## Changes ### Security & Runtime Safety - Prevent XML injection via proper escaping - Fix integer overflow in VLAN total calculation (u16 → u32 cast before arithmetic) - Fix `par_chunks(0)` panic in streaming XML for empty configs - Fix empty-vec panic in VPN DNS selection - Remove dead code and unused dependencies ### CI Stabilization - Add mise installation to Copilot Setup Steps workflow - Fix Codecov slug (was pointing to wrong repository) - Fix coverage upload path (`target/lcov.info` → `lcov.info`) - Fix release.yml SBOM upload typo (`output` → `outputs`) - Pin `assert_cmd = "=2.0.17"` to avoid deprecation errors under `-D warnings` - Normalize Windows `.exe` suffix and temp paths in snapshot tests - Remove conflicting CodeQL workflow (default setup already enabled) - Fix mdBook build (remove deprecated `multilingual` field and unused `mdbook-alerts`) - Update cargo-dist to 0.30.4 and regenerate release workflow ### Documentation - Fix LICENSE copyright ("Stringy Contributors" → correct project) - Fix README license reference (MIT → Apache 2.0) - Fix VLAN range "1-4094" → "10-4094" across 4 docs files - Fix Rust version "1.70+" → "1.85+" in installation docs - Fix broken relative links in 5 docs files - Remove non-existent CLI flags from output-formats docs - Remove fake `RUST_GC_THRESHOLD`, `sudo cargo run`, invalid `--registry` flag - Add CI/CD lessons learned section to AGENTS.md - Consolidate all CLAUDE.md learnings into AGENTS.md ### Config & Quality - Fix deny.toml project name and dev-dependency conflict - Add null checks in mermaid-init.js - Fix justfile recipe name typo - Remove non-functional docs.rs badge from README ## Test plan - [x] `just ci-check` passes locally (342 tests, all pre-commit hooks) - [x] All CI workflows green (quality, test, cross-platform, coverage, release, docs) - [x] `cargo dist plan` passes after regeneration - [x] Windows snapshot tests pass with normalized paths 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: UncleSp1d3r <unclespider@protonmail.com> Signed-off-by: Kent Melton <kent@kmelton.dev> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: unclesp1d3r <251112+unclesp1d3r@users.noreply.github.com> Co-authored-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: kmelton <kmelton@mac.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: UncleSp1d3r <unclespider@protonmail.com>
1 parent 0562e40 commit 24c8751

132 files changed

Lines changed: 173798 additions & 14100 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto eol=lf
3+
4+
# Rust files
5+
*.rs text diff=rust
6+
Cargo.toml text
7+
Cargo.lock text
8+
9+
# Docker files
10+
Dockerfile text
11+
*.dockerfile text
12+
docker-compose*.yml text
13+
.dockerignore text
14+
15+
# Documentation
16+
*.md text diff=markdown
17+
*.txt text
18+
*.rst text
19+
LICENSE text
20+
21+
# Config files
22+
*.json text
23+
*.toml text
24+
*.yml text
25+
*.yaml text
26+
*.ini text
27+
*.cfg text
28+
*.conf text
29+
30+
# Web files
31+
*.html text diff=html
32+
*.html.j2 text diff=html
33+
*.css text diff=css
34+
*.js text
35+
*.jsx text
36+
*.ts text
37+
*.tsx text
38+
*.vue text
39+
40+
# SQL files
41+
*.sql text
42+
43+
# Binary files
44+
*.db binary
45+
*.p binary
46+
*.pkl binary
47+
*.pickle binary
48+
*.pyc binary
49+
*.pyd binary
50+
*.pyo binary
51+
*.pdb binary
52+
53+
# Image files
54+
*.png binary
55+
*.jpg binary
56+
*.jpeg binary
57+
*.gif binary
58+
*.ico binary
59+
*.svg text
60+
61+
# Font files
62+
*.ttf binary
63+
*.eot binary
64+
*.woff binary
65+
*.woff2 binary
66+
67+
# Archive files
68+
*.zip binary
69+
*.7z binary
70+
*.gz binary
71+
*.tar binary
72+
*.tgz binary
73+
*.rar binary
74+
75+
# Executables
76+
*.exe binary
77+
*.dll binary
78+
*.so binary
79+
*.dylib binary
80+
81+
.env text=utf-8 eol=lf

.github/CODEOWNERS

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/actionlint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# .github/actionlint.yaml
2+
paths:
3+
".github/workflows/release.yml": # This is an autogenerated workflow file and should not be linted. It is regenerated by cargo-dist.
4+
ignore:
5+
- ".*"
6+
- "shellcheck reported issue in this script:.*"
7+
- 'context "secrets" is not allowed here.*'

.github/commit-instructions.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Commit Message Style for OPNsense-config-faker
2+
3+
- **Conventional Commits**: All commits must follow [Conventional Commits](https://www.conventionalcommits.org): `<type>(<scope>): <description>`
4+
- **Types**: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`
5+
- **Scopes**: `(cli)`, `(generators)`, `(validators)`, `(network)`, `(xml)`, `(csv)`, `(json)`, `(vlan)`, `(firewall)`, `(interfaces)`, `(routing)`, `(io)`, `(models)`, `(deps)`, `(ci)`, `(build)`, etc. Required for all commits.
6+
- **Description**:
7+
- Imperative mood ("add", not "added")
8+
- No period at the end
9+
- ≤72 characters, capitalized, clear and specific
10+
- **Body (optional)**:
11+
- Start after a blank line
12+
- Use itemized lists for multiple changes
13+
- Explain what/why, not how
14+
- **Footer (optional)**:
15+
- Start after a blank line
16+
- Use for issue refs (`Closes #123`) or breaking changes (`BREAKING CHANGE:`)
17+
- **Breaking Changes**:
18+
- Add `!` after type/scope (e.g., `feat(cli)!: ...`) or use `BREAKING CHANGE:` in footer
19+
- **Examples**:
20+
- `feat(generators): add VLAN configuration generation with IEEE 802.1Q compliance`
21+
- `fix(validators): prevent VLAN ID overflow in batch generation`
22+
- `docs(readme): update CLI examples with firewall rule generation`
23+
- `refactor(network): simplify IP range generation logic`
24+
- `test(cli): add property-based tests for VLAN ID validation`
25+
- `chore(deps): update clap to v4.5.2 for better CLI help formatting`
26+
- `perf(xml): optimize XML serialization for large configurations`
27+
- `feat(firewall): add realistic firewall rule generation with security patterns`
28+
- `feat(cli): add --base-network option for custom IP range specification`
29+
- `fix(xml): handle malformed OPNsense XML templates gracefully`
30+
- **CI Compatibility**:
31+
- All commits must pass `just ci-check` and network validation
32+
- Use `chore:` for meta or maintenance changes
33+
- Use `deps:` scope for dependency updates
34+
- **Network Configuration Specific**:
35+
- `feat(vlan): add support for IEEE 802.1Q tag generation`
36+
- `fix(firewall): correct rule priority ordering in XML output`
37+
- `feat(interfaces): add physical interface configuration generation`
38+
- `fix(routing): ensure generated routes have valid next-hop addresses`

.github/prompts/ci_check.prompt.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
mode: agent
3+
model: Auto (copilot)
4+
tools: [githubRepo, edit, search, new, runCommands, runTasks, usages, vscodeAPI, think, problems, changes, testFailure, openSimpleBrowser, fetch, extensions, todos, memory]
5+
description: Ensure code changes pass all CI checks before merging.
6+
---
7+
8+
1. First, run `just ci-check` to identify any failures
9+
2. Analyze the output to understand what specific checks are failing. If everything passes, you’re done.
10+
3. Make minimal, targeted fixes to address ONLY the failing checks:
11+
- For formatting issues: run `just format`
12+
- For linting issues (clippy): fix the specific violations reported (rerun with `just lint-rust` / `just lint-rust-min`)
13+
- For compilation/type errors: fix the underlying Rust code until `just check` (or `cargo check`) succeeds
14+
- For test failures: fix the failing tests or underlying code (verify with `just test` or `just test-ci`)
15+
- For dependency security/advisory issues: run `just audit` (cargo-audit) and/or update `Cargo.toml` then `cargo update`
16+
- For license/compliance issues: run `just deny` and address cargo-deny findings
17+
4. After making fixes, run `just ci-check` again to verify all checks pass
18+
5. If any checks still fail, repeat steps 2-4 until all checks pass
19+
6. Provide a summary of what was fixed and confirm that `just ci-check` now passes completely
20+
21+
Keep changes minimal and focused - only fix what's actually causing the CI failures. Do not make unnecessary refactoring or style changes beyond what's required to pass the checks.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
mode: agent
3+
model: GPT-5 (copilot)
4+
tools: [githubRepo, edit, search, new, runCommands, runTasks, usages, vscodeAPI, think, problems, changes, testFailure, openSimpleBrowser, fetch, extensions, todos, memory]
5+
description: Analyze diff, apply safe internal fixes, report results
6+
---
7+
8+
Analyze only the changed files (diff scope) and improve them while preserving public APIs. Focus categories: (1) Code Smells (large/duplicate/complex) (2) Design Patterns (traits, builder, newtype, factory) (3) Best Practices (Rust 2024, project conventions) (4) Readability (naming, structure, cohesion) (5) Maintainability (modularization, clarity) (6) Performance (async, redb I/O, allocation, blocking) (7) Type Safety (strong types, avoid needless Option/Result layering) (8) Error Handling (thiserror + anyhow context, no silent failures). Context: OPNsense-config-faker = network configuration generation, OPNsense XML compliance, zero-warnings, CLI-first, realistic test data. Prefer clear + maintainable over clever.
9+
10+
## ACTION WORKFLOW (MANDATORY)
11+
12+
1. Collect diff file list. 2. Analyze per focus category. 3. Classify each finding: `safe-edit` (apply now), `deferred`, `requires-approval`. 4. Auto-apply only `safe-edit` (mechanical, internal, non-breaking, warning removal, correctness, logging consistency, blocking I/O → async). 5. Run `just lint` then `just test`. On failure: isolate failing hunk, revert it, re-run, document skip. 6. Generate report (summary table, applied edits + rationale, deferred backlog, approval-needed with risks, next-step roadmap). 7. Output unified diff (never commit). If zero safe edits: state "No safe automatic edits applied" and still output full report.
13+
14+
## AUTO-EDIT CONSTRAINTS (STRICT)
15+
16+
- Scope: Only diff-related files
17+
- Gates: Must pass `just lint` + tests
18+
- User Control: Never commit/stage
19+
- Public API: No signature/visibility/export changes
20+
- Validation: Always run quality gates before reporting
21+
22+
## CRITICAL REQUIREMENTS
23+
24+
- Actionable suggestions (code examples when clearer)
25+
- Auto-apply only clearly safe internal fixes
26+
- Prioritize runtime correctness, safety, type rigor, security posture
27+
- Preserve all public APIs (no signature/visibility changes)
28+
- Avoid cleverness; optimize for clarity & maintainability
29+
30+
## REPO RULES (REINFORCED)
31+
32+
Zero warnings (clippy -D warnings) | No unsafe | Precise typing | Network configuration validity | Trait-based services | `thiserror` + `anyhow` | OPNsense XML schema compliance | CLI-first (`opnsense-config-faker`) | Memory efficient | Realistic test data generation | Network range validation | No hardcoded secrets | rustdoc for all public APIs
33+
34+
---
35+
36+
## EXECUTION CHECKLIST
37+
38+
1 Diff scan 2 Analyze 3 Classify 4 Safe edits applied 5 Gates pass 6 Report (summary/applied/deferred/approval-needed/roadmap) 7 Output diff. On blocker: report + remediation guidance.
39+
40+
## QUICK REFERENCE MATRIX
41+
42+
Category -> Examples of Safe Edits:
43+
44+
- Smells: remove dead code, split oversized internal fn (no visibility change)
45+
- Patterns: introduce small private helper or trait impl internally
46+
- Best Practices: replace blocking fs in async with tokio equivalent
47+
- Readability: rename local vars (non-public), add rustdoc/examples
48+
- Maintainability: extract internal module (keep re-export stable)
49+
- Performance: eliminate needless clone, memoize constant, bound Vec growth
50+
- Type Safety: replace `String` boolean flags with small internal enum (private)
51+
- Error Handling: add context via `anyhow::Context`, convert generic String errors to structured variants if already internal
52+
53+
If ambiguity arises, default to: classify (deferred) instead of applying.

0 commit comments

Comments
 (0)