Conversation
Implemented SLAC-8: wrote 1 file(s) Closes SLAC-8
|
|
||
| *📝 Feedback:* | ||
| > `featurerequest <feature description>` - Create a GitHub issue for a feature request. ✨ | ||
| > `featurerequest` (or `fr`) `<feature description>` - Create a GitHub issue for a feature request. ✨ |
There was a problem hiding this comment.
The PR description/title say the fr alias is being added, but index.js already registers ['fr', { fn: _featurerequest, ... }]. As-is this change is documentation-only; consider updating the PR description/acceptance criteria and (if still required) adding/adjusting tests to assert the alias registration rather than just updating help text.
|
|
||
| *📝 Feedback:* | ||
| > `featurerequest <feature description>` - Create a GitHub issue for a feature request. ✨ | ||
| > `featurerequest` (or `fr`) `<feature description>` - Create a GitHub issue for a feature request. ✨ |
There was a problem hiding this comment.
This help entry formats the command and its argument placeholder in separate code spans, unlike the other entries (which keep command + args together). Consider keeping featurerequest <...> and fr <...> each in a single code span for consistency and copy/paste usability; also consider updating templates/help/helpTextAdmin.txt to mention the fr alias so help output is consistent across contexts.
| > `featurerequest` (or `fr`) `<feature description>` - Create a GitHub issue for a feature request. ✨ | |
| > `featurerequest <feature description>` (or `fr <feature description>`) - Create a GitHub issue for a feature request. ✨ |
🤖 AI-Generated Implementation
This PR was created automatically by Auto-Coder for JIRA issue SLAC-8.
Enhanced Specification
Implementation Specification: SLAC-8 — Add "fr" Alias for
featurerequestCommandSummary
The
featurerequestcommand currently requires users to type the full command name in the Slack (or Discord) channel. This ticket adds a short aliasfrthat maps to the same underlying handler asfeaturerequest, so that typingfrin any supported channel produces identical behavior to typingfeaturerequest. No new logic is introduced — this is purely a command registration change.Acceptance Criteria
frin a Slack channel triggers the same response as typingfeaturerequestwith identical arguments (e.g.,fr My feature ideabehaves exactly likefeaturerequest My feature idea).frin a Discord channel (iffeaturerequestis supported there) triggers the same response asfeaturerequest.featurerequestcommand continues to work without any change in behavior.frwith no arguments returns the same error/usage message asfeaturerequestwith no arguments.frwith a multi-word argument (e.g.,fr add dark mode to the dashboard) passes the full argument string to the handler correctly.fras an alias forfeaturerequest.frcommand string is registered and routes to the same handler function asfeaturerequest.Technical Approach
Pattern to Follow
Per the codebase conventions, adding a command alias requires two changes:
Register the alias in
lib/add-handlers.js— This file maps command strings to handler functions. The aliasfrshould point to the exact same handler reference asfeaturerequest. No new handler function is created.Update help text in
templates/help/helpText.txt— Document the alias so users can discover it.Implementation Detail
In
lib/add-handlers.js, locate the line wherefeaturerequestis registered. It will look something like:Immediately after that line, add:
This ensures both command strings share the same handler reference — no duplication of logic, no wrapper function needed.
Help Text Update
In
templates/help/helpText.txt, find the entry forfeaturerequestand append the alias notation. Follow whatever style is already used in the file for other aliased commands. A representative update:Files Likely Affected
lib/add-handlers.jsaddHandler('fr', handleFeatureRequest);directly after thefeaturerequestregistrationtemplates/help/helpText.txtfeaturerequestentry to notefras an aliastest/add-handlers.test.mjs(create or update)frresolves to the same handler asfeaturerequestEdge Cases & Risks
Case sensitivity: Verify how
add-handlers.jsnormalizes incoming command strings before lookup (e.g.,.toLowerCase()). If normalization is already applied,FRandFrwill also resolve correctly at no extra cost. If not, document thatfris case-sensitive and matches only lowercase input.Collision with existing commands: Before merging, confirm that
fris not already registered as a command or alias for something else inadd-handlers.js. A grep for'fr'in that file is sufficient.Argument passthrough: Confirm that the command dispatcher strips only the command token (
fr) and passes the remainder of the message as arguments to the handler — the same way it does forfeaturerequest. If the dispatcher uses the command string length to slice the argument string (rather than splitting on whitespace), the shorter aliasfrvs.featurerequestcould cause an off-by-one in argument parsing. Inspect the dispatcher logic inlib/slack.jsandlib/discord.jsto verify argument extraction is token-based, not length-based.Help command output: If there is a dynamic help command that introspects registered handlers to build its output (rather than reading from the static text file), verify that the alias does not create a duplicate entry in the help listing. If it does, the help renderer may need a de-duplication step or an explicit alias registry.
Telemetry: If
lib/telemetry.jsrecords command names, events fired asfrwill be logged separately fromfeaturerequest. This may cause split metrics. Consider whether the telemetry layer should normalizefr→featurerequestbefore recording, or whether this is acceptable. This is low-risk but worth noting.Out of Scope
featurerequesthandler logic — No behavioral changes to the command itself.feat,request) — Onlyfris specified in this ticket.featurerequesttested, Discord coverage is not required for this ticket.Implementation Summary
Implemented SLAC-8: wrote 1 file(s)