Repository navigation
A work project's slug can be renamed too (#1038) - #1040
Merged
Merged
Conversation
#1039 let only a kind: kb scope's slug change and refused a work project's with 422, so the four of the ten repo channels that are work projects could not be aligned to their repo basename. Any project's slug can now change; the unique index still refuses a taken one. The name follows the slug only when the request carries no name and the stored name equalled the stored slug, so a work project with a display name keeps it. MCP 3.13.1 updates the update_project and handoff descriptions.
The name-follows clause matched only name == slug, which dropped the unconditional follow a kb scope had, so a legacy kb row whose name drifted from its slug got 422 on a slug-only rename. A kb scope's name follows again; a work project's follows only when it was the slug. Also corrects the MCP changelog (update_project and delete_project descriptions, not handoff) and AC-5.1.6, which still said a slug cannot change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #1039 (#1038). #1039 let only a
kind: kbscope's slug change and refused awork project's with 422. Four of the ten repo channels Mark asked to rename to their repo
basename are work projects, so they could not be renamed. This lets any project's slug change.
Project.update_changeset/2: the work-project refusal (validate_slug_change) is gone. Theunique index on
(tenant_id, slug)still refuses a slug another project holds, archivedincluded.
namein the request) a kb scope's name always follows the slug,as before, including a legacy kb row whose name drifted from its slug. A work project's name
follows only when it equalled the old slug; a display name ("Fleet Dashboard") is kept.
CHANGELOG.md, the epic 5 story (AC-5.1.6), and the MCPupdate_project/delete_projectdescriptions say any project's slug can change. MCPbumped to 3.13.1.
Testing
mix test test/loopctl_web/controllers/project_controller_test.exs test/loopctl/projects/projects_test.exs: 183 tests, 0 failures.rename; a work project's slug change with a name keeps that name; a work
project named as its slug follows a slug-only rename; a work project with a display name
keeps it on a slug-only rename; a taken slug is 422 and the stored slug is unchanged.
npm --prefix mcp-server test: 916 pass, 0 fail.mix credo --stricton the changed files: no issues.Risk
A slug is how sessions reach a channel. Renaming a work project's slug changes the string
other sessions resolve, but #1039's folded lookup keeps the hyphenated form resolving
(
cron-booksreachescron_books) as long as exactly one active project folds to it. Arename to an unrelated string is not covered by the fold and would strand callers that still
use the old slug; the rename is audited with old and new slug, so it can be found and reversed.
Orchestrator role on a human-anchored tenant is still required. No custody gate changes.
How to revert
Revert this commit. Work-project slug changes go back to 422. Slugs already renamed stay
renamed and cannot be PATCHed back after the revert, so rename them back first if needed
(the audit log holds each old slug).
Review findings