Skip to content

UUID v7#286

Open
anhnmt wants to merge 4 commits intomainfrom
uuid-v7
Open

UUID v7#286
anhnmt wants to merge 4 commits intomainfrom
uuid-v7

Conversation

@anhnmt
Copy link
Copy Markdown
Contributor

@anhnmt anhnmt commented Feb 27, 2026

No description provided.

Migrate all ID generation and handling to UUID v7 format for improved
timestamp-based ordering and better traceability. Updates DTOs, services,
and controllers across asset management, workflows, vulnerabilities,
tools, workers, and workspaces modules. Also updates package dependencies
and lock files to support UUID v7 implementation.
…guides

Several skill guide markdown files had minor text issues including:
- Extra apostrophes in bullet points like 'set `getWorkspaceId: true`'
- Stray unicode characters () appearing as replacement characters
- Inconsistent spacing around punctuation marks

These were found across api-development, bug-fixing, ci-cd-fix, console-ui,
refactoring, and testing skill guides.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant upgrade to how unique identifiers are generated and validated across the application by adopting UUID v7. The change moves away from randomly generated UUIDs to time-ordered ones, which can lead to performance benefits, especially in database operations. Alongside this core update, related validation rules and development guidelines have been adjusted to ensure consistency and proper usage of the new UUID standard. Additionally, several key dependencies have been updated to their latest versions.

Highlights

  • UUID v7 Adoption: Implemented UUID v7 across the codebase for generating unique identifiers, replacing the previous randomUUID from Node's crypto module and v4 from the uuid library. This change improves UUID generation by providing time-ordered identifiers, which can offer better database indexing performance and easier debugging due to their inherent sortability.
  • Validation Logic Update: Updated @IsUUID decorators in DTOs from specifying v4 to all, allowing for validation against any valid UUID version, accommodating the transition to UUID v7.
  • Dependency Updates: Updated ajv and class-validator dependencies to their latest versions, ensuring compatibility and leveraging the newest features and fixes.
  • Documentation Alignment: Updated internal skill documentation and API workflow guidelines to reflect the new standard of using UUID v7 for IDs in service tests and API definitions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .clinerules/skills/api-development/SKILL.md
    • Updated UUID generation guidance from v4+ to v7 for service tests.
    • Cleaned up minor formatting issues by removing extraneous characters.
  • .clinerules/skills/bug-fixing/SKILL.md
    • Cleaned up minor formatting issues by removing extraneous characters.
  • .clinerules/skills/ci-cd-fix/SKILL.md
    • Cleaned up minor formatting issues by removing extraneous characters.
  • .clinerules/skills/console-ui/SKILL.md
    • Cleaned up minor formatting issues by removing extraneous characters.
  • .clinerules/skills/refactoring/SKILL.md
    • Cleaned up minor formatting issues by removing extraneous characters.
  • .clinerules/skills/testing/SKILL.md
    • Cleaned up minor formatting issues by removing extraneous characters.
  • .clinerules/workflows/api.md
    • Updated UUID generation guidance from v4+ to v7 for service tests.
    • Updated example code snippets to use v7() for UUID generation.
  • bun.lock
    • Added configVersion entry.
    • Updated ajv dependency from 8.17.1 to 8.18.0.
    • Updated class-validator dependency from 0.14.3 to 0.15.1.
    • Added new nested ajv dependencies for various packages.
    • Removed peer: true flags from several dependency entries.
  • console/src/hooks/useStudioTemplate.ts
    • Replaced v4 UUID generation with v7.
  • core-api/package.json
    • Updated class-validator dependency from 0.14.3 to 0.15.1.
  • core-api/src/common/dtos/id-query-param.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/asset-group/asset-group.service.ts
    • Replaced randomUUID() with v7() for UUID generation.
  • core-api/src/modules/asset-group/dto/get-all-asset-groups-dto.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/assets/assets.service.ts
    • Replaced randomUUID() with v7() for UUID generation.
  • core-api/src/modules/assets/dto/assets.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/auth/auth.ts
    • Replaced randomUUID() with v7() for UUID generation.
  • core-api/src/modules/jobs-registry/jobs-registry.service.ts
    • Replaced randomUUID() with v7() for UUID generation.
  • core-api/src/modules/search/dto/search.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/storage/storage.controller.ts
    • Replaced randomUUID() with v7() for UUID generation.
  • core-api/src/modules/targets/dto/targets.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/tools/dto/run-tool.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/tools/tools-provider/built-in-tools.ts
    • Replaced randomUUID() with v7() for UUID generation.
  • core-api/src/modules/tools/tools.service.ts
    • Replaced randomUUID() with v7() for UUID generation.
  • core-api/src/modules/vulnerabilities/dto/get-vulnerability-severity.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/vulnerabilities/dto/get-vulnerability-statistics.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/vulnerabilities/dto/get-vulnerability.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/vulnerabilities/dto/scan.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/workers/dto/workers.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/workers/workers.service.ts
    • Replaced randomUUID() with v7() for UUID generation.
  • core-api/src/modules/workflows/dto/get-many-workflows.dto.ts
    • Updated @IsUUID validation from v4 to all.
  • core-api/src/modules/workspaces/workspaces.service.ts
    • Replaced randomUUID() with v7() for UUID generation.
  • package-lock.json
    • Updated class-validator dependency from 0.14.3 to 0.15.1.
    • Removed peer: true flags from numerous dependency entries.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully migrates the application from using UUIDv4 to UUIDv7 for new ID generation. The changes do not introduce any security vulnerabilities. The migration consistently replaces crypto.randomUUID() with uuid.v7() and updates validation using @IsUUID('all') to ensure backward compatibility with both existing v4 and new v7 UUIDs. Additionally, documentation has been updated, and class-validator dependencies are appropriate. This is a well-executed and beneficial migration that can improve database indexing performance for time-based queries.

l1ttps and others added 2 commits February 28, 2026 06:56
Updated bun.lock, core-api/package.json, and package-lock.json
to incorporate the necessary dependency changes for the UUID v7
migration across core API modules.
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.

2 participants