repo
stringlengths
5
53
pr_number
int32
1
321k
task_type
stringclasses
2 values
issue_text
stringlengths
0
81.2k
pr_title
stringlengths
1
319
pr_body
stringlengths
0
105k
base_sha
stringlengths
40
40
head_sha
stringlengths
40
40
gold_diff
stringlengths
0
202M
changed_files
listlengths
0
100
review_threads
listlengths
0
100
test_patch
stringlengths
0
23.4M
merged
bool
1 class
tikv/tikv
19,636
issue_to_patch
raftstore: relax load base split thresholds and improve observability
### What is changed and how it works? Issue Number: ref #18932 What's Changed: ```commit-message Cherry-pick #19576 to release-8.5. This relaxes load-based split thresholds and adds observability for split-key selection, CPU fallback decisions, observed per-region load, and load split admin command success/failure....
4c20a1b30748522a26f41d7698a7d217b146849a
1bb3e62e0734b782630bef028bce02f2f7322e0e
diff --git a/components/raftstore/src/store/metrics.rs b/components/raftstore/src/store/metrics.rs index 3dec8d85733..a9f86216dc1 100644 --- a/components/raftstore/src/store/metrics.rs +++ b/components/raftstore/src/store/metrics.rs @@ -256,6 +256,18 @@ make_static_metric! { no_uncross_key, // Split i...
[ "components/raftstore/src/store/metrics.rs", "components/raftstore/src/store/worker/pd.rs", "components/raftstore/src/store/worker/split_config.rs", "components/raftstore/src/store/worker/split_controller.rs", "metrics/grafana/tikv_details.dashboard.py", "metrics/grafana/tikv_details.json", "metrics/gra...
[]
true
tikv/tikv
19,385
issue_to_patch
read pool queue fairness ## Feature Request we should have queue fairness mechanisms for TiKV's unified read pool, ensuring fair resource distribution across tenants and background traffic. It helps in prioritizing high priority traffic when queue is full. Detailed RFC https://github.com/tikv/rfcs/blob/master/text/q...
read pool queue fairness
<!-- Thank you for contributing to TiKV! If you haven't already, please read TiKV's [CONTRIBUTING](https://github.com/tikv/tikv/blob/master/CONTRIBUTING.md) document. If you're unsure about anything, just ask; somebody should be along to answer within a day or two. PR Title Format: 1. module [, module2, modu...
eb8aa3aab39ab0648dde7a934933fcc7147bc898
afd414843913042521fe8103299f0a330b26b720
diff --git a/Cargo.lock b/Cargo.lock index ea5556806e6..e75c88dcf63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8781,7 +8781,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yatp" version = "0.0.1" -source = "git+https://github.com/tikv/yatp.git?branch=master#79...
[ "Cargo.lock", "components/resource_control/src/resource_group.rs", "src/read_pool.rs" ]
[ { "comment": "The yatp dependency should not be pointing to a local path \"/tmp/yatp-src\". This is a development-only configuration that will break builds on other machines and in CI/CD environments. The dependency should either point to a git repository URL (like the original \"https://github.com/tikv/yatp.gi...
true
tikv/tikv
19,385
comment_to_fix
read pool queue fairness
The test expects the evicted task's priority label to be "medium", which is correct given that the low_ctx has override_priority: 0. However, this test doesn't actually verify that the eviction logic works correctly based on resource group priorities. All the "low" tasks use low_ctx (resource group "low_group" with p...
eb8aa3aab39ab0648dde7a934933fcc7147bc898
afd414843913042521fe8103299f0a330b26b720
diff --git a/src/read_pool.rs b/src/read_pool.rs index 4a9f0e6a7cd..bb169526929 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -24,7 +24,7 @@ use resource_control::{ }; use thiserror::Error; use tikv_util::{ - resource_control::TaskMetadata, + resource_control::{TaskMetadata, priority_from_task_meta},...
[ "src/read_pool.rs" ]
[ { "comment": "The test expects the evicted task's priority label to be \"medium\", which is correct given that the low_ctx has override_priority: 0. However, this test doesn't actually verify that the eviction logic works correctly based on resource group priorities. \n\nAll the \"low\" tasks use low_ctx (resou...
true
tikv/tikv
19,385
comment_to_fix
read pool queue fairness
The PR description is incomplete. It contains only template placeholders with no actual description of the changes. The following sections need to be filled in: 1. "Issue Number: Close #xxx" - should link to the actual issue 2. The commit message block is empty 3. The checklist items (tests, side effects) are unchecke...
eb8aa3aab39ab0648dde7a934933fcc7147bc898
afd414843913042521fe8103299f0a330b26b720
diff --git a/src/read_pool.rs b/src/read_pool.rs index 4a9f0e6a7cd..bb169526929 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -24,7 +24,7 @@ use resource_control::{ }; use thiserror::Error; use tikv_util::{ - resource_control::TaskMetadata, + resource_control::{TaskMetadata, priority_from_task_meta},...
[ "src/read_pool.rs" ]
[ { "comment": "The PR description is incomplete. It contains only template placeholders with no actual description of the changes. The following sections need to be filled in:\n\n1. \"Issue Number: Close #xxx\" - should link to the actual issue\n2. The commit message block is empty\n3. The checklist items (tests...
true
tikv/tikv
19,385
comment_to_fix
read pool queue fairness
The level assignment for CommandPri::Normal is inconsistent with CommandPri::High. Both High and Normal are assigned level 0, which means they will have the same task_extra_priority factor. However, looking at the fixed_level assignment on line 209, CommandPri::High is assigned Some(0) while CommandPri::Normal is assig...
eb8aa3aab39ab0648dde7a934933fcc7147bc898
afd414843913042521fe8103299f0a330b26b720
diff --git a/src/read_pool.rs b/src/read_pool.rs index 4a9f0e6a7cd..bb169526929 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -24,7 +24,7 @@ use resource_control::{ }; use thiserror::Error; use tikv_util::{ - resource_control::TaskMetadata, + resource_control::{TaskMetadata, priority_from_task_meta},...
[ "src/read_pool.rs" ]
[ { "comment": "The level assignment for CommandPri::Normal is inconsistent with CommandPri::High. Both High and Normal are assigned level 0, which means they will have the same task_extra_priority factor. However, looking at the fixed_level assignment on line 209, CommandPri::High is assigned Some(0) while Comma...
true
tikv/tikv
19,385
comment_to_fix
read pool queue fairness
_⚠️ Potential issue_ | _🔴 Critical_ <details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ```shell #!/bin/bash # Check TaskPriority definition and conversions echo "=== TaskPriority enum and From impls ===" rg -n --type rust 'enum TaskPriority' -A 20 echo "" echo "=== priority_from_task_meta implement...
eb8aa3aab39ab0648dde7a934933fcc7147bc898
afd414843913042521fe8103299f0a330b26b720
diff --git a/src/read_pool.rs b/src/read_pool.rs index 4a9f0e6a7cd..bb169526929 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -24,7 +24,7 @@ use resource_control::{ }; use thiserror::Error; use tikv_util::{ - resource_control::TaskMetadata, + resource_control::{TaskMetadata, priority_from_task_meta},...
[ "src/read_pool.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🔴 Critical_\n\n<details>\n<summary>🧩 Analysis chain</summary>\n\n🏁 Script executed:\n\n```shell\n#!/bin/bash\n# Check TaskPriority definition and conversions\necho \"=== TaskPriority enum and From impls ===\"\nrg -n --type rust 'enum TaskPriority' -A 20\n\necho \"\"\nech...
true
tikv/tikv
19,385
comment_to_fix
read pool queue fairness
_⚠️ Potential issue_ | _🔴 Critical_ **Test logic is sound, but assertions will fail due to the pool-name mismatch described above.** The eviction scenario (blocking worker + queued low-priority tasks + high-priority incoming task) correctly exercises the eviction path. However, the assertion at line 1543–1548 checks...
eb8aa3aab39ab0648dde7a934933fcc7147bc898
afd414843913042521fe8103299f0a330b26b720
diff --git a/src/read_pool.rs b/src/read_pool.rs index 4a9f0e6a7cd..bb169526929 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -24,7 +24,7 @@ use resource_control::{ }; use thiserror::Error; use tikv_util::{ - resource_control::TaskMetadata, + resource_control::{TaskMetadata, priority_from_task_meta},...
[ "src/read_pool.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🔴 Critical_\n\n**Test logic is sound, but assertions will fail due to the pool-name mismatch described above.**\n\nThe eviction scenario (blocking worker + queued low-priority tasks + high-priority incoming task) correctly exercises the eviction path. However, the assertio...
true
tikv/tikv
19,385
comment_to_fix
read pool queue fairness
_⚠️ Potential issue_ | _🔴 Critical_ <details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ```shell #!/bin/bash # Look at the eviction comparison logic and surrounding context echo "=== try_evict_lowest implementation ===" rg -n 'fn try_evict_lowest' --type rust -A 25 echo "" echo "=== peek_priority_of...
eb8aa3aab39ab0648dde7a934933fcc7147bc898
afd414843913042521fe8103299f0a330b26b720
diff --git a/src/read_pool.rs b/src/read_pool.rs index 4a9f0e6a7cd..bb169526929 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -24,7 +24,7 @@ use resource_control::{ }; use thiserror::Error; use tikv_util::{ - resource_control::TaskMetadata, + resource_control::{TaskMetadata, priority_from_task_meta},...
[ "src/read_pool.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🔴 Critical_\n\n<details>\n<summary>🧩 Analysis chain</summary>\n\n🏁 Script executed:\n\n```shell\n#!/bin/bash\n# Look at the eviction comparison logic and surrounding context\necho \"=== try_evict_lowest implementation ===\"\nrg -n 'fn try_evict_lowest' --type rust -A 25\...
true
tikv/tikv
19,385
comment_to_fix
read pool queue fairness
_⚠️ Potential issue_ | _🔴 Critical_ <details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ```shell #!/bin/bash # Verify peek_priority_of on ResourceController echo "=== peek_priority_of on ResourceController ===" rg -n --type rust 'fn peek_priority_of' -A 8 echo "" echo "=== try_evict_lowest usage sit...
eb8aa3aab39ab0648dde7a934933fcc7147bc898
afd414843913042521fe8103299f0a330b26b720
diff --git a/src/read_pool.rs b/src/read_pool.rs index 4a9f0e6a7cd..bb169526929 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -24,7 +24,7 @@ use resource_control::{ }; use thiserror::Error; use tikv_util::{ - resource_control::TaskMetadata, + resource_control::{TaskMetadata, priority_from_task_meta},...
[ "src/read_pool.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🔴 Critical_\n\n<details>\n<summary>🧩 Analysis chain</summary>\n\n🏁 Script executed:\n\n```shell\n#!/bin/bash\n# Verify peek_priority_of on ResourceController\necho \"=== peek_priority_of on ResourceController ===\"\nrg -n --type rust 'fn peek_priority_of' -A 8\n\necho \"...
true
tikv/tikv
19,385
comment_to_fix
read pool queue fairness
_⚠️ Potential issue_ | _🔴 Critical_ <details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ```shell # Verify the actual content of the closure dec() calls in src/read_pool.rs. rg -n --type rust 'running_tasks\.dec\(\)|task_gauge\.dec\(\)' src/read_pool.rs ``` Repository: tikv/tikv Length of output: 24...
eb8aa3aab39ab0648dde7a934933fcc7147bc898
afd414843913042521fe8103299f0a330b26b720
diff --git a/src/read_pool.rs b/src/read_pool.rs index 4a9f0e6a7cd..bb169526929 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -24,7 +24,7 @@ use resource_control::{ }; use thiserror::Error; use tikv_util::{ - resource_control::TaskMetadata, + resource_control::{TaskMetadata, priority_from_task_meta},...
[ "src/read_pool.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🔴 Critical_\n\n<details>\n<summary>🧩 Analysis chain</summary>\n\n🏁 Script executed:\n\n```shell\n# Verify the actual content of the closure dec() calls in src/read_pool.rs.\nrg -n --type rust 'running_tasks\\.dec\\(\\)|task_gauge\\.dec\\(\\)' src/read_pool.rs\n```\n\nRep...
true
tikv/tikv
19,509
issue_to_patch
Fairness among resource groups based on historical qps ## Feature Request This feature proposes fair scheduling for TiKV resource control, prioritizing tenants based on historical RU consumption to protect sustained traffic from new spikes. ### Is your feature request related to a problem? Please describe: <!-- A des...
Dynamic resource group isolation
<!-- Thank you for contributing to TiKV! If you haven't already, please read TiKV's [CONTRIBUTING](https://github.com/tikv/tikv/blob/master/CONTRIBUTING.md) document. If you're unsure about anything, just ask; somebody should be along to answer within a day or two. PR Title Format: 1. module [, module2, modu...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/backup/src/endpoint.rs b/components/backup/src/endpoint.rs index 0bac96e419f..f54863c6b7c 100644 --- a/components/backup/src/endpoint.rs +++ b/components/backup/src/endpoint.rs @@ -251,6 +251,9 @@ async fn save_backup_file_worker<EK: KvEngine>( msg.files.save(&storage), ...
[ "components/backup/src/endpoint.rs", "components/resource_control/src/config.rs", "components/resource_control/src/future.rs", "components/resource_control/src/lib.rs", "components/resource_control/src/metrics.rs", "components/resource_control/src/resource_group.rs", "components/resource_control/src/res...
[ { "comment": "The test config file tests/integrations/config/test-custom.toml is missing several new configuration fields. It should include `bg-cpu-start-threshold`, `low-pri-cpu-end-threshold`, `enable-fair-scheduling`, `enable-read-admission-control`, `enable-write-admission-control`, and `ru-historical-wind...
diff --git a/tests/integrations/config/mod.rs b/tests/integrations/config/mod.rs index bd0a6969d9f..c70756c760a 100644 --- a/tests/integrations/config/mod.rs +++ b/tests/integrations/config/mod.rs @@ -918,10 +918,17 @@ fn test_serde_custom_tikv_config() { value.resource_control = ResourceControlConfig { e...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
The test config file tests/integrations/config/test-custom.toml is missing several new configuration fields. It should include `bg-cpu-start-threshold`, `low-pri-cpu-end-threshold`, `enable-fair-scheduling`, `enable-read-admission-control`, `enable-write-admission-control`, and `ru-historical-window-mins` to properly t...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/tests/integrations/config/test-custom.toml b/tests/integrations/config/test-custom.toml index aebea444576..a3bf58e276f 100644 --- a/tests/integrations/config/test-custom.toml +++ b/tests/integrations/config/test-custom.toml @@ -694,7 +694,14 @@ split.split-contained-score = 0.5 [resource-control] enabled...
[ "tests/integrations/config/test-custom.toml" ]
[ { "comment": "The test config file tests/integrations/config/test-custom.toml is missing several new configuration fields. It should include `bg-cpu-start-threshold`, `low-pri-cpu-end-threshold`, `enable-fair-scheduling`, `enable-read-admission-control`, `enable-write-admission-control`, and `ru-historical-wind...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
we should not take qps of last 60 seconds. it should be less than that
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "we should not take qps of last 60 seconds. it should be less than that", "path": "components/resource_control/src/resource_group.rs", "hunk": "@@ -51,11 +55,151 @@ const HIGH_PRIORITY: u32 = 16;\n // virtual time overflow.\n const RESET_VT_THRESHOLD: u64 = (u64::MAX >> 4) / 2;\n \n+/// Dur...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
we should make it global
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "we should make it global", "path": "components/resource_control/src/resource_group.rs", "hunk": "@@ -69,6 +213,13 @@ pub struct ResourceGroupManager {\n priority_limiters: [Arc<ResourceLimiter>; TaskPriority::PRIORITY_COUNT],\n // lastest config.\n config: Arc<VersionTrack<Conf...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
rename enable_fair_scheduling to enable_fair_scheduling_based_on_historical_usage
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "rename enable_fair_scheduling to enable_fair_scheduling_based_on_historical_usage", "path": "components/resource_control/src/resource_group.rs", "hunk": "@@ -261,11 +415,29 @@ impl ResourceGroupManager {\n }\n \n pub fn advance_min_virtual_time(&self) {\n+ // Push RU-based p...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
i don't need this one
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "i don't need this one", "path": "components/resource_control/src/resource_group.rs", "hunk": "@@ -261,11 +415,29 @@ impl ResourceGroupManager {\n }\n \n pub fn advance_min_virtual_time(&self) {\n+ // Push RU-based phase state into every controller before updating VT,\n+ ...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
change tier 3 -> tier 1 and tier 1 - tier 3
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "change tier 3 -> tier 1 and tier 1 - tier 3", "path": "components/resource_control/src/resource_group.rs", "hunk": "@@ -283,19 +455,115 @@ impl ResourceGroupManager {\n ResourceConsumeType::IoBytes(ctx.get_penalty().write_bytes as u64),\n );\n }\n+ ...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟡 Minor_ **Make the metric help text window-agnostic.** The historical window is configurable, so hardcoding "15-min baseline" makes this metric description wrong as soon as `ru-historical-window` is set to anything else. A neutral description is safer. <details> <summary>Proposed fix</summa...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/metrics.rs b/components/resource_control/src/metrics.rs index 86baa6fcfce..ed1b6e7bba6 100644 --- a/components/resource_control/src/metrics.rs +++ b/components/resource_control/src/metrics.rs @@ -6,7 +6,7 @@ use prometheus::*; lazy_static! { pub static ref BACKGROUND_Q...
[ "components/resource_control/src/metrics.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟡 Minor_\n\n**Make the metric help text window-agnostic.**\n\nThe historical window is configurable, so hardcoding \"15-min baseline\" makes this metric description wrong as soon as `ru-historical-window` is set to anything else. A neutral description is safer.\n\n<details...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ <details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ```shell #!/bin/bash # Check if the test coverage exercises the ring buffer wraparound case rg -n "historical_rate" components/resource_control/src/resource_group.rs -A 5 -B 2 ``` Repository: tikv/tikv Length of ou...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n<details>\n<summary>🧩 Analysis chain</summary>\n\n🏁 Script executed:\n\n```shell\n#!/bin/bash\n# Check if the test coverage exercises the ring buffer wraparound case\nrg -n \"historical_rate\" components/resource_control/src/resource_group.rs -A 5 -B 2\n```\n...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Release the admission slot before any extra limiter-only delay.** `AdmissionDecision::Delay` is what increments `currently_delayed` in `components/resource_control/src/resource_group.rs:533-555`. Here the guard stays alive for `max(admission_delay, rl_delay)`, so when `rl_delay` is...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 8bf305f7f16..6c4274436f9 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -1958,7 +1958,7 @@ impl<E: Engine, L: LockManager, F: KvFormat> Storage<E, L, F> { self.sched .get_sched_pool() // NOTE: we don't support bac...
[ "src/storage/mod.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Release the admission slot before any extra limiter-only delay.**\n\n`AdmissionDecision::Delay` is what increments `currently_delayed` in `components/resource_control/src/resource_group.rs:533-555`. Here the guard stays alive for `max(admission_delay, rl_dela...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🔴 Critical_ <details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ```shell #!/bin/bash set -euo pipefail echo "Non-Tokio block_on call sites:" rg -n --type=rust 'futures::executor::block_on|futures_executor::block_on' echo echo "Storage read futures awaited with block_on in sr...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 8bf305f7f16..6c4274436f9 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -1958,7 +1958,7 @@ impl<E: Engine, L: LockManager, F: KvFormat> Storage<E, L, F> { self.sched .get_sched_pool() // NOTE: we don't support bac...
[ "src/storage/mod.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🔴 Critical_\n\n<details>\n<summary>🧩 Analysis chain</summary>\n\n🏁 Script executed:\n\n```shell\n#!/bin/bash\nset -euo pipefail\n\necho \"Non-Tokio block_on call sites:\"\nrg -n --type=rust 'futures::executor::block_on|futures_executor::block_on'\n\necho\necho \"Storage ...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🔴 Critical_ **Guard the tier-3 write gate behind `!cmd.readonly()`.** `run_cmd` feeds both read and write scheduler commands, but this branch now runs for all of them and always calls `admission_decision(..., false)`. That means read-only transactional commands handled by `TxnScheduler` will ...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/txn/scheduler.rs b/src/storage/txn/scheduler.rs index 4242ad541fe..e9d981458bd 100644 --- a/src/storage/txn/scheduler.rs +++ b/src/storage/txn/scheduler.rs @@ -251,6 +251,9 @@ struct TxnSchedulerInner<L: LockManager> { // all tasks are executed in this pool sched_worker_pool: SchedPoo...
[ "src/storage/txn/scheduler.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🔴 Critical_\n\n**Guard the tier-3 write gate behind `!cmd.readonly()`.**\n\n`run_cmd` feeds both read and write scheduler commands, but this branch now runs for all of them and always calls `admission_decision(..., false)`. That means read-only transactional commands handl...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
i don't think its called every 1 second
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "i don't think its called every 1 second", "path": "components/resource_control/src/resource_group.rs", "hunk": "@@ -283,19 +455,115 @@ impl ResourceGroupManager {\n ResourceConsumeType::IoBytes(ctx.get_penalty().write_bytes as u64),\n );\n }\n+ //...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ <details> <summary>🧩 Analysis chain</summary> 🌐 Web query: `In Rust, is the body of an `async move { ... }` block executed when the future is created, or only when the future is first polled?` 💡 Result: The body of an async move { ... } block is only executed when the future is...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 8bf305f7f16..6c4274436f9 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -1958,7 +1958,7 @@ impl<E: Engine, L: LockManager, F: KvFormat> Storage<E, L, F> { self.sched .get_sched_pool() // NOTE: we don't support bac...
[ "src/storage/mod.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n<details>\n<summary>🧩 Analysis chain</summary>\n\n🌐 Web query:\n\n`In Rust, is the body of an `async move { ... }` block executed when the future is created, or only when the future is first polled?`\n\n💡 Result:\n\nThe body of an async move { ... } block is...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Don’t erase admission rejections to `SchedTooBusy`.** `src/read_pool.rs:978-990` adds a distinct `ReadPoolError::Rejected`, but `map_err(|_| ErrorInner::SchedTooBusy)` collapses it with pool-full and cancellation here. With no dedicated storage-side variant in `src/storage/errors.r...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 8bf305f7f16..6c4274436f9 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -1958,7 +1958,7 @@ impl<E: Engine, L: LockManager, F: KvFormat> Storage<E, L, F> { self.sched .get_sched_pool() // NOTE: we don't support bac...
[ "src/storage/mod.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Don’t erase admission rejections to `SchedTooBusy`.**\n\n`src/read_pool.rs:978-990` adds a distinct `ReadPoolError::Rejected`, but `map_err(|_| ErrorInner::SchedTooBusy)` collapses it with pool-full and cancellation here. With no dedicated storage-side varian...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟡 Minor_ **Potential negative counter from imbalanced `release_delay_slot` calls.** `currently_delayed` is an `AtomicI64` that can go negative if `release_delay_slot()` is called more times than `admission_decision` returned `Delay`. This could allow more than `admission_max_delayed_count` co...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟡 Minor_\n\n**Potential negative counter from imbalanced `release_delay_slot` calls.**\n\n`currently_delayed` is an `AtomicI64` that can go negative if `release_delay_slot()` is called more times than `admission_decision` returned `Delay`. This could allow more than `admis...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟡 Minor_ <details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ```shell #!/bin/bash # Check how group names are passed to compute_admission_delay and record_ru_consumption rg -n "compute_admission_delay|record_ru_consumption" --type rust -C 3 ``` Repository: tikv/tikv Length o...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟡 Minor_\n\n<details>\n<summary>🧩 Analysis chain</summary>\n\n🏁 Script executed:\n\n```shell\n#!/bin/bash\n# Check how group names are passed to compute_admission_delay and record_ru_consumption\nrg -n \"compute_admission_delay|record_ru_consumption\" --type rust -C 3\n`...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🔴 Critical_ **Delay slot leak on early return—use a drop guard.** When `admission_decision()` returns `AdmissionDecision::Delay`, it atomically reserves a slot via `fetch_add` (see `resource_group.rs:593`). However, if the pool-full check at line 186 returns `UnifiedReadPoolFull`, the slot is...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/read_pool.rs b/src/read_pool.rs index f7bca752597..fbcc9e764e5 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -14,13 +14,14 @@ use std::{ use file_system::{IoType, set_io_type}; use futures::{ channel::oneshot, - future::{FutureExt, TryFutureExt}, + future::{BoxFuture, FutureExt, ...
[ "src/read_pool.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🔴 Critical_\n\n**Delay slot leak on early return—use a drop guard.**\n\nWhen `admission_decision()` returns `AdmissionDecision::Delay`, it atomically reserves a slot via `fetch_add` (see `resource_group.rs:593`). However, if the pool-full check at line 186 returns `Unified...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟡 Minor_ **Running task gauge increment happens before potential `tokio::spawn` failure.** `running_task_gauge.inc()` is called at line 219, but if `tokio::spawn` (line 266) fails (e.g., runtime is shutting down), the decrement in the task closure will never execute, leaving the gauge permane...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/read_pool.rs b/src/read_pool.rs index f7bca752597..fbcc9e764e5 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -14,13 +14,14 @@ use std::{ use file_system::{IoType, set_io_type}; use futures::{ channel::oneshot, - future::{FutureExt, TryFutureExt}, + future::{BoxFuture, FutureExt, ...
[ "src/read_pool.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟡 Minor_\n\n**Running task gauge increment happens before potential `tokio::spawn` failure.**\n\n`running_task_gauge.inc()` is called at line 219, but if `tokio::spawn` (line 266) fails (e.g., runtime is shutting down), the decrement in the task closure will never execute,...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Delay slot can leak if the task is cancelled during sleep.** When `admission_decision()` returns `Delay`, it atomically reserves a slot via `fetch_add`. If this spawned task is cancelled during `tokio::time::sleep(delay).await` (e.g., scheduler shutdown), `release_delay_slot()` is ...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/txn/scheduler.rs b/src/storage/txn/scheduler.rs index 4242ad541fe..e9d981458bd 100644 --- a/src/storage/txn/scheduler.rs +++ b/src/storage/txn/scheduler.rs @@ -251,6 +251,9 @@ struct TxnSchedulerInner<L: LockManager> { // all tasks are executed in this pool sched_worker_pool: SchedPoo...
[ "src/storage/txn/scheduler.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Delay slot can leak if the task is cancelled during sleep.**\n\nWhen `admission_decision()` returns `Delay`, it atomically reserves a slot via `fetch_add`. If this spawned task is cancelled during `tokio::time::sleep(delay).await` (e.g., scheduler shutdown), ...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🔴 Critical_ **`DelaySlotGuard::release()` leaks the manager `Arc`.** `mem::forget(self)` suppresses `Drop`, but it also suppresses dropping the inner `Arc<ResourceGroupManager>`. Since `src/read_pool.rs` explicitly calls `guard.release()` on the delayed path, every delayed request leaks one s...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🔴 Critical_\n\n**`DelaySlotGuard::release()` leaks the manager `Arc`.**\n\n`mem::forget(self)` suppresses `Drop`, but it also suppresses dropping the inner `Arc<ResourceGroupManager>`. Since `src/read_pool.rs` explicitly calls `guard.release()` on the delayed path, every d...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Background admission currently drops the caller’s limiter.** When `is_background` is true, Lines 674-676 ignore the supplied `resource_limiter` and call `get_background_resource_limiter(group, "")` instead. With an empty `request_source`, `ResourceGroup::get_background_resource_lim...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Background admission currently drops the caller’s limiter.**\n\nWhen `is_background` is true, Lines 674-676 ignore the supplied `resource_limiter` and call `get_background_resource_limiter(group, \"\")` instead. With an empty `request_source`, `ResourceGroup:...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Foreground limiter lookup no longer falls back to `default`.** `get_resource_limiter()` now returns `Some(self.get_foreground_group_limiter(rg))` for any foreground name when there is more than one group. Unlike `resource_group()` and the background path, that creates a fresh `ru_t...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Foreground limiter lookup no longer falls back to `default`.**\n\n`get_resource_limiter()` now returns `Some(self.get_foreground_group_limiter(rg))` for any foreground name when there is more than one group. Unlike `resource_group()` and the background path, ...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Re-check pool capacity after a delayed admission.** `running_task_gauge` is only incremented at Line 282, after the async sleep. That means a burst of delayed requests can all pass the earlier full check at Line 173 while the gauge is still low, then enqueue together at Line 283 an...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/read_pool.rs b/src/read_pool.rs index f7bca752597..fbcc9e764e5 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -14,13 +14,14 @@ use std::{ use file_system::{IoType, set_io_type}; use futures::{ channel::oneshot, - future::{FutureExt, TryFutureExt}, + future::{BoxFuture, FutureExt, ...
[ "src/read_pool.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Re-check pool capacity after a delayed admission.**\n\n`running_task_gauge` is only incremented at Line 282, after the async sleep. That means a burst of delayed requests can all pass the earlier full check at Line 173 while the gauge is still low, then enque...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Check the request deadline before admission control.** This new block runs before `check_task_deadline_exceeded()`. An already-expired task can now consume a delay slot, sleep, or come back as `SchedTooBusy` instead of `DeadlineExceeded`. <details> <summary>🤖 Prompt for AI Agents...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/txn/scheduler.rs b/src/storage/txn/scheduler.rs index 4242ad541fe..e9d981458bd 100644 --- a/src/storage/txn/scheduler.rs +++ b/src/storage/txn/scheduler.rs @@ -251,6 +251,9 @@ struct TxnSchedulerInner<L: LockManager> { // all tasks are executed in this pool sched_worker_pool: SchedPoo...
[ "src/storage/txn/scheduler.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Check the request deadline before admission control.**\n\nThis new block runs before `check_task_deadline_exceeded()`. An already-expired task can now consume a delay slot, sleep, or come back as `SchedTooBusy` instead of `DeadlineExceeded`.\n\n<details>\n<su...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Pass the real request source into `get_resource_limiter()`.** Using `""` here drops request-source-specific limiter selection. That can misclassify background traffic and make scheduler admission decisions diverge from the coprocessor path, which passes `context.get_request_source(...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/txn/scheduler.rs b/src/storage/txn/scheduler.rs index 4242ad541fe..e9d981458bd 100644 --- a/src/storage/txn/scheduler.rs +++ b/src/storage/txn/scheduler.rs @@ -251,6 +251,9 @@ struct TxnSchedulerInner<L: LockManager> { // all tasks are executed in this pool sched_worker_pool: SchedPoo...
[ "src/storage/txn/scheduler.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Pass the real request source into `get_resource_limiter()`.**\n\nUsing `\"\"` here drops request-source-specific limiter selection. That can misclassify background traffic and make scheduler admission decisions diverge from the coprocessor path, which passes ...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Fix `RuTracker::advance()` for gaps larger than one bucket.** Line 126 mixes `i` with the already-mutated `self.completed`, so advancing by more than one bucket skips slots and can overwrite data written earlier in the same loop. When the gap is larger than the window, Line 127 als...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Fix `RuTracker::advance()` for gaps larger than one bucket.**\n\nLine 126 mixes `i` with the already-mutated `self.completed`, so advancing by more than one bucket skips slots and can overwrite data written earlier in the same loop. When the gap is larger tha...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Advance trackers to `now` before phase and idle checks.** Lines 491, 574, 589, and 634 read tracker state without first rolling it forward. Once a group goes idle, the last partial bucket and completed buckets stay “live” until another `record_ru_consumption()` call, so phase class...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Advance trackers to `now` before phase and idle checks.**\n\nLines 491, 574, 589, and 634 read tracker state without first rolling it forward. Once a group goes idle, the last partial bucket and completed buckets stay “live” until another `record_ru_consumpti...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟠 Major_ **Keep background admission on the RU path only.** Line 688 now always folds in `resource_limiter.admission_delay(is_read)`. That changes background behavior: a background limiter with debt will delay or reject here even though background admission is supposed to ignore the caller-su...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**Keep background admission on the RU path only.**\n\nLine 688 now always folds in `resource_limiter.admission_delay(is_read)`. That changes background behavior: a background limiter with debt will delay or reject here even though background admission is suppos...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
_⚠️ Potential issue_ | _🟡 Minor_ **Evicting a tracker never clears the controller's phase bit.** `update_group_phases()` only writes flags for groups that still exist in `ru_trackers`. If an over-baseline group goes idle and Lines 631-636 remove its tracker, `GroupPriorityTracker.is_over_baseline` stays at its previ...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟡 Minor_\n\n**Evicting a tracker never clears the controller's phase bit.**\n\n`update_group_phases()` only writes flags for groups that still exist in `ru_trackers`. If an over-baseline group goes idle and Lines 631-636 remove its tracker, `GroupPriorityTracker.is_over_ba...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
Do we need to check the deadline again after the delay?
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/txn/scheduler.rs b/src/storage/txn/scheduler.rs index 4242ad541fe..e9d981458bd 100644 --- a/src/storage/txn/scheduler.rs +++ b/src/storage/txn/scheduler.rs @@ -251,6 +251,9 @@ struct TxnSchedulerInner<L: LockManager> { // all tasks are executed in this pool sched_worker_pool: SchedPoo...
[ "src/storage/txn/scheduler.rs" ]
[ { "comment": "Do we need to check the deadline again after the delay?", "path": "src/storage/txn/scheduler.rs", "hunk": "@@ -722,14 +735,45 @@ impl<E: Engine, L: LockManager> TxnScheduler<E, L> {\n let sched = self.clone();\n let metadata = TaskMetadata::from_ctx(task.cmd().resource_cont...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
What if upgrade from old version with this parameter set? Does it break compatibility?
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/config.rs b/components/resource_control/src/config.rs index dcd75370829..ee9ed10e177 100644 --- a/components/resource_control/src/config.rs +++ b/components/resource_control/src/config.rs @@ -12,9 +12,14 @@ pub struct Config { #[online_config(skip)] pub enabled: bo...
[ "components/resource_control/src/config.rs" ]
[ { "comment": "What if upgrade from old version with this parameter set? Does it break compatibility?", "path": "components/resource_control/src/config.rs", "hunk": "@@ -12,9 +12,13 @@ pub struct Config {\n #[online_config(skip)]\n pub enabled: bool,\n pub priority_ctl_strategy: PriorityCtlSt...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
Performance/regression risk under contention: queue eviction happened earlier (pool full path), but admission outcome is determined here. If the incoming request is rejected/delay-timeout after an eviction, we can effectively drop both the evicted queued task and this incoming task. Could we evaluate admission before ...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/read_pool.rs b/src/read_pool.rs index f7bca752597..fbcc9e764e5 100644 --- a/src/read_pool.rs +++ b/src/read_pool.rs @@ -14,13 +14,14 @@ use std::{ use file_system::{IoType, set_io_type}; use futures::{ channel::oneshot, - future::{FutureExt, TryFutureExt}, + future::{BoxFuture, FutureExt, ...
[ "src/read_pool.rs" ]
[ { "comment": "Performance/regression risk under contention: queue eviction happened earlier (pool full path), but admission outcome is determined here. If the incoming request is rejected/delay-timeout after an eviction, we can effectively drop both the evicted queued task and this incoming task.\n\nCould we ev...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
High write-throughput tail-latency risk: this admission delay path runs while latches are held. Under sustained contention, sleeping here can amplify head-of-line blocking and widen p99/p999. Could we move delay/retry to a point before latch ownership, or release/requeue around delay, so we avoid holding latch resourc...
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/src/storage/txn/scheduler.rs b/src/storage/txn/scheduler.rs index 4242ad541fe..e9d981458bd 100644 --- a/src/storage/txn/scheduler.rs +++ b/src/storage/txn/scheduler.rs @@ -251,6 +251,9 @@ struct TxnSchedulerInner<L: LockManager> { // all tasks are executed in this pool sched_worker_pool: SchedPoo...
[ "src/storage/txn/scheduler.rs" ]
[ { "comment": "High write-throughput tail-latency risk: this admission delay path runs while latches are held. Under sustained contention, sleeping here can amplify head-of-line blocking and widen p99/p999.\n\nCould we move delay/retry to a point before latch ownership, or release/requeue around delay, so we avo...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
```suggestion pub bg_cpu_cutoff_threshold: f64, ```
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/config.rs b/components/resource_control/src/config.rs index dcd75370829..ee9ed10e177 100644 --- a/components/resource_control/src/config.rs +++ b/components/resource_control/src/config.rs @@ -12,9 +12,14 @@ pub struct Config { #[online_config(skip)] pub enabled: bo...
[ "components/resource_control/src/config.rs" ]
[ { "comment": "```suggestion\n pub bg_cpu_cutoff_threshold: f64,\n```", "path": "components/resource_control/src/config.rs", "hunk": "@@ -12,9 +12,13 @@ pub struct Config {\n #[online_config(skip)]\n pub enabled: bool,\n pub priority_ctl_strategy: PriorityCtlStrategy,\n- /// Overall res...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
```suggestion pub bg_cpu_throttle_threshold: f64, ```
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/config.rs b/components/resource_control/src/config.rs index dcd75370829..ee9ed10e177 100644 --- a/components/resource_control/src/config.rs +++ b/components/resource_control/src/config.rs @@ -12,9 +12,14 @@ pub struct Config { #[online_config(skip)] pub enabled: bo...
[ "components/resource_control/src/config.rs" ]
[ { "comment": "```suggestion\n pub bg_cpu_throttle_threshold: f64,\n```", "path": "components/resource_control/src/config.rs", "hunk": "@@ -12,9 +12,13 @@ pub struct Config {\n #[online_config(skip)]\n pub enabled: bool,\n pub priority_ctl_strategy: PriorityCtlStrategy,\n- /// Overall r...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
```suggestion pub historical_usage_window_mins: u64, ``` And the setting of this configuration should be validated to make sure it under the range [2, 60].
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/config.rs b/components/resource_control/src/config.rs index dcd75370829..ee9ed10e177 100644 --- a/components/resource_control/src/config.rs +++ b/components/resource_control/src/config.rs @@ -12,9 +12,14 @@ pub struct Config { #[online_config(skip)] pub enabled: bo...
[ "components/resource_control/src/config.rs" ]
[ { "comment": "```suggestion\n pub historical_usage_window_mins: u64,\n```\nAnd the setting of this configuration should be validated to make sure it under the range [2, 60].", "path": "components/resource_control/src/config.rs", "hunk": "@@ -24,17 +28,56 @@ pub struct Config {\n /// Minimum write...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
Use a `enum` to manage the "phase" rather than directly use `u8`. ```suggestion fn encode_two_phase_priority(group_priority: u32, phase: PriorityPhase, tag: u64) -> u64 { ```
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "Use a `enum` to manage the \"phase\" rather than directly use `u8`.\n\n```suggestion\nfn encode_two_phase_priority(group_priority: u32, phase: PriorityPhase, tag: u64) -> u64 {\n```", "path": "components/resource_control/src/resource_group.rs", "hunk": "@@ -51,11 +57,243 @@ const HIGH_PRIO...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
nit: use a constant to specify the hardcoded encoding bits. ```suggestion (priority >> PRIORITY_TAG_BITS) & 1 == 1 ```
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "nit: use a constant to specify the hardcoded encoding bits.\n```suggestion\n (priority >> PRIORITY_TAG_BITS) & 1 == 1\n```", "path": "components/resource_control/src/resource_group.rs", "hunk": "@@ -51,11 +57,243 @@ const HIGH_PRIORITY: u32 = 16;\n // virtual time overflow.\n const RESE...
true
tikv/tikv
19,509
comment_to_fix
Dynamic resource group isolation
```suggestion delayed_req_count: AtomicI64, ```
642bdf8c631079f8ffe96a20af56e09dd5088f40
b0cec6dc94760b6720c305eaa8121a05dc5b6958
diff --git a/components/resource_control/src/resource_group.rs b/components/resource_control/src/resource_group.rs index de7a5416a2c..61dcb1ec6fd 100644 --- a/components/resource_control/src/resource_group.rs +++ b/components/resource_control/src/resource_group.rs @@ -6,9 +6,9 @@ use std::{ collections::HashSet, ...
[ "components/resource_control/src/resource_group.rs" ]
[ { "comment": "```suggestion\n delayed_req_count: AtomicI64,\n```", "path": "components/resource_control/src/resource_group.rs", "hunk": "@@ -69,6 +307,23 @@ pub struct ResourceGroupManager {\n priority_limiters: [Arc<ResourceLimiter>; TaskPriority::PRIORITY_COUNT],\n // lastest config.\n ...
true
tikv/tikv
19,625
issue_to_patch
raftstore, resource_metering: report hot read CPU in heartbeat
### What is changed and how it works? Issue Number: ref https://github.com/tikv/tikv/issues/19373 It pick from #19491, which is #19305 and #19473 What's Changed: ```commit-message Backport hot read CPU reporting to release-8.5. This PR is structured as two commits: 1. Update `kvproto` lockfile to `pi...
4c20a1b30748522a26f41d7698a7d217b146849a
f7f8f43ea9b1f5f271d90a8b42643ec3eb4f81ca
diff --git a/Cargo.lock b/Cargo.lock index 46ebd819f21..568d38d5338 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3763,7 +3763,7 @@ dependencies = [ [[package]] name = "kvproto" version = "0.0.2" -source = "git+https://github.com/pingcap/kvproto.git?branch=release-8.5#3586c08f7d29d6ee9eed2a5aa9d33ad24012a6d2" +source...
[ "Cargo.lock", "components/pd_client/src/client.rs", "components/pd_client/src/lib.rs", "components/raftstore-v2/src/worker/pd/mod.rs", "components/raftstore-v2/src/worker/pd/region.rs", "components/raftstore-v2/src/worker/pd/store.rs", "components/raftstore/src/store/metrics.rs", "components/raftstore...
[]
true
tikv/tikv
19,473
issue_to_patch
resource_metering, raftstore: split region cpu by scheduler and unified read pools
<!-- Thank you for contributing to TiKV! If you haven't already, please read TiKV's [CONTRIBUTING](https://github.com/tikv/tikv/blob/master/CONTRIBUTING.md) document. If you're unsure about anything, just ask; somebody should be along to answer within a day or two. PR Title Format: 1. module [, module2, module3]: wh...
3387bea55174d17eeb9228f312d6a82d1ca24bd7
948c0a4d4e4337888d218083c6ce31abed0c0d17
diff --git a/Cargo.lock b/Cargo.lock index bb082ea1022..414acc79d85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3818,7 +3818,7 @@ dependencies = [ [[package]] name = "kvproto" version = "0.0.2" -source = "git+https://github.com/pingcap/kvproto.git#e3b325474572ee1dcadd5c64a6a0b5719fc2eba2" +source = "git+https://git...
[ "Cargo.lock", "components/raftstore/src/store/metrics.rs", "components/raftstore/src/store/worker/pd.rs", "components/raftstore/src/store/worker/split_controller.rs", "components/resource_metering/src/model.rs", "components/resource_metering/src/recorder/sub_recorder/cpu.rs", "components/resource_meteri...
[ { "comment": "The repo-local `[patch.'https://github.com/pingcap/kvproto']` override is enabled and points to a personal fork. The comment directly above says this should be commented out after the kvproto PR is merged; committing it will make CI/builds depend on an external fork and can break reproducibility. ...
true
tikv/tikv
19,473
comment_to_fix
resource_metering, raftstore: split region cpu by scheduler and unified read pools
_⚠️ Potential issue_ | _🟠 Major_ **`cpu_usage` and `cpu_stats` can diverge on region heartbeats.** The total here is still derived from `cpu_record.cpu_time_ms`, while the split only uses `unified_read_cpu_time_ms + scheduler_cpu_time_ms`. Since `merge_raw_record` preserves `RawRecord.cpu_time` independently, any CP...
3387bea55174d17eeb9228f312d6a82d1ca24bd7
948c0a4d4e4337888d218083c6ce31abed0c0d17
diff --git a/components/raftstore/src/store/worker/pd.rs b/components/raftstore/src/store/worker/pd.rs index 209490b6c25..37b7b7eff41 100644 --- a/components/raftstore/src/store/worker/pd.rs +++ b/components/raftstore/src/store/worker/pd.rs @@ -37,7 +37,9 @@ use kvproto::{ use pd_client::{BucketStat, Error, PdClient, ...
[ "components/raftstore/src/store/worker/pd.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟠 Major_\n\n**`cpu_usage` and `cpu_stats` can diverge on region heartbeats.**\n\nThe total here is still derived from `cpu_record.cpu_time_ms`, while the split only uses `unified_read_cpu_time_ms + scheduler_cpu_time_ms`. Since `merge_raw_record` preserves `RawRecord.cpu_t...
true
tikv/tikv
19,473
comment_to_fix
resource_metering, raftstore: split region cpu by scheduler and unified read pools
_⚠️ Potential issue_ | _🟡 Minor_ **Avoid publishing a bogus `region_sum` gauge on the first real heartbeat.** These new gauges reuse `last_report_ts`, which is still `0` on the first real store heartbeat, so the denominator becomes “time since Unix epoch” and `region_sum` is effectively always reported as `0`. If yo...
3387bea55174d17eeb9228f312d6a82d1ca24bd7
948c0a4d4e4337888d218083c6ce31abed0c0d17
diff --git a/components/raftstore/src/store/worker/pd.rs b/components/raftstore/src/store/worker/pd.rs index 209490b6c25..37b7b7eff41 100644 --- a/components/raftstore/src/store/worker/pd.rs +++ b/components/raftstore/src/store/worker/pd.rs @@ -37,7 +37,9 @@ use kvproto::{ use pd_client::{BucketStat, Error, PdClient, ...
[ "components/raftstore/src/store/worker/pd.rs" ]
[ { "comment": "_⚠️ Potential issue_ | _🟡 Minor_\n\n**Avoid publishing a bogus `region_sum` gauge on the first real heartbeat.**\n\nThese new gauges reuse `last_report_ts`, which is still `0` on the first real store heartbeat, so the denominator becomes “time since Unix epoch” and `region_sum` is effectively alw...
true
tikv/tikv
19,473
comment_to_fix
resource_metering, raftstore: split region cpu by scheduler and unified read pools
Can we use this 'sched' prefix to check the cpu type?
3387bea55174d17eeb9228f312d6a82d1ca24bd7
948c0a4d4e4337888d218083c6ce31abed0c0d17
diff --git a/components/raftstore/src/store/worker/pd.rs b/components/raftstore/src/store/worker/pd.rs index 209490b6c25..37b7b7eff41 100644 --- a/components/raftstore/src/store/worker/pd.rs +++ b/components/raftstore/src/store/worker/pd.rs @@ -37,7 +37,9 @@ use kvproto::{ use pd_client::{BucketStat, Error, PdClient, ...
[ "components/raftstore/src/store/worker/pd.rs" ]
[ { "comment": "Can we use this 'sched' prefix to check the cpu type?", "path": "components/raftstore/src/store/worker/pd.rs", "hunk": "@@ -1359,17 +1446,62 @@ where\n // For fake heartbeats, keep peer deltas and CPU records untouched so the\n // next real heartbeat still reports a full in...
true
tikv/tikv
19,473
comment_to_fix
resource_metering, raftstore: split region cpu by scheduler and unified read pools
please add some comments here
3387bea55174d17eeb9228f312d6a82d1ca24bd7
948c0a4d4e4337888d218083c6ce31abed0c0d17
diff --git a/components/raftstore/src/store/worker/pd.rs b/components/raftstore/src/store/worker/pd.rs index 209490b6c25..37b7b7eff41 100644 --- a/components/raftstore/src/store/worker/pd.rs +++ b/components/raftstore/src/store/worker/pd.rs @@ -37,7 +37,9 @@ use kvproto::{ use pd_client::{BucketStat, Error, PdClient, ...
[ "components/raftstore/src/store/worker/pd.rs" ]
[ { "comment": "please add some comments here", "path": "components/raftstore/src/store/worker/pd.rs", "hunk": "@@ -945,44 +950,120 @@ fn should_report_hotspot_read_peer(\n && cpu_usage < hotspot_cpu_usage_report_threshold())\n }\n \n+#[derive(Default)]\n+struct StoreHeartbeatCpuUsage {\n+ unif...
true
tikv/tikv
19,473
comment_to_fix
resource_metering, raftstore: split region cpu by scheduler and unified read pools
ditto. ```suggestion fn calculate_region_cpu_usage( ```
3387bea55174d17eeb9228f312d6a82d1ca24bd7
948c0a4d4e4337888d218083c6ce31abed0c0d17
diff --git a/components/raftstore/src/store/worker/pd.rs b/components/raftstore/src/store/worker/pd.rs index 209490b6c25..37b7b7eff41 100644 --- a/components/raftstore/src/store/worker/pd.rs +++ b/components/raftstore/src/store/worker/pd.rs @@ -37,7 +37,9 @@ use kvproto::{ use pd_client::{BucketStat, Error, PdClient, ...
[ "components/raftstore/src/store/worker/pd.rs" ]
[ { "comment": "ditto.\n```suggestion\nfn calculate_region_cpu_usage(\n```", "path": "components/raftstore/src/store/worker/pd.rs", "hunk": "@@ -945,44 +950,126 @@ fn should_report_hotspot_read_peer(\n && cpu_usage < hotspot_cpu_usage_report_threshold())\n }\n \n+#[derive(Default)]\n+struct StoreH...
true
tikv/tikv
19,473
comment_to_fix
resource_metering, raftstore: split region cpu by scheduler and unified read pools
How about predefining static metrics for this vec?
3387bea55174d17eeb9228f312d6a82d1ca24bd7
948c0a4d4e4337888d218083c6ce31abed0c0d17
diff --git a/components/raftstore/src/store/worker/pd.rs b/components/raftstore/src/store/worker/pd.rs index 209490b6c25..37b7b7eff41 100644 --- a/components/raftstore/src/store/worker/pd.rs +++ b/components/raftstore/src/store/worker/pd.rs @@ -37,7 +37,9 @@ use kvproto::{ use pd_client::{BucketStat, Error, PdClient, ...
[ "components/raftstore/src/store/worker/pd.rs" ]
[ { "comment": "How about predefining static metrics for this vec?", "path": "components/raftstore/src/store/worker/pd.rs", "hunk": "@@ -1359,17 +1420,59 @@ where\n // For fake heartbeats, keep peer deltas and CPU records untouched so the\n // next real heartbeat still reports a full inter...
true
tikv/tikv
19,473
comment_to_fix
resource_metering, raftstore: split region cpu by scheduler and unified read pools
```suggestion struct RegionCpuUsage { ```
3387bea55174d17eeb9228f312d6a82d1ca24bd7
948c0a4d4e4337888d218083c6ce31abed0c0d17
diff --git a/components/raftstore/src/store/worker/pd.rs b/components/raftstore/src/store/worker/pd.rs index 209490b6c25..37b7b7eff41 100644 --- a/components/raftstore/src/store/worker/pd.rs +++ b/components/raftstore/src/store/worker/pd.rs @@ -37,7 +37,9 @@ use kvproto::{ use pd_client::{BucketStat, Error, PdClient, ...
[ "components/raftstore/src/store/worker/pd.rs" ]
[ { "comment": "```suggestion\nstruct RegionCpuUsage {\n```", "path": "components/raftstore/src/store/worker/pd.rs", "hunk": "@@ -945,44 +950,100 @@ fn should_report_hotspot_read_peer(\n && cpu_usage < hotspot_cpu_usage_report_threshold())\n }\n \n+#[derive(Default)]\n+struct StoreHeartbeatCpuUsag...
true
tj/commander.js
2,529
issue_to_patch
Bump actions/checkout from 6.0.2 to 6.0.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v6.0.3</h2> <h2>What's Changed</h2> <ul> <li>Update changelo...
ba6d13ddb4243e5913367734f8c159089ffe7834
2b3f79a90209cda0849c45e14a4ab46cf871a7dc
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2704f1624..53fbe433f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac...
[ ".github/workflows/codeql-analysis.yml", ".github/workflows/tests.yml" ]
[]
true
tj/commander.js
2,528
issue_to_patch
Bump github/codeql-action from 4.36.0 to 4.36.2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.36.0 to 4.36.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/github/codeql-action/releases">github/codeql-action's releases</a>.</em></p> <blockquote> <h2>v4.36.2</h2> <ul> <li>Cache CodeQL CLI ver...
ba6d13ddb4243e5913367734f8c159089ffe7834
ab5d27478ae352fb58519ded3bf83995d724d781
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2704f1624..28c7b46ee 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,7 +30,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL ...
[ ".github/workflows/codeql-analysis.yml" ]
[]
true
tj/commander.js
2,526
issue_to_patch
Bump eslint from 10.4.0 to 10.4.1
Bumps [eslint](https://github.com/eslint/eslint) from 10.4.0 to 10.4.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/eslint/eslint/releases">eslint's releases</a>.</em></p> <blockquote> <h2>v10.4.1</h2> <h2>Bug Fixes</h2> <ul> <li><a href="https://github.com/eslint/eslint/c...
ba6d13ddb4243e5913367734f8c159089ffe7834
7ecb0b36d17165bb22baab5f6619f854e6ab027e
diff --git a/package-lock.json b/package-lock.json index 9b1020f27..28f0c6ef8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -163,9 +163,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0....
[ "package-lock.json" ]
[]
true
tj/commander.js
2,525
issue_to_patch
Bump typescript-eslint from 8.59.4 to 8.60.0
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.59.4 to 8.60.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/typescript-eslint/typescript-eslint/releases">typescript-eslint's releases</a>.</em></p...
ba6d13ddb4243e5913367734f8c159089ffe7834
1cae2007185e8e321c44a41446ba41398abf6864
diff --git a/package-lock.json b/package-lock.json index 9b1020f27..232e6466c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -367,17 +367,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.59.4", - "resolved": "https://registry.npmjs.org/@t...
[ "package-lock.json" ]
[]
true
tj/commander.js
2,481
issue_to_patch
Modernise tsconfig targets, and add .cjs
## Problem - somewhat old settings for tsconfig lib/module/target - `resolveJsonModule` was work-around and not sure why needed - now have some `.cjs` files ## Solution The tsconfig targets are not critical as only type checking and not generating code. Use `nodenext` and `esnext` for simple modern targets t...
b3e6795dcffbf4d8df957b8d15908da2163d1d66
0f95682746353bbf4c2b965faa839f960fa61506
diff --git a/tsconfig.js.json b/tsconfig.js.json index 893a8cd31..10902817b 100644 --- a/tsconfig.js.json +++ b/tsconfig.js.json @@ -9,6 +9,7 @@ /* All JavaScript targets from tsconfig.json include. */ "*.js", ".prettierrc.js" /* missed by above pattern */, + "*.cjs", "*.mjs", "lib/**/*.js",...
[ "tsconfig.js.json", "tsconfig.json" ]
[]
true
tj/commander.js
2,475
issue_to_patch
Warn users about MINGW64 Windows incompatibility with slash (/) arguments ## Docs: Add warning for Bash users about slash (`/`) being misinterpreted as a path ### Summary This documentation update adds a warning to help users avoid issues when using Commander CLI tools in **Git Bash / MINGW64** on Windows. In these...
docs: avoid MINGW64/Git Bash slash interpretation
## Summary Add documentation warning about forward slash (`/`) argument expansion in Git Bash (MINGW64) on Windows. Closes #2380 ## Changes - Added new section "Windows MINGW64 / Git Bash" to both English and Chinese READMEs - Documents the MSYS2 path conversion behavior that affects slash arguments - Provides prac...
17bf62c3f87d82bfdcb14a8b2006e94a6acd7e42
d1f3cca531f82806c83eb3427691800f11af2bc0
diff --git a/Readme.md b/Readme.md index 376458c96..da426f104 100644 --- a/Readme.md +++ b/Readme.md @@ -91,10 +91,10 @@ console.log(program.args[0].split(options.separator, limit)); ``` ```console -$ node split.js -s / --fits a/b/c +$ node split.js -s - --fits a-b-c error: unknown option '--fits' (Did you mean -...
[ "Readme.md", "Readme_zh-CN.md", "examples/split.js", "examples/string-util.js" ]
[]
true
tj/commander.js
2,472
issue_to_patch
Add describe wrappers so test output makes sense without filenames
Note: hide whitespace in the "Files changed" tab to greatly simply the diff! ## Problem The unit tests were written assuming the filename was visible in the output, as it was with Jest. With `node:test` the test output is supplied just by the tests without the filename visible. ## Solution Add describe wrap...
3dd608610b4e064b4d5d1ae133c3b3d5b469a198
c53f85f5db30b4d3f5c0d3547acd387a8fcae9dc
[ "tests/args.literal.test.js", "tests/args.variadic.test.js", "tests/argument.choices.test.js", "tests/argument.custom-processing.test.js", "tests/argument.required.test.js", "tests/argument.variadic.test.js", "tests/command.action.test.js", "tests/command.addCommand.test.js", "tests/command.addHelpO...
[]
diff --git a/tests/args.literal.test.js b/tests/args.literal.test.js index d11875eb0..b460f222a 100644 --- a/tests/args.literal.test.js +++ b/tests/args.literal.test.js @@ -1,5 +1,5 @@ const commander = require('../'); -const { test } = require('node:test'); +const { test, describe } = require('node:test'); const ass...
true
tj/commander.js
2,464
issue_to_patch
Switching to esm-only
## Problem Commander is written in CommonJS with shims for ESM imports and types, and a complex exports in `package.json`. It would be nice to move to ESM now that node supports `require(esm)`. We have a relatively low overhead CommonJS implementation with the ESM shim. This also avoids the dual-package hazard. H...
b51c0ea3d012ea165d7e50bb375f4db67b9d8e75
dc04a8c84f866d119a41d6078bd9a88d98acb3ca
diff --git a/.prettierrc.js b/.prettierrc.js index fa93574b4..f26a078b4 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,4 +1,4 @@ -const config = { +export default { singleQuote: true, overrides: [ { @@ -7,5 +7,3 @@ const config = { }, ], }; - -module.exports = config; diff --git a/CHANGELOG....
[ ".prettierrc.js", "CHANGELOG.md", "Readme.md", "docs/deprecated.md", "eslint.config.js", "esm.mjs", "examples/action-this.js", "examples/alias.cjs", "examples/argument.js", "examples/arguments-custom-processing.js", "examples/arguments-extra.js", "examples/configure-help.js", "examples/confi...
[ { "comment": "For interest: I was running each of the example files after updating, and the current version of commander picked up the error in the long option.", "path": "examples/custom-command-class.js", "hunk": "@@ -20,7 +20,7 @@ function inspectCommand(command) {\n }\n \n const program = new Comman...
diff --git a/examples/using-esm-from-commonjs/jest-javascript/index.spec.cjs b/examples/using-esm-from-commonjs/jest-javascript/index.spec.cjs new file mode 100644 index 000000000..66fcfa394 --- /dev/null +++ b/examples/using-esm-from-commonjs/jest-javascript/index.spec.cjs @@ -0,0 +1,9 @@ +const { Command } = require(...
true
tj/commander.js
2,464
comment_to_fix
Switching to esm-only
The URL appears to be broken - it's missing "commander." in the path. It should be `https://github.com/tj/commander.js/blob/master/lib/help.js` not `https://github.com/tj/js/blob/master/lib/help.js`. ```suggestion // See: https://github.com/tj/commander.js/blob/master/lib/help.js ```
b51c0ea3d012ea165d7e50bb375f4db67b9d8e75
dc04a8c84f866d119a41d6078bd9a88d98acb3ca
diff --git a/examples/configure-help.js b/examples/configure-help.js index 8e86d69a4..090d88b76 100644 --- a/examples/configure-help.js +++ b/examples/configure-help.js @@ -1,5 +1,5 @@ -const commander = require('commander'); -const program = new commander.Command(); +import { Command } from 'commander'; +const program...
[ "examples/configure-help.js" ]
[ { "comment": "The URL appears to be broken - it's missing \"commander.\" in the path. It should be `https://github.com/tj/commander.js/blob/master/lib/help.js` not `https://github.com/tj/js/blob/master/lib/help.js`.\n```suggestion\n// See: https://github.com/tj/commander.js/blob/master/lib/help.js\n```", "p...
true
tj/commander.js
2,464
comment_to_fix
Switching to esm-only
The JSDoc param order doesn't match the actual parameter order in the function signature. The JSDoc has `@param {Option} option` followed by `@param {Option} conflictingOption`, but the params were reordered in the diff with `@private` appearing between them. The correct order should be: ``` @param {Option} option @par...
b51c0ea3d012ea165d7e50bb375f4db67b9d8e75
dc04a8c84f866d119a41d6078bd9a88d98acb3ca
diff --git a/lib/command.js b/lib/command.js index 66379c0ff..d8b810a6c 100644 --- a/lib/command.js +++ b/lib/command.js @@ -1,16 +1,16 @@ -const EventEmitter = require('node:events').EventEmitter; -const childProcess = require('node:child_process'); -const path = require('node:path'); -const fs = require('node:fs'); -...
[ "lib/command.js" ]
[ { "comment": "The JSDoc param order doesn't match the actual parameter order in the function signature. The JSDoc has `@param {Option} option` followed by `@param {Option} conflictingOption`, but the params were reordered in the diff with `@private` appearing between them. The correct order should be:\n```\n@pa...
true
tj/commander.js
2,463
issue_to_patch
Switch from Jest to Node.js built-in test runner
## Problem I do like writing tests using Jest, but the ESM support is _still_ experimental (relies on a Node.js experimental flag). I hit this quickly when looking at converting Commander to esm-only. - https://jestjs.io/docs/ecmascript-modules ## Solution The radical approach in this PR is to switch to nativ...
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/eslint.config.js b/eslint.config.js index 550d944c1..a8a2e0bf4 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,6 +1,5 @@ const globals = require('globals'); const esLintjs = require('@eslint/js'); -const jest = require('eslint-plugin-jest'); const tseslint = require('typescript-eslint'); con...
[ "eslint.config.js", "package-lock.json", "package.json", "tests/args.literal.test.js", "tests/args.variadic.test.js", "tests/argument.chain.test.js", "tests/argument.choices.test.js", "tests/argument.custom-processing.test.js", "tests/argument.required.test.js", "tests/argument.variadic.test.js", ...
[ { "comment": "Unused variable describe.\n```suggestion\nconst { test } = require('node:test');\n```", "path": "tests/argument.custom-processing.test.js", "hunk": "@@ -1,14 +1,17 @@\n const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe } = ...
diff --git a/tests/args.literal.test.js b/tests/args.literal.test.js index c42f85365..d11875eb0 100644 --- a/tests/args.literal.test.js +++ b/tests/args.literal.test.js @@ -1,4 +1,6 @@ const commander = require('../'); +const { test } = require('node:test'); +const assert = require('node:assert/strict'); // Utility...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable describe. ```suggestion const { test } = require('node:test'); ```
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/argument.custom-processing.test.js b/tests/argument.custom-processing.test.js index 74444b79d..3facbf87c 100644 --- a/tests/argument.custom-processing.test.js +++ b/tests/argument.custom-processing.test.js @@ -1,14 +1,17 @@ const commander = require('../'); +const { createTestCommand } = require('./...
[ "tests/argument.custom-processing.test.js" ]
[ { "comment": "Unused variable describe.\n```suggestion\nconst { test } = require('node:test');\n```", "path": "tests/argument.custom-processing.test.js", "hunk": "@@ -1,14 +1,17 @@\n const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe } = ...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable beforeEach. ```suggestion const { test, describe } = require('node:test'); ```
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.addHelpOption.test.js b/tests/command.addHelpOption.test.js index 87272846a..5c8ca6f2e 100644 --- a/tests/command.addHelpOption.test.js +++ b/tests/command.addHelpOption.test.js @@ -1,53 +1,41 @@ -const { Command, Option } = require('../'); +const { Option } = require('../'); +const { createT...
[ "tests/command.addHelpOption.test.js" ]
[ { "comment": "Unused variable beforeEach.\n```suggestion\nconst { test, describe } = require('node:test');\n```", "path": "tests/command.addHelpOption.test.js", "hunk": "@@ -1,53 +1,41 @@\n-const { Command, Option } = require('../');\n+const { Option } = require('../');\n+const { createTestCommand } = r...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable afterEach. ```suggestion const { test, describe, beforeEach } = require('node:test'); ```
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.addHelpOption.test.js b/tests/command.addHelpOption.test.js index 87272846a..5c8ca6f2e 100644 --- a/tests/command.addHelpOption.test.js +++ b/tests/command.addHelpOption.test.js @@ -1,53 +1,41 @@ -const { Command, Option } = require('../'); +const { Option } = require('../'); +const { createT...
[ "tests/command.addHelpOption.test.js" ]
[ { "comment": "Unused variable afterEach.\n```suggestion\nconst { test, describe, beforeEach } = require('node:test');\n```", "path": "tests/command.addHelpOption.test.js", "hunk": "@@ -1,53 +1,41 @@\n-const { Command, Option } = require('../');\n+const { Option } = require('../');\n+const { createTestCo...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable beforeEach. ```suggestion const { test, describe } = require('node:test'); ```
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.allowUnknownOption.test.js b/tests/command.allowUnknownOption.test.js index fcf9e6cf9..36c2762b1 100644 --- a/tests/command.allowUnknownOption.test.js +++ b/tests/command.allowUnknownOption.test.js @@ -1,97 +1,79 @@ -const commander = require('../'); +const { createTestCommand } = require('./...
[ "tests/command.allowUnknownOption.test.js" ]
[ { "comment": "Unused variable beforeEach.\n```suggestion\nconst { test, describe } = require('node:test');\n```", "path": "tests/command.allowUnknownOption.test.js", "hunk": "@@ -1,97 +1,80 @@\n const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, d...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable exitSpy. ```suggestion t.mock.method(process, 'exit', () => {}); ```
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.error.test.js b/tests/command.error.test.js index e3b704017..070497187 100644 --- a/tests/command.error.test.js +++ b/tests/command.error.test.js @@ -1,22 +1,21 @@ const commander = require('../'); +const { test } = require('node:test'); +const assert = require('node:assert/strict'); -test...
[ "tests/command.error.test.js" ]
[ { "comment": "Unused variable exitSpy.\n```suggestion\n t.mock.method(process, 'exit', () => {});\n```", "path": "tests/command.error.test.js", "hunk": "@@ -1,22 +1,21 @@\n const commander = require('../');\n+const { test } = require('node:test');\n+const assert = require('node:assert/strict');\n \n-te...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -74,7 +61,8 @@ describe('.exitOverride and error details', () => {\n });\n \n // Same error as above, but with custom handler.\n- test('when supply custom handler then throw custom error', () => {\n+...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -211,10 +204,8 @@ describe('.exitOverride and error details', () => {\n );\n });\n \n- test('when specify --help then throw CommanderError', () => {\n- const writeSpy = jest\n- .spyOn(proce...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable stderrSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable stderrSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -231,10 +222,10 @@ describe('.exitOverride and error details', () => {\n 'commander.helpDisplayed',\n '(outputHelp)',\n );\n- writeSpy.mockRestore();\n });\n \n- test('when executab...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -248,10 +239,8 @@ describe('.exitOverride and error details', () => {\n expectCommanderError(caughtErr, 1, 'commander.help', '(outputHelp)');\n });\n \n- test('when specify --version then throw Com...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -287,7 +274,8 @@ describe('.exitOverride and error details', () => {\n });\n });\n \n- test('when mandatory program option missing then throw CommanderError', () => {\n+ test('when mandatory progr...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -307,7 +295,8 @@ describe('.exitOverride and error details', () => {\n );\n });\n \n- test('when option argument not in choices then throw CommanderError', () => {\n+ test('when option argument no...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -329,7 +318,8 @@ describe('.exitOverride and error details', () => {\n );\n });\n \n- test('when command argument not in choices then throw CommanderError', () => {\n+ test('when command argument ...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -351,7 +341,8 @@ describe('.exitOverride and error details', () => {\n );\n });\n \n- test('when custom processing for option throws InvalidArgumentError then catch CommanderError', () => {\n+ tes...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -374,7 +365,8 @@ describe('.exitOverride and error details', () => {\n );\n });\n \n- test('when custom processing for argument throws InvalidArgumentError then catch CommanderError', () => {\n+ t...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -399,7 +391,8 @@ describe('.exitOverride and error details', () => {\n );\n });\n \n- test('when has conflicting option then throw CommanderError', () => {\n+ test('when has conflicting option the...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable writeSpy.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.exitOverride.test.js b/tests/command.exitOverride.test.js index 65ae78383..fc2ab9f5a 100644 --- a/tests/command.exitOverride.test.js +++ b/tests/command.exitOverride.test.js @@ -1,39 +1,25 @@ const commander = require('../'); const path = require('path'); +const { test, describe } = require...
[ "tests/command.exitOverride.test.js" ]
[ { "comment": "Unused variable writeSpy.", "path": "tests/command.exitOverride.test.js", "hunk": "@@ -421,7 +414,8 @@ describe('.exitOverride and error details', () => {\n );\n });\n \n- test('when call error() then throw CommanderError', () => {\n+ test('when call error() then throw CommanderErr...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable beforeAll.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.helpCommand.test.js b/tests/command.helpCommand.test.js index 9dc39d39a..7b9c7bf54 100644 --- a/tests/command.helpCommand.test.js +++ b/tests/command.helpCommand.test.js @@ -1,40 +1,40 @@ const commander = require('../'); +const { createTestCommand } = require('./testHelpers'); +const { test...
[ "tests/command.helpCommand.test.js" ]
[ { "comment": "Unused variable beforeAll.", "path": "tests/command.helpCommand.test.js", "hunk": "@@ -1,170 +1,159 @@\n const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, beforeAll, afterEach, afterAll } = require('node:test');", "res...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable afterEach.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.helpCommand.test.js b/tests/command.helpCommand.test.js index 9dc39d39a..7b9c7bf54 100644 --- a/tests/command.helpCommand.test.js +++ b/tests/command.helpCommand.test.js @@ -1,40 +1,40 @@ const commander = require('../'); +const { createTestCommand } = require('./testHelpers'); +const { test...
[ "tests/command.helpCommand.test.js" ]
[ { "comment": "Unused variable afterEach.", "path": "tests/command.helpCommand.test.js", "hunk": "@@ -1,170 +1,159 @@\n const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, beforeAll, afterEach, afterAll } = require('node:test');", "res...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable afterAll.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.helpCommand.test.js b/tests/command.helpCommand.test.js index 9dc39d39a..7b9c7bf54 100644 --- a/tests/command.helpCommand.test.js +++ b/tests/command.helpCommand.test.js @@ -1,40 +1,40 @@ const commander = require('../'); +const { createTestCommand } = require('./testHelpers'); +const { test...
[ "tests/command.helpCommand.test.js" ]
[ { "comment": "Unused variable afterAll.", "path": "tests/command.helpCommand.test.js", "hunk": "@@ -1,170 +1,159 @@\n const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, beforeAll, afterEach, afterAll } = require('node:test');", "reso...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable before.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/command.unknownCommand.test.js b/tests/command.unknownCommand.test.js index d2415d9e6..68a880a0c 100644 --- a/tests/command.unknownCommand.test.js +++ b/tests/command.unknownCommand.test.js @@ -1,72 +1,54 @@ -const commander = require('../'); +const { createTestCommand } = require('./testHelpers'); +...
[ "tests/command.unknownCommand.test.js" ]
[ { "comment": "Unused variable before.", "path": "tests/command.unknownCommand.test.js", "hunk": "@@ -1,72 +1,54 @@\n-const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, before } = require('node:test');", "resolving_sha": "7f33b5da8f2c...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable before.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/incrementNodeInspectorPort.test.js b/tests/incrementNodeInspectorPort.test.js index 3da7a870f..5119dd89f 100644 --- a/tests/incrementNodeInspectorPort.test.js +++ b/tests/incrementNodeInspectorPort.test.js @@ -1,28 +1,23 @@ +const { test, describe, after } = require('node:test'); +const assert = requ...
[ "tests/incrementNodeInspectorPort.test.js" ]
[ { "comment": "Unused variable before.", "path": "tests/incrementNodeInspectorPort.test.js", "hunk": "@@ -1,28 +1,23 @@\n+const { test, describe, before, afterEach, after } = require('node:test');", "resolving_sha": "7f33b5da8f2c66ad77b8088c8a04e5b438b91321", "resolving_diff": "diff --git a/tests...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable afterEach.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/incrementNodeInspectorPort.test.js b/tests/incrementNodeInspectorPort.test.js index 3da7a870f..5119dd89f 100644 --- a/tests/incrementNodeInspectorPort.test.js +++ b/tests/incrementNodeInspectorPort.test.js @@ -1,28 +1,23 @@ +const { test, describe, after } = require('node:test'); +const assert = requ...
[ "tests/incrementNodeInspectorPort.test.js" ]
[ { "comment": "Unused variable afterEach.", "path": "tests/incrementNodeInspectorPort.test.js", "hunk": "@@ -1,28 +1,23 @@\n+const { test, describe, before, afterEach, after } = require('node:test');", "resolving_sha": "7f33b5da8f2c66ad77b8088c8a04e5b438b91321", "resolving_diff": "diff --git a/te...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable before.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/negatives.test.js b/tests/negatives.test.js index 74e6b4c2b..825c28e12 100644 --- a/tests/negatives.test.js +++ b/tests/negatives.test.js @@ -1,184 +1,122 @@ const { Command } = require('../'); +const { createTestCommand } = require('./testHelpers'); +const { test, describe } = require('node:test');...
[ "tests/negatives.test.js" ]
[ { "comment": "Unused variable before.", "path": "tests/negatives.test.js", "hunk": "@@ -1,184 +1,122 @@\n const { Command } = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, before, afterEach, after } = require('node:test');", "resolving_sha": "7f3...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable afterEach.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/negatives.test.js b/tests/negatives.test.js index 74e6b4c2b..825c28e12 100644 --- a/tests/negatives.test.js +++ b/tests/negatives.test.js @@ -1,184 +1,122 @@ const { Command } = require('../'); +const { createTestCommand } = require('./testHelpers'); +const { test, describe } = require('node:test');...
[ "tests/negatives.test.js" ]
[ { "comment": "Unused variable afterEach.", "path": "tests/negatives.test.js", "hunk": "@@ -1,184 +1,122 @@\n const { Command } = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, before, afterEach, after } = require('node:test');", "resolving_sha": "...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable after.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/negatives.test.js b/tests/negatives.test.js index 74e6b4c2b..825c28e12 100644 --- a/tests/negatives.test.js +++ b/tests/negatives.test.js @@ -1,184 +1,122 @@ const { Command } = require('../'); +const { createTestCommand } = require('./testHelpers'); +const { test, describe } = require('node:test');...
[ "tests/negatives.test.js" ]
[ { "comment": "Unused variable after.", "path": "tests/negatives.test.js", "hunk": "@@ -1,184 +1,122 @@\n const { Command } = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, before, afterEach, after } = require('node:test');", "resolving_sha": "7f33...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable beforeAll.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/options.mandatory.test.js b/tests/options.mandatory.test.js index 14824992b..644e9a564 100644 --- a/tests/options.mandatory.test.js +++ b/tests/options.mandatory.test.js @@ -1,4 +1,7 @@ const commander = require('../'); +const { createTestCommand } = require('./testHelpers'); +const { test, describe...
[ "tests/options.mandatory.test.js" ]
[ { "comment": "Unused variable beforeAll.", "path": "tests/options.mandatory.test.js", "hunk": "@@ -1,170 +1,142 @@\n const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, beforeAll, afterEach, afterAll } = require('node:test');", "resol...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable afterEach.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/options.mandatory.test.js b/tests/options.mandatory.test.js index 14824992b..644e9a564 100644 --- a/tests/options.mandatory.test.js +++ b/tests/options.mandatory.test.js @@ -1,4 +1,7 @@ const commander = require('../'); +const { createTestCommand } = require('./testHelpers'); +const { test, describe...
[ "tests/options.mandatory.test.js" ]
[ { "comment": "Unused variable afterEach.", "path": "tests/options.mandatory.test.js", "hunk": "@@ -1,170 +1,142 @@\n const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, beforeAll, afterEach, afterAll } = require('node:test');", "resol...
true
tj/commander.js
2,463
comment_to_fix
Switch from Jest to Node.js built-in test runner
Unused variable afterAll.
63eed4aa05435575d515311bb5efaf6d88b6be84
7f33b5da8f2c66ad77b8088c8a04e5b438b91321
diff --git a/tests/options.mandatory.test.js b/tests/options.mandatory.test.js index 14824992b..644e9a564 100644 --- a/tests/options.mandatory.test.js +++ b/tests/options.mandatory.test.js @@ -1,4 +1,7 @@ const commander = require('../'); +const { createTestCommand } = require('./testHelpers'); +const { test, describe...
[ "tests/options.mandatory.test.js" ]
[ { "comment": "Unused variable afterAll.", "path": "tests/options.mandatory.test.js", "hunk": "@@ -1,170 +1,142 @@\n const commander = require('../');\n+const { createTestCommand } = require('./testHelpers');\n+const { test, describe, beforeAll, afterEach, afterAll } = require('node:test');", "resolv...
true
tj/commander.js
2,405
issue_to_patch
Make order not matter for adding combo positive/negative options
## Problem Lone negated options default to true. (Historical.) Positive then negative does not default to true. (By design.) Negative then positive still defaults to true, for implementation reasons rather than by design. See: #2397 ## Solution Move the setting of the default to when the options are known...
2e96cd388764064fe271f7f452d0dff780355b42
bd63ba7520057e984f8649ead16e04256d377837
diff --git a/Readme.md b/Readme.md index b4f81f162..5fc98ac84 100644 --- a/Readme.md +++ b/Readme.md @@ -277,10 +277,7 @@ cheese: stilton ### Other option types, negatable boolean and boolean|value You can define a boolean option long name with a leading `no-` to set the option value to false when used. -Defined al...
[ "Readme.md", "examples/options-negatable.js", "lib/command.js", "tests/options.bool.combo.test.js" ]
[ { "comment": "Since the conditon is the same, how about not separating them so it is easier to understand?\r\n\r\n```suggestion\r\n if (this._savedState === null) {\r\n // Before parsing and before saving the state, do the special default of lone negated option to true.\r\n // Some paranoia about n...
diff --git a/tests/options.bool.combo.test.js b/tests/options.bool.combo.test.js index e95754c50..48b0153a6 100644 --- a/tests/options.bool.combo.test.js +++ b/tests/options.bool.combo.test.js @@ -149,3 +149,43 @@ describe('boolean option combo with non-boolean default and preset', () => { expect(program.opts().pe...
true
tj/commander.js
2,405
comment_to_fix
Make order not matter for adding combo positive/negative options
Since the conditon is the same, how about not separating them so it is easier to understand? ```suggestion if (this._savedState === null) { // Before parsing and before saving the state, do the special default of lone negated option to true. // Some paranoia about not overwriting a value since doi...
2e96cd388764064fe271f7f452d0dff780355b42
bd63ba7520057e984f8649ead16e04256d377837
diff --git a/lib/command.js b/lib/command.js index 192e221c4..3e9366410 100644 --- a/lib/command.js +++ b/lib/command.js @@ -675,17 +675,7 @@ Expecting one of '${allowedValues.join("', '")}'`); const name = option.attributeName(); // store default value - if (option.negate) { - // --no-foo is specia...
[ "lib/command.js" ]
[ { "comment": "Since the conditon is the same, how about not separating them so it is easier to understand?\r\n\r\n```suggestion\r\n if (this._savedState === null) {\r\n // Before parsing and before saving the state, do the special default of lone negated option to true.\r\n // Some paranoia about n...
true