Skip to content

Introduce aliases#13

Open
dborovcanin wants to merge 3 commits into
absmach:mainfrom
dborovcanin:alias
Open

Introduce aliases#13
dborovcanin wants to merge 3 commits into
absmach:mainfrom
dborovcanin:alias

Conversation

@dborovcanin

Copy link
Copy Markdown
Contributor

What type of PR is this?

This is a feature PR.

What does this do?

This pull request adds a concept of alias - user-friendly replacement for UUID.

Which issue(s) does this PR fix/relate to?

There is no such issue.

Have you included tests for your changes?

Yes.

Did you document any new/modified features?

Yes.

Notes

N/A

Signed-off-by: dusan <borovcanindusan1@gmail.com>
@arvindh123

Copy link
Copy Markdown
Contributor

@codex Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 14232be8b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


ALTER TABLE tenants
ADD CONSTRAINT chk_tenants_alias_slug
CHECK (alias IS NULL OR alias ~ '^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject UUID-shaped aliases in the DB constraint

This database-side validator still accepts UUID-shaped strings such as 465358f9-07f4-4ea0-8cbb-2abc654442bd, because they match the slug regex, while validate_alias() rejects them to keep alias and UUID addressing from colliding. On an upgrade where a legacy tenant route is UUID-shaped, or on any direct SQL/import path, the migration will preserve/accept an alias that the API would reject; add the UUID-shaped exclusion to the migration check and the table constraints.

Useful? React with 👍 / 👎.

Signed-off-by: dusan <borovcanindusan1@gmail.com>
Signed-off-by: dusan <borovcanindusan1@gmail.com>
@arvindh123

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 1dd870a043

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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