Skip to content

feat: add project rename support#149

Open
scion-gteam[bot] wants to merge 1 commit into
mainfrom
scion/dev-issue-79-rename-project
Open

feat: add project rename support#149
scion-gteam[bot] wants to merge 1 commit into
mainfrom
scion/dev-issue-79-rename-project

Conversation

@scion-gteam
Copy link
Copy Markdown

@scion-gteam scion-gteam Bot commented Jun 6, 2026

Summary

  • Extends the existing PATCH /api/v1/projects/{projectId} endpoint to accept a slug field, allowing projects to be renamed
  • Adds scion project rename <project> <new-name> CLI command that updates both display name and slug
  • When the slug changes, associated group slugs (project:<slug>:agents, project:<slug>:members) and hub-managed filesystem paths are migrated automatically

What changes on rename

Resource Impact
Project slug (DB) Updated to new slug (sanitized via api.Slugify)
Project name (DB) Updated to new display name
Group slugs project:<old>:agentsproject:<new>:agents (same for :members)
Hub-managed workspace dirs ~/.scion/projects/<old>~/.scion/projects/<new>

What does NOT change

Resource Why
Project ID (UUID) Immutable — agents reference projects by ID, not slug
Agent records FK references project by ID
Git remote Independent of slug
Running agents Retain old slug until restarted; new agents use updated slug

Slug conflict handling

If the target slug is already taken by another project, the endpoint returns 409 Conflict. The slug is sanitized through api.Slugify() before comparison, so "My Project" becomes "my-project".

Closes #79

Test plan

  • TestProjectRenameSlug — rename both name and slug, verify DB update
  • TestProjectRenameSlugConflict — attempt rename to existing slug returns 409
  • TestProjectRenameSlugOnly — rename slug only, name unchanged
  • TestProjectRenameSlugSanitized — slug with spaces/uppercase is sanitized
  • TestProjectRenameSameSlugNoOp — same slug is a no-op (no migration triggered)
  • TestProjectRenameGroupMigration — agents and members group slugs are migrated
  • All existing project tests pass (no regressions)

Extend the PATCH /api/v1/projects/{projectId} endpoint to accept a
slug field, enabling projects to be renamed. When the slug changes,
associated group slugs (project:<slug>:agents, project:<slug>:members)
and hub-managed filesystem paths are migrated automatically.

Add `scion project rename <project> <new-name>` CLI command that
updates both the display name and slug in a single operation.

Closes #79
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.

Feature: Ability to rename projects

1 participant