Skip to content

Commit

Permalink
fix: add trailing commas to Starlark code (#218)
Browse files Browse the repository at this point in the history
## Description:
<!-- Describe this change, how it works, and the motivation behind it.
-->

## Is this change user facing?
<!-- A user facing change is one that you should expect a day-to-day
user to encounter or if the change requires user-action upon or before
upgrading. If in doubt, select "Yes" -->
* [ ] Yes
* [x] No

<!-- If yes, please add the  label to this Pull Request -->

## References (if applicable):
<!-- Add relevant Github Issues, Discord threads, or other helpful
information. -->

Changelog picked up from commits here:

docs: missed one comma
fix: add trailing commas to starlark code

---------

Co-authored-by: preetrawal <preetrawal@preetrawals-MacBook-Pro.local>
Co-authored-by: Derek Lee <derek@Dereks-MacBook-Pro.local>
Co-authored-by: Derek Lee <103802618+leeederek@users.noreply.github.com>
  • Loading branch information
4 people committed Mar 16, 2023
1 parent 68dd6ea commit 1bd050c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions docs/docs/reference/starlark-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ all_services = plan.add_services(
configs = {
"example-datastore-server-1": datastore_server_config_1,
"example-datastore-server-2": datastore_server_config_2,
}
},
)
```

Expand Down Expand Up @@ -398,7 +398,7 @@ The instruction returns a response, which is a `dict` with following key-value p
post_request_recipe = PostHttpRequestRecipe(
...
extract = {
"second-element-from-list-head": '.result.foo | .[0] | split ("/") | .[1]' #
"second-element-from-list-head": '.result.foo | .[0] | split ("/") | .[1]',
},
)
response = plan.request(
Expand Down Expand Up @@ -469,13 +469,13 @@ Say we are overriding a connection between two subnetworks, as shown below:

connection_config = ConnectionConfig(
packet_delay_distribution = UniformPacketDelayDistribution(
ms = 500
)
ms = 500,
),
)

set_connection(
subnetworks = ("subnetworkA", "subnetworkB"),
config = connection_config
config = connection_config,
)

```
Expand Down
32 changes: 16 additions & 16 deletions docs/docs/reference/starlark-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ connection_config = ConnectionConfig(
# OPTIONAL: Valid value are UniformPacketDelayDistribution or NormalPacketDelayDistribution
packet_delay_distribution = UniformPacketDelayDistribution(
# Delay in ms
ms = 500
)
ms = 500,
),
)
```

Expand Down Expand Up @@ -84,8 +84,8 @@ get_request_recipe = GetHttpRequestRecipe(
# To lean more about jq, please visit https://devdocs.io/jq/
# OPTIONAL
extract = {
"extractfield" : ".name.id"
}
"extractfield" : ".name.id",
},
)
```

Expand All @@ -97,9 +97,9 @@ Important - `port_id` field accepts user defined ID assinged to a port in servic
ports = {
// "port_id": port_number
"http": 5000,
"grpc": 3000
"grpc": 3000,
...
}
},
...
)
```
Expand All @@ -110,7 +110,7 @@ The user defined port IDs in above port map are: `http` and `grpc`. These can be
recipe = GetHttpRequestRecipe(
port_id = "http",
service_name = "service-using-test-service-config",
endpoint = "/ping"
endpoint = "/ping",
...
)
```
Expand Down Expand Up @@ -153,8 +153,8 @@ post_request_recipe = PostHttpRequestRecipe(
# # To lean more about jq, please visit https://devdocs.io/jq/
# OPTIONAL
extract = {
"extractfield" : ".name.id"
}
"extractfield" : ".name.id",
},
)
```

Expand All @@ -178,7 +178,7 @@ delay = UniformPacketDelayDistribution(
# Non-Negative Integer
# Amount of constant delay added to outgoing packets from the subnetwork
# MANDATORY
ms = 1000
ms = 1000,
)
```

Expand All @@ -192,19 +192,19 @@ delay = NormalPacketDelayDistribution(
# Non-Negative Integer
# Amount of mean delay added to outgoing packets from the subnetwork
# MANDATORY
mean_ms = 1000
mean_ms = 1000,

# Non-Negative Integer
# Amount of variance (jitter) added to outgoing packets from the subnetwork
# MANDATORY
std_dev_ms = 10
std_dev_ms = 10,

# Non-Negative Float
# Percentage of correlation observed among packets. It means that the delay observed in next packet
# will exhibit a corrlation factor of 10.0% with the previous packet.
# OPTIONAL
# DEFAULT = 0.0
correlation = 10.0
correlation = 10.0,
)
```

Expand All @@ -224,7 +224,7 @@ port_spec = PortSpec(

# Application protocol for the port
# Optional
application_protocol = "http"
application_protocol = "http",
)
```
The above constructor returns a `PortSpec` object that contains port information in the form of a [future reference][future-references-reference] and can be used with
Expand Down Expand Up @@ -255,7 +255,7 @@ config = ServiceConfig(

# Application protocol for the port
# Optional
application_protocol = "http"
application_protocol = "http",
),
},

Expand Down Expand Up @@ -324,7 +324,7 @@ update_service_config = UpdateServiceConfig(
# The subnetwork to which the service will be moved.
# "default" can be used to move the service to the default subnetwork
# MANDATORY
subnetwork = "subnetwork_1"
subnetwork = "subnetwork_1",
)
```

Expand Down

0 comments on commit 1bd050c

Please sign in to comment.