Skip to content

Separated check_name into org and schema functions#1328

Merged
andrewelamb merged 3 commits intodevelopfrom
fix_check_name
Feb 25, 2026
Merged

Separated check_name into org and schema functions#1328
andrewelamb merged 3 commits intodevelopfrom
fix_check_name

Conversation

@andrewelamb
Copy link
Contributor

@andrewelamb andrewelamb commented Feb 24, 2026

Problem:

In Synapse JSONSchema and Organizations have similar but different restrictions on their names. In the Synapse client, we are treating them as identical, and have one function _check_name for both.

Solution:

There are now two separate functions for testingJSON Schema and organization names.

@andrewelamb andrewelamb requested a review from a team as a code owner February 24, 2026 18:09
@andrewelamb andrewelamb marked this pull request as draft February 24, 2026 18:09
@andrewelamb andrewelamb marked this pull request as ready for review February 24, 2026 18:14
Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

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

🔥 LGTM, Ill leave it up to @linglp as final review.

@thomasyu888 thomasyu888 requested a review from linglp February 25, 2026 00:02
Copy link
Contributor

@linglp linglp left a comment

Choose a reason for hiding this comment

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

LGTM! Just two minor comments.

parts = name.split(".")
for part in parts:
if not re.match(r"^([A-Za-z])([A-Za-z]|\d|)*$", part):
raise ValueError(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think the error message here can be more descriptive:

raise ValueError(
    f"Invalid schema name '{name}'. Each part must start with a letter "
    f"and contain only letters and numbers. "
    f"Example: 'my.schema.name' or 'MySchema123'"
)

@linglp
Copy link
Contributor

linglp commented Feb 25, 2026

@andrewelamb could you take a look at the sonar cloud error?

@andrewelamb andrewelamb merged commit 5463edc into develop Feb 25, 2026
20 of 21 checks passed
@andrewelamb andrewelamb deleted the fix_check_name branch February 25, 2026 17:52
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.

3 participants