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

fix: add support to list type arguments #2008

Closed
wants to merge 19 commits into from

Conversation

laststylebender14
Copy link
Contributor

@laststylebender14 laststylebender14 commented May 22, 2024

Summary:

  • added support for list type arguments.
  • added missing integration tests.

Issue Reference(s):
Fixes #1991

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 added the type: fix Iterations on existing features or infrastructure. label May 22, 2024
@laststylebender14 laststylebender14 marked this pull request as draft May 22, 2024 14:17
Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 98.31933% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 82.73%. Comparing base (4cca178) to head (c0a1a6c).
Report is 38 commits behind head on main.

Files Patch % Lines
src/core/path.rs 97.26% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2008      +/-   ##
==========================================
+ Coverage   82.60%   82.73%   +0.12%     
==========================================
  Files         174      174              
  Lines       17930    18034     +104     
==========================================
+ Hits        14811    14920     +109     
+ Misses       3119     3114       -5     

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

@github-actions github-actions bot added the ci: benchmark Runs benchmarks label May 24, 2024
@laststylebender14 laststylebender14 marked this pull request as ready for review May 24, 2024 06:29
Copy link

🐰Bencher

ReportFri, May 24, 2024 at 07:07:08 UTC
Projecttailcall
Branch2008/merge
Testbedbenchmarking-runner

🚨 4 ALERTS: Threshold Boundary Limits exceeded!
BenchmarkMeasure (units)ViewValueLower BoundaryUpper Boundary
input/value.nested.existingLatency (nanoseconds (ns))🚨 (view plot | view alert)51.81 (+24.73%)44.51 (116.40%)
input/value.rootLatency (nanoseconds (ns))🚨 (view plot | view alert)46.45 (+20.63%)40.81 (113.82%)
input/vars.existingLatency (nanoseconds (ns))🚨 (view plot | view alert)17.01 (+107.67%)9.93 (171.29%)
input/vars.missingLatency (nanoseconds (ns))🚨 (view plot | view alert)11.65 (+33.40%)11.50 (101.32%)

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
group_by✅ (view plot)554.55 (-6.91%)650.66 (85.23%)
input/args.missing✅ (view plot)22.59 (-8.29%)27.20 (83.04%)
input/args.nested.existing✅ (view plot)51.36 (-0.15%)65.82 (78.03%)
input/args.nested.missing✅ (view plot)37.42 (-2.70%)40.62 (92.14%)
input/args.root✅ (view plot)47.98 (-0.18%)62.34 (76.96%)
input/headers.existing✅ (view plot)30.35 (-4.50%)33.53 (90.50%)
input/headers.missing✅ (view plot)29.24 (-4.96%)33.35 (87.66%)
input/value.missing✅ (view plot)23.43 (-0.46%)25.31 (92.59%)
input/value.nested.existing🚨 (view plot | view alert)51.81 (+24.73%)44.51 (116.40%)
input/value.nested.missing✅ (view plot)36.90 (+1.34%)38.34 (96.26%)
input/value.root🚨 (view plot | view alert)46.45 (+20.63%)40.81 (113.82%)
input/vars.existing🚨 (view plot | view alert)17.01 (+107.67%)9.93 (171.29%)
input/vars.missing🚨 (view plot | view alert)11.65 (+33.40%)11.50 (101.32%)
test_batched_body✅ (view plot)2,714.20 (-99.67%)2,599,813.27 (0.10%)
test_batched_body #2✅ (view plot)1,586,400.00 (-8.33%)1,881,570.46 (84.31%)
test_data_loader✅ (view plot)455,940.00 (-3.36%)490,140.53 (93.02%)
test_handle_request✅ (view plot)157,390.00 (-5.82%)184,382.15 (85.36%)
test_http_execute_method✅ (view plot)18,192.00 (+0.05%)18,984.02 (95.83%)
with_mustache_expressions✅ (view plot)1,173.00 (+0.23%)1,234.29 (95.03%)
with_mustache_literal✅ (view plot)727.19 (+0.56%)770.99 (94.32%)

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

Copy link

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

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label May 26, 2024
```yml @mock
- request:
method: GET
url: http://localhost:3000/api?q=1,2,3
Copy link
Contributor

Choose a reason for hiding this comment

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

There are multiple ways to encode this —

# Option 1
/api?q=1,2,3

# Option 2
/api?q=1&q=2&q=3

# Option 3
/api?q[]=1&q[]=2&q[]=3

I think default should be option 2, but the user should be able to decide which option to use for encoding lists in the url.

This setting should be specified in upstream however it can be overridden in @http if required.

Copy link
Contributor

Choose a reason for hiding this comment

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

The main problem that I see here, is that this way of handling lists is very different from how we handle lists in Bulk APIs.

@@ -386,6 +386,9 @@ pub struct Arg {
pub modify: Option<Modify>,
#[serde(default, skip_serializing_if = "is_default")]
pub default_value: Option<Value>,
/// Flag to indicate if the type inside the list is required.
#[serde(default, skip_serializing_if = "is_default")]
pub list_type_required: bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

drop these changes if they aren't working from this PR. Reduce reviewer overhead :)

@@ -48,6 +48,21 @@ impl Mustache {
}
}

pub fn render_http(&self, value: &impl RequestString, method: &reqwest::Method) -> String {
Copy link
Contributor

Choose a reason for hiding this comment

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

mustache doesn't care about HTTP. We shouldn't have this a dependency to this function. Mustache doesn't even care it being a URL.

@github-actions github-actions bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label May 29, 2024
@laststylebender14 laststylebender14 marked this pull request as draft May 30, 2024 08:45
Copy link

github-actions bot commented Jun 1, 2024

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

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Jun 1, 2024
Copy link

github-actions bot commented Jun 6, 2024

PR closed after 5 days of inactivity.

@github-actions github-actions bot closed this Jun 6, 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: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: allow support to list arguments.
2 participants