-
Notifications
You must be signed in to change notification settings - Fork 745
[tmpnet] Switch FlagsMap from map[string]any to map[string]string #3884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1e37c28
to
2849541
Compare
11caceb
to
3661417
Compare
e67f6e8
to
cfe0814
Compare
3661417
to
36f1837
Compare
cfe0814
to
bbe84a2
Compare
cb924af
to
e450a64
Compare
`map[string]any` complicates comparison of values converted to strings (e.g. when node configuration is provided as env vars to a kube pod) to their original golang form. Switching `FlagsMap` to use `map[string]string` forces the decision of how to serialize on the developer to ensure that all subsequent usage will be consistent. This change also updates chain and monitor configuration to stop using FlagsMap in favor of locally-appropriate maps.
24d75ae
to
53de819
Compare
53de819
to
125ca3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR changes the FlagsMap type from map[string]any to map[string]string to enforce consistent string serialization for configuration values. Key changes include replacing FlagsMap with ConfigMap in subnet, process runtime, node, and network components, updating the related helper functions and tests, and revising the handling of boolean and duration values.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tests/fixture/tmpnet/subnet.go | Replaces FlagsMap with ConfigMap for subnet configuration |
tests/fixture/tmpnet/process_runtime.go | Updates monitoring configuration to use ConfigMap and uses maps.Copy |
tests/fixture/tmpnet/node.go | Modifies flag retrieval by removing type conversion helper methods |
tests/fixture/tmpnet/network.go | Updates network configuration and sybil protection flag handling |
tests/fixture/tmpnet/flagsmap.go | Changes FlagsMap from map[string]interface{} to map[string]string |
tests/fixture/tmpnet/defaults.go | Converts boolean and duration flag values to string representations |
tests/fixture/tmpnet/check_monitoring.go | Updates label retrieval to use the new ConfigMap style |
tests/fixture/subnet/xsvm.go | Revises subnet configuration to use ConfigMap |
tests/e2e/p/staking_rewards.go & others | Adjusts test assertions to compare against string representations |
tests/antithesis/compose.go | Modifies compose project construction to remove redundant type checks |
Comments suppressed due to low confidence (2)
tests/fixture/tmpnet/process_runtime.go:290
- The use of maps.Copy on line 291 relies on Go 1.21+ features; please confirm that the project’s minimum Go version supports this function to avoid runtime issues.
promtailLabels := map[string]string{}
tests/antithesis/compose.go:134
- [nitpick] Since the function signature was changed to remove error returns, please ensure that all failure cases are properly handled upstream, or add a clarifying comment if any errors are now impossible.
func newComposeProject(network *tmpnet.Network, nodeImageName string, workloadImageName string) *types.Project {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
PR Chain: tmpnet+kube
This PR chain enables tmpnet to deploy temporary networks to Kubernetes. Early PRs refactor tmpnet to support the addition in #3615 of a new tmpnet node runtime for kube.
Why this should be merged
map[string]any
complicates comparison of values converted to strings (e.g. when node configuration is provided as env vars to a kube pod) to their original golang form. SwitchingFlagsMap
to usemap[string]string
forces the decision of how to serialize on the developer to ensure that all subsequent usage will be consistent.This change also updates subnet, chain and monitor configuration to stop using
FlagsMap
since their use-cases still requiremap[string]any
.How this was tested
CI
Need to be documented in RELEASES.md?
N/A
TODO