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

Added expose_query_plan to federation source #341

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Conversation

dotansimha
Copy link
Member

closes #322

Copy link

🚨 Rust Panic Audit: 108 Potential Panic Points Detected 🚨

Crate: federation_query_planner

📊 Total Usages: 50

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

Crate: jwt_auth

📊 Total Usages: 45

  • 🔢 array_index usages: 2
  • 🎁 unwrap usages: 43

📌 Expected Annotations

  •     let client = wasm_polyfills::create_http_client().build().unwrap();: // @expected: if initiating an http client fails, then we have to exit.
    

Crate: engine

📊 Total Usages: 10

  • 🎁 unwrap usages: 6
  • 🚨 panic usages: 3
  • 🔎 expect usages: 1

📌 Expected Annotations

  •         Err(e) => panic!("failed to construct endpoint: {:?}", e),: // @expected: if we are unable to construct the endpoints and attach them onto the gateway's http server, we have to exit
    
  • ConductorGateway::execute(request, &gw.routes[0].route_data).await: // @expected: we can safely index here, it's inside a test with constant defined fixtures.
    
  •     panic!(: // @expected: without a fetcher, there's no executor, without an executor, there's no gateway.
    

Crate: vrl

📊 Total Usages: 3

  • 🔢 array_index usages: 3

📌 Expected Annotations

  •     panic!("failed to compile vrl program");: // @expected: if the provided VRL code in the config file can't compile, we have to exit.
    
  •   .expect("can't merge states when `states` is an empty vector!"): // @expected: `states` is a non-user provided variable
    

Crate: http_get

📊 Total Usages: 0

Crate: cors

📊 Total Usages: 0

Crate: match_content_type

📊 Total Usages: 0

Crate: graphiql

📊 Total Usages: 0

Crate: cloudflare_worker

📊 Total Usages: 0

Crate: wasm_polyfills

📊 Total Usages: 0

Crate: conductor

📊 Total Usages: 0

📌 Expected Annotations

  • tracing::subscriber::set_global_default(subscriber).expect("failed to set up the logger");: // @expected: we need to exit the process, if the logger can't be correctly set.
  •   .expect("Failed to modify the log level");: // @expected: we need to exit, if the provided log level in the configuration file is incompaitable.
    
  •   panic!("Failed to initialize gateway: {:?}", e);: // @expected: we need to exit the process, if the provided configuration file is incorrect.
    

Crate: trusted_documents

📊 Total Usages: 0

Crate: test-server

📊 Total Usages: 0

Crate: config

📊 Total Usages: 0

📌 Expected Annotations

  • .unwrap();: // @expected: statically defined regex pattern, we know it works ;)
  • let raw_contents = read_to_string(file_path).expect("Failed to read config file");: // @expected: 👇
  •   panic!("Failed to interpolate config file, please resolve the above errors");: // @expected: 👇
    
  •   parse_config_from_json(&config_string).expect("Failed to parse JSON config file"): // @expected: 👇
    
  •   parse_config_from_yaml(&config_string).expect("Failed to parse YAML config file"): // @expected: 👇
    
  •     _ => panic!("Unsupported config file extension"),: // @expected: 👇
    
  •   None => panic!("Config file has no extension"),: // @expected: 👇
    
  • .expect("Failed to serialize json schema for config file!");: // @expected: part of development docgen CLI
    
  • .expect("Failed to write the json schema to the file system!");: // @expected: part of development docgen CLI
    

Crate: napi

📊 Total Usages: 0

📌 Expected Annotations

  • panic!("Exited process!"): // @expected: we need this

Crate: disable_introspection

📊 Total Usages: 0

📌 Expected Annotations

  •       panic!("failed to compile vrl program for disable_introspection plugin");: // @expected: we need to exit the process if our provided VRL condition has incorrect syntax.
    

Crate: common

📊 Total Usages: 0

📌 Expected Annotations

  • .unwrap(): // @expected: we're parsing a statically defined constant, we know it works ;)
    

Copy link

💻 Website Preview

The latest changes are available as preview in: https://85dbdc7e.conductor-t2.pages.dev

Copy link

✅ Benchmark Results

     data_received..................: 13 MB   221 kB/s
     data_sent......................: 22 MB   363 kB/s
     http_req_blocked...............: min=992ns    avg=2.9µs    med=2.22µs   max=874.65µs p(95)=3.16µs  p(99)=6.01µs 
     http_req_connecting............: min=0s       avg=395ns    med=0s       max=824.04µs p(95)=0s      p(99)=0s     
     http_req_duration..............: min=767.34µs avg=1ms      med=912.76µs max=48.26ms  p(95)=1.29ms  p(99)=1.74ms 
       { expected_response:true }...: min=767.34µs avg=1ms      med=912.76µs max=48.26ms  p(95)=1.29ms  p(99)=1.74ms 
     ✓ { scenario:rps_1000 }........: min=767.34µs avg=1ms      med=912.76µs max=48.26ms  p(95)=1.29ms  p(99)=1.74ms 
     http_req_failed................: 0.00%   ✓ 0          ✗ 59999
     ✓ { scenario:rps_1000 }........: 0.00%   ✓ 0          ✗ 59999
     http_req_receiving.............: min=9.59µs   avg=29.19µs  med=27.53µs  max=760.66µs p(95)=45.47µs p(99)=56.72µs
     http_req_sending...............: min=6.77µs   avg=15.58µs  med=13.47µs  max=1.47ms   p(95)=28.77µs p(99)=38µs   
     http_req_tls_handshaking.......: min=0s       avg=0s       med=0s       max=0s       p(95)=0s      p(99)=0s     
     http_req_waiting...............: min=731.41µs avg=958.41µs med=867.38µs max=48.2ms   p(95)=1.24ms  p(99)=1.69ms 
     http_reqs......................: 59999   999.977055/s
     ✓ { scenario:rps_1000 }........: 59999   999.977055/s
     iteration_duration.............: min=840.22µs avg=1.09ms   med=1ms      max=48.5ms   p(95)=1.38ms  p(99)=1.85ms 
     iterations.....................: 59999   999.977055/s
     ✓ { scenario:rps_1000 }........: 59999   999.977055/s
     valid_graphql_response.........: 100.00% ✓ 59999      ✗ 0    
     ✓ { scenario:rps_1000 }........: 100.00% ✓ 59999      ✗ 0    
     valid_http_code................: 100.00% ✓ 59999      ✗ 0    
     ✓ { scenario:rps_1000 }........: 100.00% ✓ 59999      ✗ 0    
     vus............................: 1       min=0        max=6  
     vus_max........................: 200     min=200      max=200

Copy link

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

Docker Bake metadata
{
"conductor": {
  "containerimage.config.digest": "sha256:eb4043bbff93cbc1b6dfbdf8f47e5f8a7c56f88022e270e952e85ad17cc467d6",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
    "digest": "sha256:3321b195aa75e6ca07934cec913a450391a3e3f914917ef86baba5a3f5464ecd",
    "size": 902,
    "platform": {
      "architecture": "amd64",
      "os": "linux"
    }
  },
  "containerimage.digest": "sha256:3321b195aa75e6ca07934cec913a450391a3e3f914917ef86baba5a3f5464ecd",
  "image.name": "ghcr.io/the-guild-org/conductor/conductor:390ec00a51e07776ad4df32456cbace012819b2e"
}
}

@dotansimha dotansimha merged commit b59483b into master Jan 18, 2024
16 checks passed
@dotansimha dotansimha deleted the expose_query_plan branch January 18, 2024 10:45
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.

expose query plan via expose_query_plan config for federation source
1 participant