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

feat: OpenAPI spec to tailcall config #2156

Draft
wants to merge 69 commits into
base: main
Choose a base branch
from
Draft

Conversation

shashitnak
Copy link
Contributor

@shashitnak shashitnak commented Jun 10, 2024

Summary:
Briefly describe the changes made in this PR.

Issue Reference(s):
Fixes #... (Replace "..." with the issue number)

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

  • I have added relevant unit & integration tests.
  • I have updated the documentation accordingly.
  • I have performed a self-review of my code.
  • PR follows the naming convention of <type>(<optional scope>): <title>

@github-actions github-actions bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Jun 26, 2024
@shashitnak shashitnak changed the base branch from openapi-base to main June 26, 2024 09:46
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 84.10042% with 38 lines in your changes missing coverage. Please review.

Project coverage is 86.00%. Comparing base (8dea1fd) to head (52bc349).

Files Patch % Lines
src/core/generator/openapi/query_generator.rs 85.32% 32 Missing ⚠️
src/cli/generator/config.rs 0.00% 3 Missing ⚠️
src/cli/generator/generator.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2156      +/-   ##
==========================================
- Coverage   86.02%   86.00%   -0.03%     
==========================================
  Files         234      236       +2     
  Lines       22405    22644     +239     
==========================================
+ Hits        19274    19475     +201     
- Misses       3131     3169      +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jun 26, 2024

🐰Bencher

ReportMon, July 8, 2024 at 09:23:48 UTC
Projecttailcall
Branch2156/merge
Testbedbenchmarking-runner
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
from_json_bench✅ (view plot)6,097,100.00 (-12.12%)7,769,919.24 (78.47%)
group_by✅ (view plot)481.57 (-13.23%)626.76 (76.83%)
input/args.missing✅ (view plot)25.52 (+5.53%)27.72 (92.04%)
input/args.nested.existing✅ (view plot)54.86 (+15.42%)61.37 (89.39%)
input/args.nested.missing✅ (view plot)38.93 (+2.34%)40.82 (95.37%)
input/args.root✅ (view plot)51.56 (+17.49%)58.33 (88.39%)
input/headers.existing✅ (view plot)30.66 (-3.01%)33.96 (90.30%)
input/headers.missing✅ (view plot)29.31 (-4.53%)33.77 (86.79%)
input/value.missing✅ (view plot)23.35 (-0.28%)24.96 (93.53%)
input/value.nested.existing✅ (view plot)41.28 (-0.80%)45.10 (91.53%)
input/value.nested.missing✅ (view plot)36.56 (-0.72%)38.62 (94.65%)
input/value.root✅ (view plot)37.76 (-0.45%)41.46 (91.08%)
input/vars.existing✅ (view plot)7.49 (-2.76%)8.96 (83.57%)
input/vars.missing✅ (view plot)8.11 (-19.31%)13.41 (60.44%)
synth_nested✅ (view plot)153,590.00 (+231.60%)162,761.79 (94.36%)
test_batched_body✅ (view plot)1,983.40 (-98.01%)930,672.53 (0.21%)
test_batched_body #2✅ (view plot)1,590,200.00 (-6.19%)1,819,909.01 (87.38%)
test_data_loader✅ (view plot)381,920.00 (-16.96%)519,212.38 (73.56%)
test_handle_request✅ (view plot)141,570.00 (-8.57%)172,628.65 (82.01%)
test_http_execute_method✅ (view plot)14,534.00 (-17.64%)20,576.27 (70.63%)
with_mustache_expressions✅ (view plot)1,082.70 (-6.80%)1,235.58 (87.63%)
with_mustache_literal✅ (view plot)738.41 (+2.26%)778.60 (94.84%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

---
schema @server @upstream {
query: Query
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some basic generated configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added code for generating queries

r"^.*\.json",
open_api_to_config_spec::run_open_api_to_config_spec,
"src/core/generator/tests/fixtures/openapi",
r"^.*\.yml"
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move these tests to open_api_to_config_spec.rs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a new file named config_gen.rs which makes call to both run_json_to_config_spec and run_openapi_to_config_spec

}
}

pub fn from_openapi_spec(query: &str, spec: OpenApiV3Spec) -> Config {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep only FromOpenAPIGenerator public.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the from_openapi_spec function

@tusharmath tusharmath marked this pull request as draft July 5, 2024 07:48
@shashitnak shashitnak marked this pull request as ready for review July 8, 2024 09:06
@tusharmath tusharmath marked this pull request as draft July 11, 2024 12:52
Copy link

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: benchmark Runs benchmarks state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants