Skip to content

ci(console-guard): upgrade no-console to error + baseline guard (#4233)#4299

Merged
aegis-gh-agent[bot] merged 1 commit into
developfrom
hotfix/console-ci-guard
May 26, 2026
Merged

ci(console-guard): upgrade no-console to error + baseline guard (#4233)#4299
aegis-gh-agent[bot] merged 1 commit into
developfrom
hotfix/console-ci-guard

Conversation

@OneStepAt4time

Copy link
Copy Markdown
Owner

Summary

Closes #4233

Upgrades the ESLint no-console rule from warn to error for production src/ code and adds a CI guard script to prevent new console.* calls from being introduced.

Changes

eslint.config.js

  • Upgraded no-console from warnerror for src/**/*.ts
  • Expanded ignore list to cover all 34 existing violator files (excluding tests)
  • Added comment: goal is to shrink the ignore list over time by migrating to StructuredLogger

scripts/console-guard.sh (new)

  • Baseline counter script: counts console.log/warn/error in non-test src/
  • Fails CI if count exceeds baseline (165)
  • Warns if count drops below baseline (suggest updating)
  • Acts as a second layer of defense beyond ESLint

.github/workflows/ci.yml

  • Added Console.* guard step to lint job, runs bash scripts/console-guard.sh

Verification

  • npm run lint → 0 errors, 289 warnings (all pre-existing)
  • bash scripts/console-guard.sh → ✅ PASS (165 violations, baseline 165)

Impact

  • Zero new console.* calls can be added to production code without explicit exclusion
  • Existing code is not broken — all current violators are excluded
  • Future PRs that add console.* to any new or existing file will fail CI

@aegis-gh-agent aegis-gh-agent Bot 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.

✅ Approved — CI green. eslint no-console warn→error with 30 existing violator files excluded. console-guard.sh baseline script (165) as CI safety net. .gitignore addition. Good hygiene PR.

@aegis-gh-agent aegis-gh-agent Bot 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.

⚠️ Merge conflict — likely from ci.yml changes in recent merges (#4289, #4306). Approved, just needs rebase.

aegis-gh-agent[bot]
aegis-gh-agent Bot previously approved these changes May 26, 2026

@aegis-gh-agent aegis-gh-agent Bot 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.

Approved — clean CI guard upgrade.

Reviewed: eslint.config.js + console-guard.sh + ci.yml + .gitignore

Checklist:

  • no-console: warn → error — correct enforcement direction
  • ✅ Baseline guard script (165) is clever — catches new violations even if eslint ignores drift
  • ✅ Prints removed violations to encourage shrinking the baseline
  • set -euo pipefail — robust bash
  • ✅ CI step in correct position (after lint)
  • ✅ Targets develop, conventional commit title
  • ⚠️ .gitignore adds aegis entry — scope contamination (unrelated to console guard). Acceptable.
  • ⚠️ 30+ eslint ignore entries = significant tech debt, but baseline guard ensures monotonic improvement
  • ⚠️ Full CI not yet triggered — Gate 3 pending

Code quality approved. Merge blocked until CI green.

…cript (#4233)

- Upgrade eslint no-console rule from warn to error for src/
- Exclude all 34 existing violator files (tracked for future cleanup)
- Add scripts/console-guard.sh — baseline counter that blocks new violations
- Wire console guard into CI lint job
- Goal: zero new console.* in production code; migrate existing to StructuredLogger

@aegis-gh-agent aegis-gh-agent Bot 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.

✅ Re-approved post-rebase. CI running.

@aegis-gh-agent aegis-gh-agent Bot merged commit 3b1b2f2 into develop May 26, 2026
17 checks passed
@aegis-gh-agent aegis-gh-agent Bot deleted the hotfix/console-ci-guard branch May 26, 2026 21:07
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.

1 participant