code simplifier: allowed_issue_fields.cjs; remove drain3_server.py#40578
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot do the work |
|
@copilot remove usage of drain3_server.py . Delete that file as well. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. Applied all planned simplifications:
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. Removed in commit
|
There was a problem hiding this comment.
Pull request overview
This PR applies a small performance-focused refactor to the JS issue-field allowlist validator used by the Actions setup scripts, and removes the Drain3 Python FastMCP server integration (and references) from the repository’s shared MCP configurations and docs.
Changes:
- Refactors
validateAllowedIssueFieldsto build the allowlistSetonce and reuse it (including handling"*"wildcard). - Deletes the Drain3 MCP server implementation and its shared MCP config/test harness.
- Updates MCP documentation and debugging example text to remove Drain3 references.
Show a summary per file
| File | Description |
|---|---|
| docs/src/content/docs/guides/mcps.md | Removes Drain3 from the “pre-configured MCP servers” table. |
| actions/setup/js/allowed_issue_fields.cjs | Refactors allowlist validation to reuse a precomputed, case-insensitive set. |
| .github/workflows/smoke-copilot.lock.yml | Updates generated workflow lock metadata hash. |
| .github/workflows/shared/mcp/test_drain3_server.py | Removes the Drain3 server AST-based validation script. |
| .github/workflows/shared/mcp/drain3.md | Removes the shared MCP configuration that installed/launched the Drain3 server. |
| .github/workflows/shared/mcp/drain3_server.py | Removes the Drain3 FastMCP HTTP server implementation. |
| .github/workflows/shared/mcp-debug.md | Replaces the Drain3-specific debug example with generic placeholders. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 7/7 changed files
- Comments generated: 4
| @@ -1,4 +1,4 @@ | |||
| # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"6669d3fc0bdfdd7a9e54e10d8c1e41c04dc17e1d162f2e639dabdb1255ee8a78","body_hash":"3ed9a0835f964798b12a6c4c8600addbbf66518ae974a9e6ed7efefc76b0dc43","agent_id":"copilot","agent_model":"gpt-5.4","engine_versions":{"copilot":"1.0.63"}} | |||
| # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"6669d3fc0bdfdd7a9e54e10d8c1e41c04dc17e1d162f2e639dabdb1255ee8a78","body_hash":"112ba8db78a4994cdc51d736f773b2b1ac912f174b6b8a98fdfb331329235d12","agent_id":"copilot","agent_model":"gpt-5.4","engine_versions":{"copilot":"1.0.63"}} | |||
| if (!Array.isArray(allowedFields) || allowedFields.length === 0) { | ||
| return; | ||
| } | ||
| const allowedFieldSet = new Set(allowedFields.map(f => f.toLowerCase())); | ||
| if (allowedFieldSet.has("*")) { | ||
| return; | ||
| } |
| for (const field of issueFields) { | ||
| validateAllowedIssueFieldName(field.name, allowedFields); | ||
| if (!allowedFieldSet.has(field.name.toLowerCase())) { | ||
| throw new Error(`${ERR_VALIDATION}: issue field "${field.name}" is not in the allowed-fields list: ${allowedFields.join(", ")}`); | ||
| } |
| if (!Array.isArray(allowedFields) || allowedFields.length === 0) { | ||
| return; | ||
| } |
|
@copilot review all comments and address unresolved review feedback.
|
|
Hey
If you'd like a hand, you can assign this prompt to your coding agent:
|
|
@copilot merge main and recompile |
…ifier-failure-fix # Conflicts: # .github/workflows/smoke-copilot.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. Merged main (resolved the |
The scheduled Code Simplifier run #27893897834 completed its edits (+50/-51) but terminated with an authentication failure before committing. This PR applies those planned simplifications manually, and additionally removes the
drain3_server.pyMCP server and all associated files.allowed_issue_fields.cjsvalidateAllowedIssueFieldswas callingvalidateAllowedIssueFieldNamein a loop, which rebuiltnew Set(allowedFields)on every iteration. Refactored to build the Set once (reusing it for both the"*"wildcard check and per-field lookups):drain3_server.pyremovalThe Python-based Drain3 FastMCP server and all associated files have been deleted:
drain3_server.py— the Python FastMCP servertest_drain3_server.py— its AST-based test harnessdrain3.md— the shared MCP config whose setup steps existed solely to install dependencies and launchdrain3_server.pymcp-debug.md— replaced the drain3-specific example session with a generic placeholderdocs/guides/mcps.md— removed the Drain3 row from the pre-configured MCP server table