Skip to content

Add slug to namespace projects#778

Merged
Taucher2003 merged 3 commits intomainfrom
777-add-slug-for-projects
Dec 21, 2025
Merged

Add slug to namespace projects#778
Taucher2003 merged 3 commits intomainfrom
777-add-slug-for-projects

Conversation

@Knerio
Copy link
Member

@Knerio Knerio commented Dec 15, 2025

close #777

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2227070410

Status: Passed
Duration: 5 minutes

Job summaries

rspec: [ee]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12511162517/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2227070410/test_report
Finished in 21.79 seconds (files took 11.56 seconds to load)
1305 examples, 0 failures
Line Coverage: 91.59% (4432 / 4839)
[TEST PROF INFO] Time spent in factories: 00:11.773 (42.43% of total time)

rspec: [ce]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12511162516/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2227070410/test_report
Finished in 20.8 seconds (files took 12.56 seconds to load)
1258 examples, 0 failures
Line Coverage: 91.03% (4264 / 4684)
[TEST PROF INFO] Time spent in factories: 00:11.219 (39.81% of total time)

rubocop

723 files inspected, no offenses detected

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a slug field to namespace projects to support URL-based identification of flows, particularly for HTTP flows. The slug is used as a URL path component to identify and route to project flows.

  • Adds a required slug column to the namespace_projects table with uniqueness constraint
  • Implements automatic slug generation with collision handling when not explicitly provided
  • Exposes slug via GraphQL API for both creation and updates
  • Updates HTTP flow URL generation to include project slug as a path prefix

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
db/migrate/20251215200029_add_slug_to_projects.rb Adds slug column and unique index to namespace_projects table
db/structure.sql Updates schema to reflect slug column addition
db/schema_migrations/20251215200029 Migration checksum for tracking
db/fixtures/development/06_namespace_projects.rb Adds slug to development fixture data
app/models/namespace_project.rb Adds slug validations (presence, uniqueness, format, length)
app/models/flow.rb Updates to_grpc method to prepend project slug to HTTP flow URLs
app/services/namespaces/projects/create_service.rb Implements automatic slug generation with collision retry logic
app/graphql/types/namespace_project_type.rb Exposes slug field in GraphQL type
app/graphql/mutations/namespaces/projects/create.rb Adds optional slug argument to create mutation
app/graphql/mutations/namespaces/projects/update.rb Adds optional slug argument to update mutation
spec/models/namespace_project_spec.rb Adds validation specs for slug field
spec/factories/namespace_projects.rb Updates factory to auto-generate slug from name
spec/services/namespaces/projects/create_service_spec.rb Adds tests for slug generation and collision handling
spec/requests/graphql/mutation/namespace/projects/create_mutation_spec.rb Updates audit event expectations to include slug
spec/graphql/types/namespace_project_type_spec.rb Adds slug to expected GraphQL fields
spec/models/flow_spec.rb Updates flow tests to verify slug inclusion in HTTP URLs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Knerio Knerio requested a review from Taucher2003 December 15, 2025 21:49
@Knerio Knerio force-pushed the 777-add-slug-for-projects branch from 1beea7a to d9d9fc7 Compare December 16, 2025 16:03
@Taucher2003 Taucher2003 merged commit a92005a into main Dec 21, 2025
1 check passed
@Taucher2003 Taucher2003 deleted the 777-add-slug-for-projects branch December 21, 2025 19:35
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.

Add slug for projects

2 participants