-
Notifications
You must be signed in to change notification settings - Fork 32
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
add refunder to opbot #2838
add refunder to opbot #2838
Changes from 2 commits
b967398
544967f
a65c2bc
d14682e
b62cb02
97b4106
7a71c2d
3217f20
f6af4df
5f0b232
e28b400
dd73de3
2eba05a
07afb2a
7e5114b
27b8159
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,13 @@ const ( | |
func (b *Bot) tracingMiddleware() slacker.CommandMiddlewareHandler { | ||
return func(next slacker.CommandHandler) slacker.CommandHandler { | ||
return func(cmdCtx *slacker.CommandContext) { | ||
// TODO: context is not inherited here. | ||
_, span := b.handler.Tracer().Start(cmdCtx.Context(), fmt.Sprintf("command.%s", cmdCtx.Definition().Command), trace.WithAttributes( | ||
ctx, span := b.handler.Tracer().Start(cmdCtx.Context(), fmt.Sprintf("command.%s", cmdCtx.Definition().Command), trace.WithAttributes( | ||
attribute.String("user_id", cmdCtx.Event().UserID), | ||
attribute.String("channel_id", cmdCtx.Event().Channel.ID), | ||
)) | ||
|
||
cmdCtx.WithContext(ctx) | ||
|
||
Comment on lines
+29
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Add tests for new functionality. The
Analysis chainAdd tests for new functionality. The new functionality added to the
Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify test coverage for new functionality in `tracingMiddleware`.
# Test: Search for test cases covering the `tracingMiddleware` method. Expect: Test cases covering all new functionality.
rg --type go 'tracingMiddleware'
Length of output: 233 Script: #!/bin/bash
# Description: Verify if there are tests covering the `tracingMiddleware` method.
# Find all Go test files in the repository
test_files=$(fd --type f --extension go --glob '*_test.go')
# Search for test cases covering the `tracingMiddleware` method in the test files
for file in $test_files; do
echo "Checking $file"
rg 'tracingMiddleware' "$file"
done
Length of output: 75047 ToolsGitHub Check: codecov/patch
|
||
defer func() { | ||
metrics.EndSpan(span) | ||
}() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
--- | ||
id: get-contract-addresses | ||
title: "Get contract addresses" | ||
description: "get quotes from all relayers." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📚 spelling: The description 'get quotes from all relayers.' seems incorrect for this endpoint. It should describe getting contract addresses. |
||
sidebar_label: "Get contract addresses" | ||
hide_title: true | ||
hide_table_of_contents: true | ||
api: eJyFUrtuwzAM/BWBs9EEHbMVRZGhQzu0U5CBkZlYqWwpEh3UMPzvJe2keXToZD5OR97RPZSUbXKRXWhgATtic2gDUzbbFGqD3ptEHjtK+QEKSJRjaDJlWPTwOJ/r55bh7VVgNjRMDWsXY/TOonZn+6yQHrKtqEaNHFM9csUUIiV2E7O+T2h5TLAsnT5H/34D4i6SDMycXLODobhb5PnMYVw2aGqMJmyNrdA1xpWGgzlPMTJBhGVZ/MQZNnuyDMPwp/JbwJSwE8QwgnAnK61gsg7WBdTEVSgnR4U3IleSzC7CCnDNNpzFSklCZXLslV76R/F8kqJjY8hc42hfg7VClnKrewmkxDc+9Jdj/HvdkzSmb55FL0bp4Db58UCjgtXVaURlJUtpse83mOkz+WHQ8qGl1EldwiMmhxuVtFoLWUVYUpKkhy8SCDxZS1EdOqJvR1/v/5fh2s3ly4d4/gO22+/e | ||
sidebar_class_name: "get api-method" | ||
custom_edit_url: null | ||
--- | ||
|
||
import ApiTabs from "@theme/ApiTabs"; | ||
import DiscriminatorTabs from "@theme/DiscriminatorTabs"; | ||
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; | ||
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes"; | ||
import MimeTabs from "@theme/MimeTabs"; | ||
import ParamsItem from "@theme/ParamsItem"; | ||
import ResponseSamples from "@theme/ResponseSamples"; | ||
import SchemaItem from "@theme/SchemaItem"; | ||
import SchemaTabs from "@theme/SchemaTabs"; | ||
import Markdown from "@theme/Markdown"; | ||
import Heading from "@theme/Heading"; | ||
import OperationTabs from "@theme/OperationTabs"; | ||
import TabItem from "@theme/TabItem"; | ||
|
||
<Heading | ||
as={"h1"} | ||
className={"openapi__heading"} | ||
children={"Get contract addresses"} | ||
> | ||
</Heading> | ||
|
||
<MethodEndpoint | ||
method={"get"} | ||
path={"/contracts"} | ||
> | ||
|
||
</MethodEndpoint> | ||
|
||
|
||
|
||
get quotes from all relayers. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📚 spelling: This line appears to be a leftover from a copy-paste. It should be removed or corrected to describe the 'get contract addresses' functionality. |
||
|
||
<div> | ||
<div> | ||
<ApiTabs | ||
label={undefined} | ||
id={undefined} | ||
> | ||
<TabItem | ||
label={"200"} | ||
value={"200"} | ||
> | ||
<div> | ||
|
||
|
||
OK | ||
|
||
|
||
</div><div> | ||
<MimeTabs | ||
className={"openapi-tabs__mime"} | ||
schemaType={"response"} | ||
> | ||
<TabItem | ||
label={"application/json"} | ||
value={"application/json"} | ||
> | ||
<SchemaTabs | ||
className={"openapi-tabs__schema"} | ||
> | ||
<TabItem | ||
label={"Schema"} | ||
value={"Schema"} | ||
> | ||
<details | ||
style={{}} | ||
className={"openapi-markdown__details response"} | ||
data-collapsed={false} | ||
open={true} | ||
> | ||
<summary | ||
style={{}} | ||
className={"openapi-markdown__details-summary-response"} | ||
> | ||
<strong> | ||
Schema | ||
</strong> | ||
</summary><div | ||
style={{"textAlign":"left","marginLeft":"1rem"}} | ||
> | ||
|
||
</div><ul | ||
style={{"marginLeft":"1rem"}} | ||
> | ||
<li> | ||
<div | ||
style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}} | ||
> | ||
Array [ | ||
</div> | ||
</li><SchemaItem | ||
collapsible={true} | ||
className={"schemaItem"} | ||
> | ||
<details | ||
style={{}} | ||
className={"openapi-markdown__details"} | ||
> | ||
<summary | ||
style={{}} | ||
> | ||
<span | ||
className={"openapi-schema__container"} | ||
> | ||
<strong | ||
className={"openapi-schema__property"} | ||
> | ||
contracts | ||
</strong><span | ||
className={"openapi-schema__name"} | ||
> | ||
object | ||
</span> | ||
</span> | ||
</summary><div | ||
style={{"marginLeft":"1rem"}} | ||
> | ||
<div | ||
style={{"marginTop":".5rem","marginBottom":".5rem"}} | ||
> | ||
|
||
|
||
Contracts is a map of chain id to contract address | ||
|
||
|
||
</div><SchemaItem | ||
name={"property name*"} | ||
required={false} | ||
schemaName={"string"} | ||
qualifierMessage={undefined} | ||
schema={{"type":"string"}} | ||
collapsible={false} | ||
discriminator={false} | ||
> | ||
|
||
</SchemaItem> | ||
</div> | ||
</details> | ||
</SchemaItem><li> | ||
<div | ||
style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}} | ||
> | ||
] | ||
</div> | ||
</li> | ||
</ul> | ||
</details> | ||
</TabItem><TabItem | ||
label={"Example (from schema)"} | ||
value={"Example (from schema)"} | ||
> | ||
<ResponseSamples | ||
responseExample={"[\n {\n \"contracts\": {}\n }\n]"} | ||
language={"json"} | ||
> | ||
|
||
</ResponseSamples> | ||
</TabItem> | ||
</SchemaTabs> | ||
</TabItem> | ||
</MimeTabs> | ||
</div> | ||
</TabItem> | ||
</ApiTabs> | ||
</div> | ||
</div> | ||
|
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.
Tip
Codebase Verification
Add tests for new functionality.
The new functionality added to the
tracingMiddleware
method is not covered by tests. Ensure that tests are added to cover:Context inheritance using
ctx
.Span creation with appropriate attributes.
contrib/opbot/botmd/middleware.go
Analysis chain
Add tests for new functionality.
The new functionality added to the
tracingMiddleware
method is not covered by tests. Ensure that tests are added to cover:ctx
.Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 233
Script:
Length of output: 333
Script:
Length of output: 25161
Tools
GitHub Check: codecov/patch