Skip to content

ateapi: rename IPBlockRule to CIDRRule - #1597

Merged
Lior Lieberman (LiorLieberman) merged 2 commits into
agent-substrate:mainfrom
haiyanmeng:rename-ipblockrule
Sep 11, 2026
Merged

ateapi: rename IPBlockRule to CIDRRule#1597
Lior Lieberman (LiorLieberman) merged 2 commits into
agent-substrate:mainfrom
haiyanmeng:rename-ipblockrule

Conversation

@haiyanmeng

@haiyanmeng haiyanmeng commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

"Block" is a verb which could read as a deny rule.

Field renaming is safe because the postgreSQL stores the EgressPolicy in the binary protobuf format, which keys every field on its field number. The message name field name never appear on the wire.

Fixes #1586

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

name: "canonical IPv4 CIDR",
mutate: func(p *ateapipb.EgressPolicy) {
p.Rules[0] = &ateapipb.EgressRule{IpBlocks: &ateapipb.IPBlockRule{Cidrs: []string{"192.0.2.0/24"}}}
p.Rules[0] = &ateapipb.EgressRule{Cidrs: &ateapipb.CIDRRule{Cidrs: []string{"192.0.2.0/24"}}}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Now both EgressRule and CIDRRule has a field named cidrs, which seems a little duplicate.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

could do CIDRRange if we wanted a little less duplication, but it's purely subjective at this point. Up to you 🙂

@haiyanmeng haiyanmeng added area/network DO NOT MERGE This PR must not be merged yet. labels Sep 10, 2026
@haiyanmeng
haiyanmeng marked this pull request as draft September 10, 2026 21:52
@haiyanmeng
haiyanmeng marked this pull request as ready for review September 10, 2026 23:34
@bowei

Copy link
Copy Markdown
Collaborator

Looks ok to me. If someone has an even better name...

name: "canonical IPv4 CIDR",
mutate: func(p *ateapipb.EgressPolicy) {
p.Rules[0] = &ateapipb.EgressRule{IpBlocks: &ateapipb.IPBlockRule{Cidrs: []string{"192.0.2.0/24"}}}
p.Rules[0] = &ateapipb.EgressRule{Cidrs: &ateapipb.CIDRRule{Cidrs: []string{"192.0.2.0/24"}}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

could do CIDRRange if we wanted a little less duplication, but it's purely subjective at this point. Up to you 🙂

"Block" is a verb which could read as a deny rule.
@haiyanmeng haiyanmeng mentioned this pull request Sep 11, 2026
2 tasks
@haiyanmeng haiyanmeng removed the DO NOT MERGE This PR must not be merged yet. label Sep 11, 2026
The locust load tests embed the serialized file descriptor, so renaming
the message and its union field leaves the checked-in gencode describing
a field that no longer exists. Regenerated with the pinned grpcio-tools,
so only the descriptor and the offsets that follow it move.
@bowei

Copy link
Copy Markdown
Collaborator

LGTM there is a failure. Ping me when this passes.

@haiyanmeng

Copy link
Copy Markdown
Collaborator Author

Bowei Du (@bowei) , the tests are green now. It is ready to be merged. Thanks!

@LiorLieberman
Lior Lieberman (LiorLieberman) merged commit 5fb2c0a into agent-substrate:main Sep 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IPBlockRule is confusing

4 participants