-
Notifications
You must be signed in to change notification settings - Fork 108
feat(missions): per-mission taskPrefix override for triaged task ids #1930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,7 +207,16 @@ export function buildCommitMsgTrailerHook( | |
| commitAuthorEmail?: string; | ||
| } = {} | ||
| ): string { | ||
| const taskPrefix = (options.taskPrefix ?? "FN").trim() || "FN"; | ||
| // Derive the strip prefix from the task id itself so per-mission prefixes | ||
| // (e.g. ERR-5 while the project taskPrefix is still "FN") strip correctly. | ||
| // The fusion-task-id file holds the real id, so PREFIX must match it, not the | ||
| // project-wide options.taskPrefix. Falls back to options.taskPrefix / "FN" | ||
| // only when taskId isn't a well-formed "<PREFIX>-<n>". | ||
| const trimmedTaskId = taskId.trim(); | ||
| const derivedPrefix = /^[A-Za-z][A-Za-z0-9]*-\d+$/.test(trimmedTaskId) | ||
| ? trimmedTaskId.replace(/-\d+$/, "").toUpperCase() | ||
| : ""; | ||
| const taskPrefix = (derivedPrefix || options.taskPrefix || "FN").trim() || "FN"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When |
||
| const trailerName = (options.trailerName ?? "Fusion-Task-Id").trim() || "Fusion-Task-Id"; | ||
| const commitAuthorName = (options.commitAuthorName ?? DEFAULT_COMMIT_AUTHOR_NAME).trim() || DEFAULT_COMMIT_AUTHOR_NAME; | ||
| const commitAuthorEmail = (options.commitAuthorEmail ?? DEFAULT_COMMIT_AUTHOR_EMAIL).trim() || DEFAULT_COMMIT_AUTHOR_EMAIL; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a mission already has
taskPrefixset and the edit form is cleared, this line converts the empty input toundefined.JSON.stringifydrops that key, so the PATCH route skipstaskPrefixand the old prefix remains stored; future triaged tasks keep using the stale mission prefix instead of inheriting the project prefix.