Skip to content
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

update deps #608

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

update deps #608

wants to merge 8 commits into from

Conversation

YassinEldeeb
Copy link
Member

@YassinEldeeb YassinEldeeb commented Oct 24, 2024

everything has been updated to the latest versions!

Breaking change

resource is no longer an acceptable field to the SpanContext in open telemetry reporting, and there's no other new fields in its place, I think maybe the service name could be added in another way? if not, I guess we could just keep being on the older otel dependencies' versions. (cc @dotansimha)

Copy link

github-actions bot commented Oct 24, 2024

🚨 Rust Panic Audit: 348 Potential Panic Points Detected 🚨

Crate: ``

📊 Total Usages: 243

  • 🎁 unwrap usages: 162
  • 🔢 array_index usages: 32
  • 🔎 expect usages: 41
  • 🚨 panic usages: 8

Crate: federation_query_planner

📊 Total Usages: 50

  • 🎁 unwrap usages: 29
  • 🚨 panic usages: 3
  • 🔎 expect usages: 8
  • 🔢 array_index usages: 10

Crate: conductor

📊 Total Usages: 11

  • 🔎 expect usages: 7
  • 🎁 unwrap usages: 2
  • 🚨 panic usages: 2

Crate: common

📊 Total Usages: 11

  • 🔢 array_index usages: 1
  • 🎁 unwrap usages: 10

Crate: telemetry

📊 Total Usages: 9

  • 🔢 array_index usages: 5
  • 🎁 unwrap usages: 4

Crate: cloudflare_worker

📊 Total Usages: 8

  • 🎁 unwrap usages: 5
  • 🚨 panic usages: 1
  • 🔎 expect usages: 2

Crate: engine

📊 Total Usages: 7

  • 🔎 expect usages: 1
  • 🎁 unwrap usages: 6

Crate: tracing

📊 Total Usages: 6

  • 🎁 unwrap usages: 5
  • 🔎 expect usages: 1

Crate: config

📊 Total Usages: 3

  • 🎁 unwrap usages: 2
  • 🚨 panic usages: 1

📌 Expected Annotations

Crate: cloudflare_worker

📊 Total Expected Usages: 4

expand details
  1. Reason: "it panics only if the header name is not valid, and we know it is."
  • Code: .unwrap()
  • Location: ./bin/cloudflare_worker/src/http_tracing.rs:20
  1. Reason: "it panics only if the URL source is not valid, and it's already validated before."
  • Code: let url = req.url().unwrap();
  • Location: ./bin/cloudflare_worker/src/http_tracing.rs:23
  1. Reason: "it only panics if we are not running in a CF context, should be safe."
  • Code: let cf_info = req.cf().unwrap();
  • Location: ./bin/cloudflare_worker/src/http_tracing.rs:27
  1. Reason: "unwraps only in special cases where "data:text" is used."
  • Code: let http_host = url.host().unwrap().to_string();
  • Location: ./bin/cloudflare_worker/src/http_tracing.rs:36

Crate: common

📊 Total Expected Usages: 1

expand details
  1. Reason: "we're parsing a statically defined constant, we know it works ;)"
  • Code: .unwrap()
  • Location: ./libs/common/src/graphql.rs:31

Crate: config

📊 Total Expected Usages: 9

expand details
  1. Reason: "part of development docgen CLI"
  • Code: .expect("Failed to serialize json schema for config file!");
  • Location: ./libs/config/src/generate-json-schema.rs:50
  1. Reason: "part of development docgen CLI"
  • Code: .expect("Failed to write the json schema to the file system!");
  • Location: ./libs/config/src/generate-json-schema.rs:54
  1. Reason: "👇"
  • Code: let raw_contents = read_to_string(file_path)
  • Location: ./libs/config/src/lib.rs:815
  1. Reason: "👇"
  • Code: panic!("Failed to interpolate config file, please resolve the above errors");
  • Location: ./libs/config/src/lib.rs:847
  1. Reason: "👇"
  • Code: parse_config_from_json(&config_string).expect("Failed to parse JSON config file")
  • Location: ./libs/config/src/lib.rs:854
  1. Reason: "👇"
  • Code: parse_config_from_yaml(&config_string).expect("Failed to parse YAML config file")
  • Location: ./libs/config/src/lib.rs:858
  1. Reason: "👇"
  • Code: _ => panic!("Unsupported config file extension"),
  • Location: ./libs/config/src/lib.rs:875
  1. Reason: "👇"
  • Code: None => panic!("Config file has no extension"),
  • Location: ./libs/config/src/lib.rs:878
  1. Reason: "statically defined regex pattern, we know it works ;)"
  • Code: .unwrap();
  • Location: ./libs/config/src/interpolate.rs:18

Crate: jwt_auth

📊 Total Expected Usages: 1

expand details
  1. Reason: "if initiating an http client fails, then we have to exit."
  • Code: let client = wasm_polyfills::create_http_client().build().unwrap();
  • Location: ./plugins/jwt_auth/src/jwks_provider.rs:49

Crate: ``

📊 Total Expected Usages: 22

expand details
  1. Reason: "if we are unable to construct the endpoints and attach them onto the gateway's http server, we have to exit"
  • Code: Err(e) => panic!("failed to construct endpoint: {:?}", e),
  • Location: ./libs/engine/src/gateway.rs:158
  1. Reason: "we can safely index here, it's inside a test with constant defined fixtures."
  • Code: ConductorGateway::execute(request, &gw.routes[0].route_data).await
  • Location: ./libs/engine/src/gateway.rs:190
  1. Reason: "we're parsing a statically defined constant, we know it works ;)"
  • Code: .unwrap()
  • Location: ./libs/common/src/graphql.rs:31
  1. Reason: "we need this"
  • Code: panic!("Exited process!")
  • Location: ./libs/napi/src/lib.rs:18
  1. Reason: "part of development docgen CLI"
  • Code: .expect("Failed to serialize json schema for config file!");
  • Location: ./libs/config/src/generate-json-schema.rs:50
  1. Reason: "part of development docgen CLI"
  • Code: .expect("Failed to write the json schema to the file system!");
  • Location: ./libs/config/src/generate-json-schema.rs:54
  1. Reason: "👇"
  • Code: let raw_contents = read_to_string(file_path)
  • Location: ./libs/config/src/lib.rs:815
  1. Reason: "👇"
  • Code: panic!("Failed to interpolate config file, please resolve the above errors");
  • Location: ./libs/config/src/lib.rs:847
  1. Reason: "👇"
  • Code: parse_config_from_json(&config_string).expect("Failed to parse JSON config file")
  • Location: ./libs/config/src/lib.rs:854
  1. Reason: "👇"
  • Code: parse_config_from_yaml(&config_string).expect("Failed to parse YAML config file")
  • Location: ./libs/config/src/lib.rs:858
  1. Reason: "👇"
  • Code: _ => panic!("Unsupported config file extension"),
  • Location: ./libs/config/src/lib.rs:875
  1. Reason: "👇"
  • Code: None => panic!("Config file has no extension"),
  • Location: ./libs/config/src/lib.rs:878
  1. Reason: "statically defined regex pattern, we know it works ;)"
  • Code: .unwrap();
  • Location: ./libs/config/src/interpolate.rs:18
  1. Reason: "we need to exit the process, if the logger can't be correctly set."
  • Code: let _guard = tracing::subscriber::set_default(subscriber);
  • Location: ./bin/conductor/src/lib.rs:64
  1. Reason: "we need to exit the process, if the provided configuration file is incorrect."
  • Code: panic!("Failed to initialize gateway: {:?}", e);
  • Location: ./bin/conductor/src/lib.rs:103
  1. Reason: "it panics only if the header name is not valid, and we know it is."
  • Code: .unwrap()
  • Location: ./bin/cloudflare_worker/src/http_tracing.rs:20
  1. Reason: "it panics only if the URL source is not valid, and it's already validated before."
  • Code: let url = req.url().unwrap();
  • Location: ./bin/cloudflare_worker/src/http_tracing.rs:23
  1. Reason: "it only panics if we are not running in a CF context, should be safe."
  • Code: let cf_info = req.cf().unwrap();
  • Location: ./bin/cloudflare_worker/src/http_tracing.rs:27
  1. Reason: "unwraps only in special cases where "data:text" is used."
  • Code: let http_host = url.host().unwrap().to_string();
  • Location: ./bin/cloudflare_worker/src/http_tracing.rs:36
  1. Reason: "if initiating an http client fails, then we have to exit."
  • Code: let client = wasm_polyfills::create_http_client().build().unwrap();
  • Location: ./plugins/jwt_auth/src/jwks_provider.rs:49
  1. Reason: "if the provided VRL code in the config file can't compile, we have to exit."
  • Code: panic!("failed to compile vrl program");
  • Location: ./plugins/vrl/src/plugin.rs:129
  1. Reason: "states is a non-user provided variable"
  • Code: .expect("can't merge states when states is an empty vector!")
  • Location: ./plugins/vrl/src/plugin.rs:146

Crate: napi

📊 Total Expected Usages: 1

expand details
  1. Reason: "we need this"
  • Code: panic!("Exited process!")
  • Location: ./libs/napi/src/lib.rs:18

Crate: engine

📊 Total Expected Usages: 2

expand details
  1. Reason: "if we are unable to construct the endpoints and attach them onto the gateway's http server, we have to exit"
  • Code: Err(e) => panic!("failed to construct endpoint: {:?}", e),
  • Location: ./libs/engine/src/gateway.rs:158
  1. Reason: "we can safely index here, it's inside a test with constant defined fixtures."
  • Code: ConductorGateway::execute(request, &gw.routes[0].route_data).await
  • Location: ./libs/engine/src/gateway.rs:190

Crate: conductor

📊 Total Expected Usages: 2

expand details
  1. Reason: "we need to exit the process, if the logger can't be correctly set."
  • Code: let _guard = tracing::subscriber::set_default(subscriber);
  • Location: ./bin/conductor/src/lib.rs:64
  1. Reason: "we need to exit the process, if the provided configuration file is incorrect."
  • Code: panic!("Failed to initialize gateway: {:?}", e);
  • Location: ./bin/conductor/src/lib.rs:103

Crate: vrl

📊 Total Expected Usages: 2

expand details
  1. Reason: "if the provided VRL code in the config file can't compile, we have to exit."
  • Code: panic!("failed to compile vrl program");
  • Location: ./plugins/vrl/src/plugin.rs:129
  1. Reason: "states is a non-user provided variable"
  • Code: .expect("can't merge states when states is an empty vector!")
  • Location: ./plugins/vrl/src/plugin.rs:146

@YassinEldeeb YassinEldeeb marked this pull request as draft October 24, 2024 01:28
Copy link

github-actions bot commented Oct 24, 2024

🐋 This PR was built and pushed to the following Docker images:

Docker Bake metadata
{
"conductor": {
  "buildx.build.provenance": {
    "buildType": "https://mobyproject.org/buildkit@v1",
    "materials": [
      {
        "uri": "pkg:docker/debian@12.5?platform=linux%2Famd64",
        "digest": {
          "sha256": "a92ed51e0996d8e9de041ca05ce623d2c491444df6a535a566dabd5cb8336946"
        }
      },
      {
        "uri": "pkg:docker/rust@1.77.2?platform=linux%2Famd64",
        "digest": {
          "sha256": "83101f6985c93e1e6501b3375de188ee3d2cbb89968bcc91611591f9f447bd42"
        }
      }
    ],
    "invocation": {
      "configSource": {
        "entryPoint": "Dockerfile"
      },
      "parameters": {
        "frontend": "dockerfile.v0",
        "args": {
          "label:org.opencontainers.image.authors": "The Guild <contact@the-guild.dev>",
          "label:org.opencontainers.image.description": "Conductor is a robust GraphQL Gateway.",
          "label:org.opencontainers.image.docs": "https://the-guild.dev/graphql/gateway",
          "label:org.opencontainers.image.licenses": "MIT",
          "label:org.opencontainers.image.revision": "04f90ec5254e7470d81482c505d043bd15b68055",
          "label:org.opencontainers.image.source": "https://github.com/the-guild-org/conductor",
          "label:org.opencontainers.image.title": "Conductor",
          "label:org.opencontainers.image.url": "https://the-guild.dev/graphql/gateway",
          "label:org.opencontainers.image.vendor": "The Guild",
          "label:org.opencontainers.image.version": ""
        },
        "locals": [
          {
            "name": "context"
          },
          {
            "name": "dockerfile"
          }
        ]
      },
      "environment": {
        "platform": "linux/amd64"
      }
    }
  },
  "buildx.build.ref": "builder-0cba8bd5-c222-480d-81ae-f4ea1fdc8a27/builder-0cba8bd5-c222-480d-81ae-f4ea1fdc8a270/5qlyapsldp5br1pv21gjzrto0",
  "containerimage.config.digest": "sha256:d1aa131d062037ddc88e597da0809630007740b026db73c914ea0678375ad48f",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
    "digest": "sha256:c9a303c253903b7aedb1065c1d51e984321d51209431c562ba438ec24e71c228",
    "size": 902,
    "platform": {
      "architecture": "amd64",
      "os": "linux"
    }
  },
  "containerimage.digest": "sha256:c9a303c253903b7aedb1065c1d51e984321d51209431c562ba438ec24e71c228",
  "image.name": "ghcr.io/the-guild-org/conductor/conductor:04f90ec5254e7470d81482c505d043bd15b68055"
}
}

