-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into TT-1550-Provide-PoC-for-keeping-test-conf…
…igs-in-git
- Loading branch information
Showing
76 changed files
with
1,032 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"chainlink": minor | ||
--- | ||
|
||
#internal Implement LatestHead for ChainService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"chainlink": minor | ||
--- | ||
|
||
#added Full Open Telemetry support, configurable via `Telemetry` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,16 @@ | ||
<!--- | ||
Does this work have a corresponding ticket? | ||
Please link your Jira ticket by including it in one of the following reference: | ||
<!--- Does this work have a corresponding ticket? Please link it here as well as one of: | ||
- the PR title | ||
- branch name | ||
- commit message | ||
By referencing it, it will let the QA team to know what to watch out for when creating a new release. | ||
Example: | ||
[LINK-777](https://smartcontract-it.atlassian.net/browse/LINK-777) | ||
[LINK-777](https://smartcontract-it.atlassian.net/browse/LINK-777) | ||
--> | ||
|
||
### Requires Dependencies | ||
<!--- | ||
Does this work depend on other open PRs? | ||
Please list other PRs that are blocking this PR. | ||
Example: | ||
- https://github.com/smartcontractkit/chainlink-common/pull/7777777 | ||
### Requires | ||
<!--- Does this work depend on other open PRs? Please list them. | ||
- https://github.com/smartcontractkit/chainlink-common/pull/7777777 | ||
--> | ||
|
||
### Resolves Dependencies | ||
<!--- | ||
Does this work support other open PRs? | ||
Please list other PRs that are waiting for this PR to be merged. | ||
Example: | ||
- https://github.com/smartcontractkit/ccip/pull/7777777 | ||
### Resolves | ||
<!--- Does this work support other open PRs? Please list them. | ||
- https://github.com/smartcontractkit/ccip/pull/7777777 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { | ||
AxiosRequestConfig, | ||
AxiosResponse, | ||
AxiosError, | ||
InternalAxiosRequestConfig, | ||
} from "axios"; | ||
import { Readable } from "stream"; | ||
|
||
interface AxiosErrorFormat<Data = any> { | ||
config: Pick<AxiosRequestConfig, (typeof CONFIG_KEYS)[number]>; | ||
code?: string; | ||
response: Partial<Pick<AxiosResponse<Data>, (typeof RESPONSE_KEYS)[number]>>; | ||
isAxiosError: boolean; | ||
} | ||
|
||
interface AxiosErrorFormatError<Data = any> | ||
extends Error, | ||
AxiosErrorFormat<Data> {} | ||
|
||
export function formatAxiosError<Data = any>( | ||
origErr: AxiosError<Data> | ||
): AxiosErrorFormatError<Data> { | ||
const { message, name, stack, code, config, response, isAxiosError } = | ||
origErr; | ||
|
||
const err: AxiosErrorFormatError = { | ||
...new Error(message), | ||
name, | ||
stack, | ||
code, | ||
isAxiosError, | ||
config: {}, | ||
response: {}, | ||
}; | ||
|
||
for (const k of CONFIG_KEYS) { | ||
if (config?.[k] === undefined) { | ||
continue; | ||
} | ||
|
||
err.config[k] = formatValue(config[k], k); | ||
} | ||
|
||
for (const k of RESPONSE_KEYS) { | ||
if (response?.[k] === undefined) { | ||
continue; | ||
} | ||
|
||
err.response[k] = formatValue(response[k], k); | ||
} | ||
|
||
return err as any; | ||
} | ||
|
||
const CONFIG_KEYS: (keyof InternalAxiosRequestConfig)[] = [ | ||
"url", | ||
"method", | ||
"baseURL", | ||
"params", | ||
"data", | ||
"timeout", | ||
"timeoutErrorMessage", | ||
"withCredentials", | ||
"auth", | ||
"responseType", | ||
"xsrfCookieName", | ||
"xsrfHeaderName", | ||
"maxContentLength", | ||
"maxBodyLength", | ||
"maxRedirects", | ||
"socketPath", | ||
"proxy", | ||
"decompress", | ||
] as const; | ||
|
||
const RESPONSE_KEYS: (keyof AxiosResponse)[] = [ | ||
"data", | ||
"status", | ||
"statusText", | ||
] as const; | ||
|
||
function formatValue( | ||
value: any, | ||
key: (typeof CONFIG_KEYS)[number] | (typeof RESPONSE_KEYS)[number] | ||
): any { | ||
if (key !== "data") { | ||
return value; | ||
} | ||
|
||
if (process.env.BROWSER !== "true") { | ||
if (value instanceof Readable) { | ||
return "[Readable]"; | ||
} | ||
} | ||
|
||
return value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package webapi | ||
|
||
import ( | ||
"github.com/smartcontractkit/chainlink-common/pkg/types/core" | ||
"github.com/smartcontractkit/chainlink/v2/core/logger" | ||
"github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" | ||
"github.com/smartcontractkit/chainlink/v2/core/services/job" | ||
) | ||
|
||
func NewTrigger(config string, registry core.CapabilitiesRegistry, connector connector.GatewayConnector, lggr logger.Logger) (job.ServiceCtx, error) { | ||
// TODO (CAPPL-22, CAPPL-24): | ||
// - decode config | ||
// - create an implementation of the capability API and add it to the Registry | ||
// - create a handler and register it with Gateway Connector | ||
// - manage trigger subscriptions | ||
// - process incoming trigger events and related metadata | ||
return nil, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.