-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
feat(api): Add slug in entities #415
Conversation
b87670b
to
d290cd5
Compare
cabc5f1
to
3c28096
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #415 +/- ##
===========================================
- Coverage 91.71% 87.77% -3.94%
===========================================
Files 111 102 -9
Lines 2510 2635 +125
Branches 469 401 -68
===========================================
+ Hits 2302 2313 +11
- Misses 208 322 +114
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CI Failure Feedback 🧐
✨ CI feedback usage guide:The CI feedback tool (
In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:
where Configuration options
See more information about the |
## [2.5.0](v2.4.0...v2.5.0) (2024-09-16) ### 🚀 Features * **api-client:** Added workspace controller ([#427](#427)) ([2f4edec](2f4edec)) * **api-client:** Added workspace role controller ([#430](#430)) ([b03ce8e](b03ce8e)) * **api-client:** Synced with latest API ([27f4309](27f4309)) * **api:** Add slug in entities ([#415](#415)) ([89e2fcc](89e2fcc)) * **api:** Included default workspace details in getSelf function ([#414](#414)) ([e67bbd6](e67bbd6)) * **platform:** Add loading skeleton in the [secure]s page ([#423](#423)) ([a97681e](a97681e)) * **schema:** Added a schema package ([01ea232](01ea232)) * **web:** Update about and careers page ([e167f53](e167f53)) ### 🐛 Bug Fixes * **api:** Error messages fixed in api-key service ([#418](#418)) ([edfbce0](edfbce0)) ### 📚 Documentation * Fixed minor typo in postman workspace link ([#411](#411)) ([ed23116](ed23116)) * Updated Postman links ([444bfb1](444bfb1)) ### 🔧 Miscellaneous Chores * **api:** Suppressed version check test in [secure] ([4688e8c](4688e8c)) * **api:** Update slug generation method ([#420](#420)) ([1f864df](1f864df)) ### 🔨 Code Refactoring * **API:** Refactor workspace-membership into a separate module ([#421](#421)) ([574170f](574170f)) * **platform:** added optional chaining due to strict null check ([#413](#413)) ([907e369](907e369))
🎉 This PR is included in version 2.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [2.5.0](keyshade-xyz/keyshade@v2.4.0...v2.5.0) (2024-09-16) ### 🚀 Features * **api-client:** Added workspace controller ([keyshade-xyz#427](keyshade-xyz#427)) ([2f4edec](keyshade-xyz@2f4edec)) * **api-client:** Added workspace role controller ([keyshade-xyz#430](keyshade-xyz#430)) ([b03ce8e](keyshade-xyz@b03ce8e)) * **api-client:** Synced with latest API ([27f4309](keyshade-xyz@27f4309)) * **api:** Add slug in entities ([keyshade-xyz#415](keyshade-xyz#415)) ([89e2fcc](keyshade-xyz@89e2fcc)) * **api:** Included default workspace details in getSelf function ([keyshade-xyz#414](keyshade-xyz#414)) ([e67bbd6](keyshade-xyz@e67bbd6)) * **platform:** Add loading skeleton in the [secure]s page ([keyshade-xyz#423](keyshade-xyz#423)) ([a97681e](keyshade-xyz@a97681e)) * **schema:** Added a schema package ([01ea232](keyshade-xyz@01ea232)) * **web:** Update about and careers page ([e167f53](keyshade-xyz@e167f53)) ### 🐛 Bug Fixes * **api:** Error messages fixed in api-key service ([keyshade-xyz#418](keyshade-xyz#418)) ([edfbce0](keyshade-xyz@edfbce0)) ### 📚 Documentation * Fixed minor typo in postman workspace link ([keyshade-xyz#411](keyshade-xyz#411)) ([ed23116](keyshade-xyz@ed23116)) * Updated Postman links ([444bfb1](keyshade-xyz@444bfb1)) ### 🔧 Miscellaneous Chores * **api:** Suppressed version check test in [secure] ([4688e8c](keyshade-xyz@4688e8c)) * **api:** Update slug generation method ([keyshade-xyz#420](keyshade-xyz#420)) ([1f864df](keyshade-xyz@1f864df)) ### 🔨 Code Refactoring * **API:** Refactor workspace-membership into a separate module ([keyshade-xyz#421](keyshade-xyz#421)) ([574170f](keyshade-xyz@574170f)) * **platform:** added optional chaining due to strict null check ([keyshade-xyz#413](keyshade-xyz#413)) ([907e369](keyshade-xyz@907e369))
User description
Description
This PR added a
slug
field to the following entities:The motivation behind this PR is very simple, to have user-friendly unique entity names rather than IDs. For example, If there is a workspace named
My Org
, it will have a slug value ofmy-org-4tm2
. The old way of accessing this resource would be using the following:The new way would be this:
So, we would be using:
Along with that, there are also a lot of refactorings in the E2E test files.
PR Type
enhancement, tests, documentation
Description
slug
field to multiple entities (Workspace, Workspace Role, Integration, Project, Environment, Variable, Secret) for user-friendly unique names.slug
instead ofid
, enhancing test coverage and organization.slug
usage.paginate
function for better documentation.Changes walkthrough 📝
6 files
workspace.e2e.spec.ts
Refactor workspace tests to use slugs and improve coverage
apps/api/src/workspace/workspace.e2e.spec.ts
slug
instead ofid
.slug
.organization.
integration.e2e.spec.ts
Refactor integration tests to use slugs and improve coverage
apps/api/src/integration/integration.e2e.spec.ts
slug
instead ofid
.slug
.organization.
project.e2e.spec.ts
Refactor E2E Tests to Use Slugs for Projects and Workspaces
apps/api/src/project/project.e2e.spec.ts
workspaceSlug
andprojectSlug
instead ofIDs.
secret.e2e.spec.ts
Refactor E2E Tests to Use Slugs for Secrets and Environments
apps/api/src/secret/secret.e2e.spec.ts
workspaceSlug
,projectSlug
, andenvironmentSlug
.workspace-role.e2e.spec.ts
Refactor workspace role tests to use slugs
apps/api/src/workspace-role/workspace-role.e2e.spec.ts
slug
instead ofid
for workspace roles.variable.e2e.spec.ts
Refactor variable tests to use slugs
apps/api/src/variable/variable.e2e.spec.ts
slug
instead ofid
for variables andprojects.
6 files
authority-checker.service.ts
Update authority checks to use slugs for entities
apps/api/src/common/authority-checker.service.ts
slug
instead ofid
.slug
usage.event.controller.ts
Update event controller to use workspace slugs
apps/api/src/event/controller/event.controller.ts
workspaceSlug
instead ofworkspaceId
.slug
usage.project.service.ts
Implement Slug-Based Operations and Refactor Project Service
apps/api/src/project/service/project.service.ts
and workspaces.
workspace.service.ts
Update workspace service to use slugs
apps/api/src/workspace/service/workspace.service.ts
id
withslug
for workspace operations.environment.service.ts
Update environment service to use slugs
apps/api/src/environment/service/environment.service.ts
id
withslug
for environment operations.create-workspace-role.ts
Update DTO to use project slugs
apps/api/src/workspace-role/dto/create-workspace-role/create-workspace-role.ts
projectIds
toprojectSlugs
in theCreateWorkspaceRole
DTO.1 files
paginate.ts
Add documentation to paginate function
apps/api/src/common/paginate.ts
paginate
function.paginate
function.47 files
environment.e2e.spec.ts
...
apps/api/src/environment/environment.e2e.spec.ts
...
event.e2e.spec.ts
...
apps/api/src/event/event.e2e.spec.ts
...
api-key.e2e.spec.ts
...
apps/api/src/api-key/api-key.e2e.spec.ts
...
secret.service.ts
...
apps/api/src/secret/service/secret.service.ts
...
variable.service.ts
...
apps/api/src/variable/service/variable.service.ts
...
integration.service.ts
...
apps/api/src/integration/service/integration.service.ts
...
workspace-role.service.ts
...
apps/api/src/workspace-role/service/workspace-role.service.ts
...
workspace.controller.ts
...
apps/api/src/workspace/controller/workspace.controller.ts
...
api-key.service.ts
...
apps/api/src/api-key/service/api-key.service.ts
...
slug-generator.ts
...
apps/api/src/common/slug-generator.ts
...
project.controller.ts
...
apps/api/src/project/controller/project.controller.ts
...
secret.controller.ts
...
apps/api/src/secret/controller/secret.controller.ts
...
variable.controller.ts
...
apps/api/src/variable/controller/variable.controller.ts
...
integration.controller.ts
...
apps/api/src/integration/controller/integration.controller.ts
...
util.ts
...
apps/api/src/common/util.ts
...
environment.controller.ts
...
apps/api/src/environment/controller/environment.controller.ts
...
workspace-role.controller.ts
...
apps/api/src/workspace-role/controller/workspace-role.controller.ts
...
environment.ts
...
apps/api/src/common/environment.ts
...
collective-authorities.ts
...
apps/api/src/common/collective-authorities.ts
...
event.service.ts
...
apps/api/src/event/service/event.service.ts
...
user.ts
...
apps/api/src/common/user.ts
...
change-notifier.socket.ts
...
apps/api/src/socket/change-notifier.socket.ts
...
cryptography.ts
...
apps/api/src/common/cryptography.ts
...
api-key.controller.ts
...
apps/api/src/api-key/controller/api-key.controller.ts
...
event.ts
...
apps/api/src/common/event.ts
...
cryptography.spec.ts
...
apps/api/src/common/cryptography.spec.ts
...
workspace.ts
...
apps/api/src/common/workspace.ts
...
util.spec.ts
...
apps/api/src/common/util.spec.ts
...
user.service.ts
...
apps/api/src/user/service/user.service.ts
...
auth.guard.ts
...
apps/api/src/auth/guard/auth/auth.guard.ts
...
user.controller.spec.ts
...
apps/api/src/user/controller/user.controller.spec.ts
...
query.transform.pipe.ts
...
apps/api/src/common/pipes/query.transform.pipe.ts
...
user.service.spec.ts
...
apps/api/src/user/service/user.service.spec.ts
...
feedback.e2e.spec.ts
...
apps/api/src/feedback/feedback.e2e.spec.ts
...
auth.service.ts
...
apps/api/src/auth/service/auth.service.ts
...
create.integration.ts
...
apps/api/src/integration/dto/create.integration/create.integration.ts
...
auth.controller.ts
...
apps/api/src/auth/controller/auth.controller.ts
...
main.ts
...
apps/api/src/main.ts
...
socket.types.ts
...
apps/api/src/socket/socket.types.ts
...
integration.types.ts
...
apps/api/src/integration/integration.types.ts
...
fork.project.ts
...
apps/api/src/project/dto/fork.project/fork.project.ts
...
query.transform.pipe.spec.ts
...
apps/api/src/common/pipes/query.transform.pipe.spec.ts
...
create.secret.ts
...
apps/api/src/secret/dto/create.secret/create.secret.ts
...
create.variable.ts
...
apps/api/src/variable/dto/create.variable/create.variable.ts
...
create.workspace.ts
...
apps/api/src/workspace/dto/create.workspace/create.workspace.ts
...
migration.sql
...
apps/api/src/prisma/migrations/20240908063241_add_slug/migration.sql
...
schema.prisma
...
apps/api/src/prisma/schema.prisma
...