Copy link

github-actions bot commented Oct 24, 2024

✅ Benchmark Results

     data_received..................: 13 MB   221 kB/s
     data_sent......................: 22 MB   363 kB/s
     http_req_blocked...............: min=1.06µs   avg=2.91µs   med=2.23µs   max=1.02ms   p(95)=3.27µs   p(99)=11.67µs 
     http_req_connecting............: min=0s       avg=322ns    med=0s       max=374.6µs  p(95)=0s       p(99)=0s      
     http_req_duration..............: min=320.67µs avg=409.94µs med=385.97µs max=13.5ms   p(95)=480.63µs p(99)=557.55µs
       { expected_response:true }...: min=320.67µs avg=409.94µs med=385.97µs max=13.5ms   p(95)=480.63µs p(99)=557.55µs
     ✓ { scenario:rps_1000 }........: min=320.67µs avg=409.94µs med=385.97µs max=13.5ms   p(95)=480.63µs p(99)=557.55µs
     http_req_failed................: 0.00%   ✓ 0          ✗ 60000
     ✓ { scenario:rps_1000 }........: 0.00%   ✓ 0          ✗ 60000
     http_req_receiving.............: min=10.22µs  avg=26.66µs  med=26.04µs  max=911.12µs p(95)=34.59µs  p(99)=47.23µs 
     http_req_sending...............: min=6.62µs   avg=15.14µs  med=14.13µs  max=1.72ms   p(95)=21.5µs   p(99)=30.83µs 
     http_req_tls_handshaking.......: min=0s       avg=0s       med=0s       max=0s       p(95)=0s       p(99)=0s      
     http_req_waiting...............: min=284.16µs avg=368.13µs med=344.62µs max=13.47ms  p(95)=438.69µs p(99)=512.13µs
     http_reqs......................: 60000   999.994392/s
     ✓ { scenario:rps_1000 }........: 60000   999.994392/s
     iteration_duration.............: min=394.81µs avg=499.13µs med=473.53µs max=13.75ms  p(95)=574.66µs p(99)=689.36µs
     iterations.....................: 60000   999.994392/s
     ✓ { scenario:rps_1000 }........: 60000   999.994392/s
     valid_graphql_response.........: 100.00% ✓ 60000      ✗ 0    
     ✓ { scenario:rps_1000 }........: 100.00% ✓ 60000      ✗ 0    
     valid_http_code................: 100.00% ✓ 60000      ✗ 0    
     ✓ { scenario:rps_1000 }........: 100.00% ✓ 60000      ✗ 0    
     vus............................: 0       min=0        max=2  
     vus_max........................: 200     min=200      max=200

@YassinEldeeb YassinEldeeb marked this pull request as ready for review October 27, 2024 02:51
@dotansimha
Copy link
Member

@YassinEldeeb I'm not sure why minitrace does not have this method. I can suggest 2 options for this PR:
1 - you can try to figure out how to migrate to the new version (api is limited, shouldn't be too complicated)
2 - keep the same version for the tracing lib and i can try to fix it later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants