Skip to content

Commit 37027e3

Browse files
committed
[DOP-25451] Sync name length limits for all entities
1 parent 633f500 commit 37027e3

35 files changed

+317
-358
lines changed

docs/changelog/0.2.2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Breaking
66

77
- Use ``PUT /v1/qroups/:id`` instead of ``PATCH /v1/qroups/:id``.
88
- Use ``PUT /v1/queues/:id`` instead of ``PATCH /v1/queues/:id``.
9-
- Minimal queue name is 3 symbols instead of 1.
9+
- Now allowed names length should be in 3..128 symbols range, not 1..inf.
1010

1111
Improvements
1212
------------

syncmaster/db/migrations/versions/2023-11-23_0002_create_group_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def upgrade():
2222
op.create_table(
2323
"group",
2424
sa.Column("id", sa.BigInteger(), nullable=False),
25-
sa.Column("name", sa.String(length=256), nullable=False),
25+
sa.Column("name", sa.String(length=128), nullable=False),
2626
sa.Column("description", sa.String(length=512), nullable=False),
2727
sa.Column("owner_id", sa.BigInteger(), nullable=False),
2828
sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False),

syncmaster/db/models/group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def roles_at_least(cls, role: str | GroupMemberRole) -> list[str]:
7171

7272
class Group(Base, TimestampMixin):
7373
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
74-
name: Mapped[str] = mapped_column(String(256), nullable=False, unique=True)
74+
name: Mapped[str] = mapped_column(String(128), nullable=False, unique=True)
7575
description: Mapped[str] = mapped_column(String(512), nullable=False, default="")
7676
owner_id: Mapped[int] = mapped_column(ForeignKey("user.id", ondelete="CASCADE"), nullable=False, index=True)
7777

syncmaster/schemas/v1/connections/clickhouse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ReadClickhouseConnectionDataSchema(BaseModel):
2929

3030

3131
class CreateClickhouseConnectionSchema(CreateConnectionBaseSchema):
32-
type: CLICKHOUSE_TYPE = Field(..., description="Connection type")
32+
type: CLICKHOUSE_TYPE = Field(description="Connection type")
3333
data: CreateClickhouseConnectionDataSchema = Field(
3434
...,
3535
alias="connection_data",

syncmaster/schemas/v1/connections/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125

126126
class ConnectionCopySchema(BaseModel):
127127
new_group_id: int
128-
new_name: NameConstr | None = None # noqa: F722
128+
new_name: NameConstr | None = None
129129
remove_source: bool = False
130130

131131

syncmaster/schemas/v1/connections/connection_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111

1212
class CreateConnectionBaseSchema(BaseModel):
13-
group_id: int = Field(..., description="Connection owner group id")
14-
name: NameConstr = Field(..., description="Connection name") # noqa: F722
15-
description: str = Field(..., description="Additional description")
13+
group_id: int = Field(description="Connection owner group id")
14+
name: NameConstr = Field(description="Connection name")
15+
description: str = Field(description="Additional description")
1616

1717
model_config = ConfigDict(populate_by_name=True)
1818

syncmaster/schemas/v1/connections/ftp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ReadFTPConnectionDataSchema(BaseModel):
2626

2727

2828
class CreateFTPConnectionSchema(CreateConnectionBaseSchema):
29-
type: FTP_TYPE = Field(..., description="Connection type")
29+
type: FTP_TYPE = Field(description="Connection type")
3030
data: CreateFTPConnectionDataSchema = Field(
3131
...,
3232
alias="connection_data",

syncmaster/schemas/v1/connections/ftps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ReadFTPSConnectionDataSchema(BaseModel):
2626

2727

2828
class CreateFTPSConnectionSchema(CreateConnectionBaseSchema):
29-
type: FTPS_TYPE = Field(..., description="Connection type")
29+
type: FTPS_TYPE = Field(description="Connection type")
3030
data: CreateFTPSConnectionDataSchema = Field(
3131
...,
3232
alias="connection_data",

syncmaster/schemas/v1/connections/hdfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ReadHDFSConnectionDataSchema(BaseModel):
2424

2525

2626
class CreateHDFSConnectionSchema(CreateConnectionBaseSchema):
27-
type: HDFS_TYPE = Field(..., description="Connection type")
27+
type: HDFS_TYPE = Field(description="Connection type")
2828
data: CreateHDFSConnectionDataSchema = Field(
2929
...,
3030
alias="connection_data",

syncmaster/schemas/v1/connections/hive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ReadHiveConnectionDataSchema(BaseModel):
2424

2525

2626
class CreateHiveConnectionSchema(CreateConnectionBaseSchema):
27-
type: HIVE_TYPE = Field(..., description="Connection type")
27+
type: HIVE_TYPE = Field(description="Connection type")
2828
data: CreateHiveConnectionDataSchema = Field(
2929
...,
3030
alias="connection_data",

0 commit comments

Comments
 (0)