Skip to content

Commit

Permalink
fix: update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed Apr 8, 2024
1 parent 3473646 commit bbda53c
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dispatch_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
name: Lookup Version
if: ${{ inputs.version-type == 'current' }}
secrets: inherit
uses: WalletConnect/ci_workflows/.github/workflows/release-get_deployed_version.yml@0.2.7
uses: WalletConnect/ci_workflows/.github/workflows/release-get_deployed_version.yml@fix/udeps-build
with:
task-name-stage: prod
task-name: ${{ vars.TASK_NAME }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dispatch_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ permissions:
jobs:
ci:
name: CI
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@0.2.7
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@fix/udeps-build
secrets: inherit
with:
check-infra: false
check-app: true

release:
name: Release
uses: WalletConnect/ci_workflows/.github/workflows/release.yml@0.2.7
uses: WalletConnect/ci_workflows/.github/workflows/release.yml@fix/udeps-build
secrets: inherit
with:
infra-changed: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dispatch_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ permissions:
jobs:
ci:
name: CI
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@0.2.7
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@fix/udeps-build
secrets: inherit
with:
check-infra: ${{ inputs.check-infra }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/event_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
ci:
name: CI
needs: [ paths-filter ]
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@0.2.7
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@fix/udeps-build
secrets: inherit
with:
check-app: ${{ needs.paths-filter.outputs.app == 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/event_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
release:
name: Release
needs: [ paths_filter ]
uses: WalletConnect/ci_workflows/.github/workflows/release.yml@0.2.7
uses: WalletConnect/ci_workflows/.github/workflows/release.yml@fix/udeps-build
secrets: inherit
with:
task-name: ${{ vars.TASK_NAME }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sub-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
cd-staging:
name: Staging
secrets: inherit
uses: WalletConnect/ci_workflows/.github/workflows/cd.yml@0.2.7
uses: WalletConnect/ci_workflows/.github/workflows/cd.yml@fix/udeps-build
with:
deploy-infra: ${{ inputs.deploy-infra }}
deploy-app: ${{ inputs.deploy-app && !inputs.deploy-infra }}
Expand All @@ -57,7 +57,7 @@ jobs:
needs: [ validate-staging ]
if: ${{ inputs.deploy-prod }}
secrets: inherit
uses: WalletConnect/ci_workflows/.github/workflows/cd.yml@0.2.7
uses: WalletConnect/ci_workflows/.github/workflows/cd.yml@fix/udeps-build
with:
deploy-infra: ${{ inputs.deploy-infra }}
deploy-app: ${{ inputs.deploy-app && !inputs.deploy-infra }}
Expand Down
28 changes: 16 additions & 12 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
edition = "2021"
fn_single_line = false
format_code_in_doc_comments = true
format_strings = true
imports_layout = "HorizontalVertical"
imports_granularity = "One"
normalize_comments = true
normalize_doc_attributes = true

reorder_imports = true
reorder_impl_items = true
group_imports = "StdExternalCrate"
use_try_shorthand = true
wrap_comments = true
overflow_delimited_expr = true
remove_nested_parens = true
reorder_modules = true
unstable_features = true
use_field_init_shorthand = true

## We only use settings available in the stable channel

#fn_single_line = false
#format_code_in_doc_comments = true
#format_strings = true
#imports_layout = "HorizontalVertical"
#imports_granularity = "One"
#normalize_comments = true
#normalize_doc_attributes = true
#reorder_impl_items = true
#group_imports = "StdExternalCrate"
#wrap_comments = true
#overflow_delimited_expr = true
#unstable_features = true
40 changes: 17 additions & 23 deletions src/event_sink/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,8 @@ use {
},
wc::{
analytics::{
AnalyticsExt,
ArcCollector,
AwsConfig,
AwsExporter,
BatchCollector,
BatchObserver,
CollectionObserver,
Collector,
CollectorConfig,
ExportObserver,
ParquetBatchFactory,
AnalyticsExt, ArcCollector, AwsConfig, AwsExporter, BatchCollector, BatchObserver,
CollectionObserver, Collector, CollectorConfig, ExportObserver, ParquetBatchFactory,
},
metrics::otel,
},
Expand Down Expand Up @@ -62,10 +53,11 @@ where
let size = res.as_deref().map(|data| data.len()).unwrap_or(0);
let elapsed = elapsed.as_millis() as u64;

wc::metrics::counter!("analytics_batches_finished", 1, &[
self.0.as_kv(),
success_kv(res.is_ok())
]);
wc::metrics::counter!(
"analytics_batches_finished",
1,
&[self.0.as_kv(), success_kv(res.is_ok())]
);

if let Err(err) = res {
tracing::warn!(
Expand All @@ -89,10 +81,11 @@ where
E: std::error::Error,
{
fn observe_collection(&self, res: &Result<(), E>) {
wc::metrics::counter!("analytics_records_collected", 1, &[
self.0.as_kv(),
success_kv(res.is_ok())
]);
wc::metrics::counter!(
"analytics_records_collected",
1,
&[self.0.as_kv(), success_kv(res.is_ok())]
);

if let Err(err) = res {
tracing::warn!(
Expand All @@ -109,10 +102,11 @@ where
E: std::error::Error,
{
fn observe_export(&self, elapsed: Duration, res: &Result<(), E>) {
wc::metrics::counter!("analytics_batches_exported", 1, &[
self.0.as_kv(),
success_kv(res.is_ok())
]);
wc::metrics::counter!(
"analytics_batches_exported",
1,
&[self.0.as_kv(), success_kv(res.is_ok())]
);

let elapsed = elapsed.as_millis() as u64;

Expand Down
7 changes: 1 addition & 6 deletions src/http_server/attestation.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
use {
super::{Command, RequestInfo, State},
crate::{
GetAttestation,
GetAttestationResult,
Handle,
IsScam,
SetAttestation,
SetAttestationResult,
GetAttestation, GetAttestationResult, Handle, IsScam, SetAttestation, SetAttestationResult,
},
axum::{
extract::{Json, Path},
Expand Down
19 changes: 4 additions & 15 deletions src/http_server/mod.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
use {
crate::{
ContextualCommand,
Domain,
GetAttestation,
GetAttestationResult,
GetVerifyStatus,
GetVerifyStatusError,
GetVerifyStatusResult,
Handle,
ProjectId,
SetAttestation,
SetAttestationResult,
VerifyStatus,
ContextualCommand, Domain, GetAttestation, GetAttestationResult, GetVerifyStatus,
GetVerifyStatusError, GetVerifyStatusResult, Handle, ProjectId, SetAttestation,
SetAttestationResult, VerifyStatus,
},
async_trait::async_trait,
axum::{
Expand All @@ -28,9 +19,7 @@ use {
hyper::{
header,
http::{HeaderName, HeaderValue},
HeaderMap,
Method,
StatusCode,
HeaderMap, Method, StatusCode,
},
serde::{Deserialize, Serialize},
std::{
Expand Down
8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ use {
wc::future::FutureExt as _,
};
pub use {
anyhow::Error,
async_trait::async_trait,
attestation_store::AttestationStore,
event_sink::EventSink,
project_registry::ProjectRegistry,
scam_guard::ScamGuard,
anyhow::Error, async_trait::async_trait, attestation_store::AttestationStore,
event_sink::EventSink, project_registry::ProjectRegistry, scam_guard::ScamGuard,
};

pub mod attestation_store;
Expand Down
6 changes: 1 addition & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ use {
project_registry::{self, CachedExt as _},
scam_guard,
util::redis,
GetAttestationHandled,
GetVerifyStatusHandled,
IsScam,
SetAttestationHandled,
VerifyStatus,
GetAttestationHandled, GetVerifyStatusHandled, IsScam, SetAttestationHandled, VerifyStatus,
},
build_info::VersionControl,
futures::{future::select, FutureExt},
Expand Down
4 changes: 1 addition & 3 deletions src/util/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use {
anyhow::Context as _,
deadpool_redis::{
redis::{AsyncCommands as _, FromRedisValue, ToRedisArgs},
Connection,
Pool,
Runtime,
Connection, Pool, Runtime,
},
metrics::counter,
tap::TapFallible,
Expand Down

0 comments on commit bbda53c

Please sign in to comment.