instance_id
stringlengths
10
65
repo
stringlengths
5
59
pr_number
int64
1
313k
task_type
stringclasses
1 value
base_commit
stringlengths
40
40
review_commit
stringlengths
40
40
title
stringlengths
2
282
body
stringlengths
7
3k
patch
stringlengths
202
204k
n_defects
int64
1
72
n_supported
int64
1
65
n_major
int64
0
32
defects
stringlengths
140
18.8k
certifier_count
int64
spesmilo__electrum__10059
spesmilo/electrum
10,059
defect
ba07ca3ab9d4118cde7bce4db22c212a8eafb1f1
8f9951ebedf4120f4c31d111630c003994d8ea5a
fix: cli: check_hold_invoice showing settled invoice as unpaid
the cli command `check_hold_invoice` incorrectly assumes that `lnworker.is_accepted_mpp(payment_hash)` is true for settled invoices, however it is not, as the received mpp entries will be removed from the `lnworker.received_mpp_htlcs` shortly after adding the preimage to lnworker (after the htlcs got removed from the c...
diff --git a/electrum/commands.py b/electrum/commands.py index ff925d68de3b..eb3641474ed5 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -1427,6 +1427,8 @@ async def settle_hold_invoice(self, preimage: str, wallet: Abstract_Wallet = Non assert payment_hash in wallet.lnworker.dont_settle_htlcs,...
1
1
0
[{"id": "G0", "claim": "The result key should be renamed from \"amount_sat_received\" to \"received_amount_sat\", and an extra field \"invoice_amount_sat\" (the invoice's own amount in satoshis) should be added to the check_hold_invoice response as a sanity check for the user.", "category": "design", "verdict": "suppor...
null
spesmilo__electrum__10067
spesmilo/electrum
10,067
defect
8eb3c43603ed1915fa3e0b8d17c9dbeb183270c5
22410157422fde986fe6b0d08981a22c017a548b
cli: add max_cltv, max_fee_msat parameters to lnpay
Adds `max_cltv`, `max_fee_millionths` and `fee_cutoff_msat` parameters to the `lnpay` cli command which allow to specify a custom `PaymentFeeBudget` for the lnpay payment. Allowing to specify a these parameters can be useful for usecases like https://github.com/spesmilo/electrum/issues/10056. Closes #10056
diff --git a/electrum/commands.py b/electrum/commands.py index f85d15eee20f..09e418ed0336 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -67,7 +67,8 @@ ) from .address_synchronizer import TX_HEIGHT_LOCAL from .mnemonic import Mnemonic -from .lnutil import channel_id_from_funding_tx, LnFeatures, SENT...
2
2
0
[{"id": "G0", "claim": "It may be useful to let the user override the fee calculation via an argument to lnpay (a max fee), so a proxy service can cap the fee paid to route a payment.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "It would be simpler f...
null
spesmilo__electrum__10091
spesmilo/electrum
10,091
defect
4a370af64a8df5041dd5837dfc0c366a6a6796a9
5010814cc94aba0a83c67e95365094c341c54fda
wallet: don't spend reserve utxo to create new reserve utxo
Right now if a lightning reserve utxo is required and there is already a reserve sized utxo available, `make_unsigned_transaction()` will still add the reserve as input to a 'spend max' transaction and add a reserve change output. This seems wasteful, this patch instead just removes the input from the tx so it is not ...
diff --git a/electrum/gui/qml/qetxfinalizer.py b/electrum/gui/qml/qetxfinalizer.py index bafe4a6c4090..1b378d608b41 100644 --- a/electrum/gui/qml/qetxfinalizer.py +++ b/electrum/gui/qml/qetxfinalizer.py @@ -434,7 +434,10 @@ def update(self): self.update_fee_warning_from_tx(tx=tx, invoice_amt=amount) ...
2
2
0
[{"id": "G0", "claim": "The test should additionally assert that wallet1's remaining spendable coin is exactly the LN_UTXO_RESERVE value, e.g. by repeating the sum assert or asserting get_spendable_coins()[0].value_sats() == config.LN_UTXO_RESERVE.", "category": "testing", "verdict": "supported", "priority": "P2", "sco...
null
spesmilo__electrum__10216
spesmilo/electrum
10,216
defect
47f1a2d7a2805139358ea25f1d819467438ebfa5
4d0a082e1e3b636af8e6b9dd955dee6e67eaa5ac
adb: change API of util.TxMinedInfo: height() is now always SPV-ed
Conceptually this is quite an invasive change that transforms unverified txs to unconfirmed txs. I think it is a code-safety improvement that might prevent security-bugs. In particular the TxInput.block_height and TxInput.spent_height not being SPV-ed was really bothering me. This fixes that.
diff --git a/electrum/address_synchronizer.py b/electrum/address_synchronizer.py index 1f28c28da38c..a946426e8a23 100644 --- a/electrum/address_synchronizer.py +++ b/electrum/address_synchronizer.py @@ -23,6 +23,7 @@ import asyncio import copy +import dataclasses import threading import itertools from collection...
1
1
0
[{"id": "G0", "claim": "The requires_spv keyword-only option of the new TxMinedInfo.height() method is unused anywhere, so the reviewer questions whether it needs to be added at all.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
spesmilo__electrum__10271
spesmilo/electrum
10,271
defect
828fc569c95e8ddcfa12237bf8df44ff1a322fbb
8a40feb2459029d4d5350c2305f39fae16ef758e
lightning: fix self payments (e.g. rebalance)
Allows storing two different payment info of the same payment hash by including the direction into the db key. We create and store PaymentInfo for sending attempts and for receive requests, if we try to pay ourself (e.g. through a channel rebalance) the checks in `save_payment_info` would prevent this and throw an ...
diff --git a/electrum/commands.py b/electrum/commands.py index 6aef50cecda9..6482b0b3dbac 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -70,7 +70,7 @@ ) from .address_synchronizer import TX_HEIGHT_LOCAL from .mnemonic import Mnemonic -from .lnutil import (channel_id_from_funding_tx, LnFeatures, SEN...
3
3
0
[{"id": "G0", "claim": "The assertion message should use type(invoice) instead of type(invoice_id), since it asserts on invoice.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The payment-info db key construction f\"{...hex()}:{int(direction)}\" is ...
null
spesmilo__electrum__10283
spesmilo/electrum
10,283
defect
6423323037f2a83898dc83fdf0b4492998a0e99b
aaded2238845ca4ce810eba3919451f01c19a85a
cli: fix add_peer command
The timeout parameter of `add_peer` is unused and peer initialization was never awaited in the `add_peer` method, it just instantly returned True which is misleading. This change marks `timeout` as deprecated as we always use `lnworker.LN_P2P_NETWORK_TIMEOUT` in LNPeer and awaits the initialization of the peer so th...
diff --git a/electrum/commands.py b/electrum/commands.py index 2b2312138e2f..388cfdf7d547 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -44,6 +44,7 @@ from . import util from .lnmsg import OnionWireSerializer +from .lnworker import LN_P2P_NETWORK_TIMEOUT from .logging import Logger from .onion_m...
3
2
2
[{"id": "G0", "claim": "The timeout parameter of add_peer is not unused — it still has an effect in some cases (e.g. as the daemon command timeout), so marking it DEPRECATED with a todo to remove it is wrong.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "cl...
null
spesmilo__electrum__10303
spesmilo/electrum
10,303
defect
d7bc617034377119523709c504edb1205eaae34c
24710ec4172e6d66b10a1190ff7a1dd50921c559
swaps/qt: expose swaps to external address
Allows to do reverse submarine swaps to an external address and exposes this as "Submarine Payment" tab in the `ConfirmTxDialog`. Does a wallet upgrade conflicting with https://github.com/spesmilo/electrum/pull/10230, if switching between these branches the db needs to be manually edited.
diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py index d6047eb24e99..fe1b5e5b33ed 100644 --- a/electrum/gui/qt/confirm_tx_dialog.py +++ b/electrum/gui/qt/confirm_tx_dialog.py @@ -23,50 +23,61 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +i...
4
4
1
[{"id": "G0", "claim": "Enabling Submarine Payments for Max-spend transactions makes little sense and the submarine tab should be disabled in that case instead.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Now that pubkey_to_q_icon has been made public...
null
spesmilo__electrum__10321
spesmilo/electrum
10,321
defect
30f2bc9eb8a0febfdef77de197b223e1e171dcfc
4a63916d5ee28392f74f2bcac5b3c27f8a51b59c
qml millisat precision fix
should fix #10320
diff --git a/electrum/gui/qml/components/InvoiceDialog.qml b/electrum/gui/qml/components/InvoiceDialog.qml index 59590c6228c1..cc303f320b33 100644 --- a/electrum/gui/qml/components/InvoiceDialog.qml +++ b/electrum/gui/qml/components/InvoiceDialog.qml @@ -223,12 +223,13 @@ ElDialog { Lay...
3
1
1
[{"id": "G0", "claim": "QEAmount's amount_sat and amount_msat are not guaranteed to be in sync, which is error-prone; internally QEAmount should store a single integer and expose sat vs msat through getters.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim"...
null
spesmilo__electrum__10541
spesmilo/electrum
10,541
defect
bd4439945a265b56205aa75121a48e4ab065a8b5
a5e91e72edf4c96f6b315d56beaa62b03c0eb454
lnwallet: also signal trampoline support in invoice features if trampoline is disabled
Changes the behavior of LNWallet to also set the trampoline feature bit in bolt 11 invoice features if all the open channels are to trampoline peers. (Note: we could even signal trampoline support if we have at least one trampoline channel that can receive the requested amount, but this is already an enhancement and ...
diff --git a/electrum/lnchannel.py b/electrum/lnchannel.py index 06f2a943cf0a..bf9b80717780 100644 --- a/electrum/lnchannel.py +++ b/electrum/lnchannel.py @@ -1101,8 +1101,6 @@ def set_frozen_for_sending(self, b: bool) -> None: util.trigger_callback('channel', self.lnworker.wallet, self) def is_frozen_f...
2
2
0
[{"id": "G0", "claim": "The decision to enable trampoline support in the invoice should not depend on whether trampoline routing is enabled; it should be enabled if and only if all non-frozen (manually by the user) channels are with trampoline nodes, and channels should stop being automatically frozen for receiving whe...
null
spesmilo__electrum__10622
spesmilo/electrum
10,622
defect
be2096f842c1c52e861aef95fc54fefcc6468038
f9297199bcf8e2e646e0cd02ee7207f0d70b6cff
lnpeer: clean-up channel_type and enforce all newly opened channels use anchors
alternative to https://github.com/spesmilo/electrum/pull/10620 and lots of related clean-up As in https://github.com/spesmilo/electrum/pull/10620#issue-4357139535 : > This will prevent opening new outgoing and incoming SRK channels. > It will also prevent connecting to peers that don't signal anchor support at ...
diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index e8f8d73883d4..a101f4c88998 100644 --- a/electrum/lnpeer.py +++ b/electrum/lnpeer.py @@ -922,9 +922,6 @@ def accepts_zeroconf(self): def is_upfront_shutdown_script(self): return self.features.supports(LnFeatures.OPTION_UPFRONT_SHUTDOWN_SCRIPT_OPT) ...
2
1
0
[{"id": "G0", "claim": "In channel_establishment_flow the new code reaches the config via self.lnworker.config instead of using the self.config property the pull request just introduced.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "In the non-...
null
spesmilo__electrum__10653
spesmilo/electrum
10,653
defect
b27ab84421d2ddf276bf75298c65ee825ce2327f
b76d9515605416a84aad0030ba176aa8e36c9ef6
lnwallet: fix rebalancing/pathfinding regression, add unittests
Don't exclude r_tags for frozen channels from the route creation in create_route_for_single_htlc if the start_node of the routing hint is not our node id. When doing a rebalance from us (chan_1) -> bob -> us (chan_2, frozen for sending), we would exclude the invoice r_tag for chan_2 because the chan is our chan a...
diff --git a/electrum/lnworker.py b/electrum/lnworker.py index 92ae704a5ad8..c19d01443ec6 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -2586,7 +2586,8 @@ def create_route_for_single_htlc( for end_node, edge_rest in zip(private_path_nodes, private_path_rest): short_channe...
1
1
0
[{"id": "G0", "claim": "The PR's new test helpers in tests/test_lnwallet.py mostly duplicate test_lnpeer.TestPeer.prepare_chans_and_peers_in_graph and should be de-duplicated by splitting the helper off into a new shared module and reusing it, which also requires extending graph_definition to allow multiple direct chan...
null
spesmilo__electrum__7202
spesmilo/electrum
7,202
defect
1d8b1ef69897ccb94f337a10993ca5d2b7a46741
49470a34f63b2bd68256bb671471882ef3257fe1
MPP splitting algorithm: redesign and split within channels
Changes the splitting algorithm to an easier approach and allows for split amounts in individual channels. Fixes #7180. I redesigned the splitting algorithm, which is in my view easier to understand and maintain. The main change is how the split configurations are created. Here, I'm using a more top-down probabilist...
diff --git a/electrum/lnworker.py b/electrum/lnworker.py index cd0f8983a576..695fe27d74b3 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -1508,7 +1508,7 @@ def create_routes_for_payment( # to a single node due to some incompatibility in Eclair, see: # https://github.com/ACINQ/...
3
1
0
[{"id": "G0", "claim": "The if statement guarding the per-part loop in create_routes_for_payment's non-trampoline branch is redundant.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "When a payment over a single channel does not succeed as a sing...
null
spesmilo__electrum__7542
spesmilo/electrum
7,542
defect
1ff9f9910f1a8d17ebba04439c1fcaf1476b3e8f
b339279ff2aa569aae7822998198f77e1ceeacae
Implement recent spec changes regarding collab channel close outputs
Fixes #7541 * Implements `option_shutdown_anysegwit`, which lets peers close their channels to taproot scripts. * Constrains the allowed shutdown scriptpubkeys to only segwit types. * The dust limit is negotiated at channel opening. We currently reject dust limits that are lower than 546 sat, which leads to #7541 ...
diff --git a/electrum/bitcoin.py b/electrum/bitcoin.py index 64682dd4a49d..8a79dbca9684 100644 --- a/electrum/bitcoin.py +++ b/electrum/bitcoin.py @@ -349,8 +349,12 @@ def relayfee(network: 'Network' = None) -> int: # see https://github.com/bitcoin/bitcoin/blob/a62f0ed64f8bbbdfe6467ac5ce92ef5b5222d1bd/src/policy/p...
10
9
4
[{"id": "G0", "claim": "The new upper-bound dust-limit check in validate_params compares with `<` where it should compare with `>`, so it rejects every dust limit below the cap and accepts ones above it.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim":...
null
spesmilo__electrum__7545
spesmilo/electrum
7,545
defect
1ff9f9910f1a8d17ebba04439c1fcaf1476b3e8f
0911abaf446c3c7e3147744dc626db359579aa4a
Add support for Unix domain sockets
This patch adds support for Unix domain sockets to Electrum. To use, spawn the daemon with `-u` or `--unixdomain`, e.g.: `electrum daemon -du` You can also specify a path for the domain socket manually with the `--sockpath` argument, e.g.: `electrum daemon -du --sockpath=$(mktemp --dry-run)` An integration test...
diff --git a/electrum/commands.py b/electrum/commands.py index f33a2ad4d305..28724c9dd36f 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -1475,6 +1475,8 @@ def get_parser(): # daemon parser_daemon = subparsers.add_parser('daemon', help="Run Daemon") parser_daemon.add_argument("-d", "--de...
6
6
3
[{"id": "G0", "claim": "The new `-u` shorthand for `--unixdomain` collides with the existing `--unsigned` option's shorthand, so the shorthand should be omitted.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The unix-socket CLI options, config vars...
null
spesmilo__electrum__7623
spesmilo/electrum
7,623
defect
27fb5a6dbd731030f26bc9ff3ea01de9d6389445
b21df8c90241f6753a77d998da8019edf37b9d64
Multi-trampoline multipart payments
~~Based on #7426 (first four commits) and~~ partially fixes #7604, related to #7648. * Refactored `create_trampoline_route`. * Enables end-to-end multi-trampoline multipart payments. Trampoline-to-legacy payments are still not enabled, as this is currently not supported by Eclair. * Reintroduces a global trampolin...
diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index 8be82c3c1a0c..2e1675549e8f 100644 --- a/electrum/lnpeer.py +++ b/electrum/lnpeer.py @@ -1459,6 +1459,7 @@ def maybe_forward_trampoline( invoice_features = payload["invoice_features"]["invoice_features"] invoice_routing_info = p...
2
1
1
[{"id": "G0", "claim": "Removing the fallback from two trampoline forwarders to one for legacy payments is questioned: the e2e approach of reverting to a global fee level could be used instead of dropping the second hop, and instead of immediately falling back to a single TF a new two-TF route excluding the failed one ...
null
spesmilo__electrum__8924
spesmilo/electrum
8,924
defect
d120492664112145384ce5c7427c53c549a01052
3ff48775921a33129a363bde1ade413c1c7da93d
Fix swapserver trampoline
lnpeer: fix #8825 In maybe_fulfill_htlc, return two items: (preimage, (payment_key, callback)). Rationale: The caller needs a payment_key only if we return a callback. If we do not, the caller should use the payment_key that was previously stored in channel.unfulfilled_htlcs ...
diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index 36f84a2be4a2..3e0c4b1a34a9 100644 --- a/electrum/lnpeer.py +++ b/electrum/lnpeer.py @@ -2024,20 +2024,20 @@ def maybe_fulfill_htlc( ) -> Tuple[Optional[str], Optional[bytes], Optional[Callable[[], Awaitable[Optional[str]]]]]: """ Decide w...
2
2
1
[{"id": "G0", "claim": "The return type-hint of maybe_fulfill_htlc should also be updated to match the new return shape the pull request introduced.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Since the first part of the if is guaranteed to retur...
null
spesmilo__electrum__9260
spesmilo/electrum
9,260
defect
c58c4d7451a537750c1b45c6f9c145a422158028
49b5b43d2f02e2f276e5a73973384170c0873f9a
Swaps over nostr
Swaps over Nostr: - Separation between SwapManager and its transport: Legacy transpport uses http, Nostr uses websockets - The transport uses a context to open/close connections. This context is not async, because it needs to be called from the GUI - Initialize swapserver fees values to None instead of 0 (so that th...
diff --git a/contrib/requirements/requirements.txt b/contrib/requirements/requirements.txt index 8ccf307b3e5d..52b9f772f24d 100644 --- a/contrib/requirements/requirements.txt +++ b/contrib/requirements/requirements.txt @@ -8,6 +8,7 @@ certifi attrs>=20.1.0 jsonpatch electrum_ecc +electrum_aionostr # Note that we ...
2
1
1
[{"id": "G0", "claim": "use_nostr is defined implicitly as a non-empty relay set, so the user can be asked about enabling nostr more than once and must empty the relay set to disable nostr; it should instead be a separate bool config option exposed in the preferences so the question is asked only once.", "category": "d...
null
spesmilo__electrum__9507
spesmilo/electrum
9,507
defect
309b2a96afa3b8355e6f8f83ba7489e1bd8d36f1
6d6a31b0839ae5bf389909fed8fad714f5399c2f
qt: refactor NetworkChoiceLayout to ProxyWidget+ServerWidget
The wizard was already using `ProxyWidget` and `ServerWidget`, which are a refactor of `NetworkChoiceLayout`. This commit refactors the 'regular' network settings dialog to the same components. Proxy settings are refactored to `ProxySettings` class, replacing the dict and encapsulating most proxy settings related...
diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py index 53cd67f168b4..93cea0652fc7 100644 --- a/electrum/gui/qt/__init__.py +++ b/electrum/gui/qt/__init__.py @@ -256,7 +256,6 @@ def _cleanup_before_exit(self): window.clean_up() if self.network_dialog: self.network...
2
2
1
[{"id": "G0", "claim": "The PR removes the pre-existing one-click 'use detected Tor proxy' UI entirely, and the reviewer asks for an equivalent way to apply a detected Tor proxy to be restored (a button or otherwise), the author proposing probe-on-enable with a yes/no confirmation popup.", "category": "design", "verdic...
null
spesmilo__electrum__9542
spesmilo/electrum
9,542
defect
36efae38757ff37a3ac29c55e9a7633c77424840
0bd23d1a48bc00323ee2e4aa4d004ca99f42f894
Introduce incoming gossip query handling and forwarding
This PR implements handling the [query messages](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#query-messages) defined in BOLT-7. Only `LNWallet` peers forward gossip messages and handle queries. This allows peers to find us (`LNWallet` publishes `node_announcement`), and prevents peers from qu...
diff --git a/electrum/channel_db.py b/electrum/channel_db.py index cc81be62c4b4..3d820aec17cf 100644 --- a/electrum/channel_db.py +++ b/electrum/channel_db.py @@ -43,7 +43,8 @@ from . import constants, util from .util import profiler, get_headers_dir, is_ip_address, json_normalize, UserFacingException, is_private_net...
20
15
3
[{"id": "G0", "claim": "Testing the dont_forward bit with `policy.message_flags == 1` is a weird way to check the bit and mishandles future unknown flag bits, and the same check appears in a second place.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim"...
null
spesmilo__electrum__9568
spesmilo/electrum
9,568
defect
18baf003d48b80576fbcf9bd8994fbe473ae867b
b1120f152c523bcd3a1e6eaf6ea3490f8b7c3dd0
Ignore odd bits if even bit is set too in list_enabled_bits
We use `list_enabled_bits()` to get the features we signal in ln/gossip messages. Bolt 9 specifies: > MUST NOT set both the optional and mandatory bits. We however set both, optional and required features in messages because `list_enabled_bits()` returns them both if they are set in a LnFeatures instance. This c...
diff --git a/electrum/lnutil.py b/electrum/lnutil.py index 1ad1703aeb75..f233edaf5982 100644 --- a/electrum/lnutil.py +++ b/electrum/lnutil.py @@ -1453,13 +1453,13 @@ class LnFeatures(IntFlag): def validate_transitive_dependencies(self) -> bool: # for all even bit set, set corresponding odd bit: ...
2
2
2
[{"id": "G0", "claim": "The loop building enabled_bits by repeatedly concatenating tuples makes list_enabled_bits quadratic instead of linear in the size of rev_bin; it should accumulate in a list (or set) and convert to a tuple at the end of the loop.", "category": "performance", "verdict": "supported", "priority": "P...
null
spesmilo__electrum__9580
spesmilo/electrum
9,580
defect
30901212d0e4cb503bf0f76f6a5a3c1b0473de2c
d005da1ea248df1c99883860c893644c924621dc
reintroduce separate request types for lightning and onchain
This PR removes on-chain fallback addresses in bolt11 invoices, and removes gap limit restrictions on the number of lightning invoices that can be created. In the GUI, it reintroduces the previous design with two buttons in the receive tab, which is simpler. The QML component `ReceiveDialog.qml` needs further simpli...
diff --git a/electrum/commands.py b/electrum/commands.py index 38d8561567aa..bf0ebaa0c4ec 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -1074,17 +1074,20 @@ async def getunusedaddress(self, wallet: Abstract_Wallet = None): return wallet.get_unused_address() @command('w') - async def...
3
1
1
[{"id": "G0", "claim": "The create_request change makes the WALLET_BOLT11_FALLBACK config setting, which is exposed to the GUIs, useless, so its config key should be removed (as the removal of the unit test checking such addresses are reused suggests was forgotten).", "category": "correctness", "verdict": "supported", ...
null
spesmilo__electrum__9628
spesmilo/electrum
9,628
defect
9d0cc6c4a35af8ecde13d9f9dc413be5becd6472
fd7f547b8c0d153b9f813ebf51f0ecb38e941c3e
Fail incoming htlcs if we forwarded and chan was force-closed (fix #8547)
call lnworker.htlc_failed once the htlc_tx is deeply mined. In the case of a forwarding, this will fail incoming htlcs. (fixes #8547)
diff --git a/electrum/lnchannel.py b/electrum/lnchannel.py index 2562e78e3acb..e051e2191582 100644 --- a/electrum/lnchannel.py +++ b/electrum/lnchannel.py @@ -321,7 +321,7 @@ def sweep_ctx(self, ctx: Transaction) -> Dict[str, SweepInfo]: def maybe_sweep_htlcs(self, ctx: Transaction, htlc_tx: Transaction) -> Dict[s...
5
5
1
[{"id": "G0", "claim": "Keep the `# ^ note: log message text grepped for in regtests` comment together with the log line it annotates, instead of leaving it in the second `if preimage:` block.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The r...
null
spesmilo__electrum__9648
spesmilo/electrum
9,648
defect
bea4c617f6706f21b52e8c578506bfc1d7bbb652
bfb76ff2a364d3d29b1ab6dd4b7d309d936d503d
config vars for plugins
- probably needs a better way to pass default value and type - needs to set `SimpleConfig._init_done`: we are currently passing the config object to the constructor of Plugins(). That might be easier if we passed Plugins to the constructor of SimpleConfig
diff --git a/electrum/plugin.py b/electrum/plugin.py index ca99ed530856..4b0fb5c2219b 100644 --- a/electrum/plugin.py +++ b/electrum/plugin.py @@ -117,6 +117,13 @@ def find_internal_plugins(self): if 'fullname' not in d: continue d['display_name'] = d['fullname'] + + ...
1
1
1
[{"id": "G0", "claim": "The PR removes the SWAPSERVER_ANN_POW_NONCE (swapserver_ann_pow_nonce) config var from SimpleConfig even though it is still used in submarine_swaps.py, so removing it breaks that module.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
spesmilo__electrum__9681
spesmilo/electrum
9,681
defect
bf317af30b94d0d0388c71da5f884619cd65b940
c764c7b16814459a7e55f9d11f1e7d6c782f8385
wallet: make txbatcher wait for network connection
Currently txbatcher deletes a batch when there is no network connection as a `NoDynamicFeeEstimates()` exception is raised. We can make the txbatcher wait for network connection like this PR does to prevent this, or is there a point in txbatcher iterating even if no network connection is available? Conceptually i think...
diff --git a/electrum/txbatcher.py b/electrum/txbatcher.py index 23300300b779..73e29ffe8733 100644 --- a/electrum/txbatcher.py +++ b/electrum/txbatcher.py @@ -10,7 +10,10 @@ from .transaction import PartialTransaction, PartialTxOutput, Transaction from .address_synchronizer import TX_HEIGHT_LOCAL, TX_HEIGHT_FUTURE f...
2
2
0
[{"id": "G0", "claim": "The parenthesised compound condition is unclear: if parentheses are kept for clarity they should close after `password`, or better each logical check should get its own `if` with a duplicated early exit.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introdu...
null
spesmilo__electrum__9689
spesmilo/electrum
9,689
defect
bf317af30b94d0d0388c71da5f884619cd65b940
ae7a100435616231bc57a417d45456fbedeb62c3
lightning: don't use fallback feerates for lightning fee estimation
Stops using a fallback feerate for lightning fee estimation function (`current_target_feerate_per_kw()`) and prevents trying channel reestablishment before we have fee estimates available and are fully synced to prevent errors like this and resulting causing force closes: ``` INFO | lnpeer.Peer.[LNWallet, ...] | remo...
diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index 820d9b6561c2..a306789f695b 100644 --- a/electrum/lnpeer.py +++ b/electrum/lnpeer.py @@ -23,8 +23,8 @@ from . import bitcoin, util from . import constants from .util import (bfh, log_exceptions, ignore_exceptions, chunks, OldTaskGroup, - Unr...
2
2
0
[{"id": "G0", "claim": "In channel_establishment_flow and maybe_update_fee the new feerate guards should test `feerate is None` / `feerate_per_kw is None` instead of truthiness, as suggested.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `a...
null
spesmilo__electrum__9704
spesmilo/electrum
9,704
defect
282c4561ff0b2f9854694ac76bbf9e1ae5619050
8d84008f5be2c636e6c86cfc9aa0075ecdba83d4
tx / gui: Disable output value rounding for 0 fee tx and don't show relay fee warning in gui
Disable output value rounding for txs intended to have 0 fees (future txs) in `_change_amounts()` so it doesn't add a small fee due to rounding. Also stops showing the below relay fee warning in the gui if the tx is a future tx. Before: ![Screenshot_20250407_114617](https://github.com/user-attachments/assets/0f...
diff --git a/electrum/coinchooser.py b/electrum/coinchooser.py index b974db5f5137..ae97d7d5004b 100644 --- a/electrum/coinchooser.py +++ b/electrum/coinchooser.py @@ -201,7 +201,10 @@ def trailing_zeroes(val): # Last change output. Round down to maximum precision but lose # no more than 10**max_dp_to...
1
1
0
[{"id": "G0", "claim": "A unit test should be written for the new zero-fee no-rounding behaviour in test_coinchooser.py.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
spesmilo__electrum__9733
spesmilo/electrum
9,733
defect
eff8b65355a1b645fd36322a4684e55ae20b04ea
523706302b39b53e2397df0c9a9330bcd4906833
lightning: stop including all invoice r_tags in legacy trampoline onion
This change makes `create_trampoline_onion()` only include as many of the available r_tags as there is space left in the trampoline onion. Previously it tried to include all passed invoice r_tags into the trampoline onion payload which caused an user facing exception and payment failure as the onion can only store a...
diff --git a/electrum/lnrouter.py b/electrum/lnrouter.py index 21021a9f95d7..4e52d481133f 100644 --- a/electrum/lnrouter.py +++ b/electrum/lnrouter.py @@ -25,7 +25,7 @@ import queue from collections import defaultdict -from typing import Sequence, Tuple, Optional, Dict, TYPE_CHECKING, Set, Callable +from typing imp...
1
1
0
[{"id": "G0", "claim": "create_trampoline_onion should not side-effect (shuffle in place) the caller's route argument; either operate consistently on the mutated list with the mutation clearly signalled, or avoid mutating it by using util.random_shuffled_copy to take a shuffled copy of the r_tags.", "category": "design...
null
spesmilo__electrum__9826
spesmilo/electrum
9,826
defect
660ffa2b8fa893ebd0e445c73e99e36473884eb5
d2b79419d6c93ae5c8c90497c8656702c1f9130f
fix: reduce update_fee target for anchor channels
the update_fee logic for lightning channels is not adapted to anchor channels causing us to send update_fee with a eta target of 2 blocks, while for anchor channels it is enough to just get into the mempool as the fee can be bumped later. This causes force closes when there are mempool spikes as the fees we try to upda...
diff --git a/electrum/fee_policy.py b/electrum/fee_policy.py index cfb1909c4f51..f09f458cab98 100644 --- a/electrum/fee_policy.py +++ b/electrum/fee_policy.py @@ -11,7 +11,9 @@ if TYPE_CHECKING: from .network import Network -FEE_ETA_TARGETS = [25, 10, 5, 2, 1] +# 1008 = max conf target of core's estimatesmartfe...
4
4
1
[{"id": "G0", "claim": "The \"new feerate\" log statement should probably report the value the fee is actually being updated to (update_feerate_per_kw) instead of current_feerate_per_kw, and the current_/update_ variable split is confusing.", "category": "maintainability", "verdict": "supported", "priority": "P2", "sco...
null
spf13__afero__134
spf13/afero
134
defect
9be650865eab0c12963d8753212f4f9c66cdcf12
b08da71c2ece950d9939f937d598b79aa2bf1099
mem/file.go - Fix some races in accessing fields of FileData
* Splitting SetModeTime to avoid double locking * Adding locks all over the place. Potential fix for #133
diff --git a/mem/file.go b/mem/file.go index e41e0123..1415ef7e 100644 --- a/mem/file.go +++ b/mem/file.go @@ -74,14 +74,24 @@ func CreateDir(name string) *FileData { } func ChangeFileName(f *FileData, newname string) { + f.Lock() + defer f.Unlock() f.name = newname } func SetMode(f *FileData, mode os.FileMod...
2
2
0
[{"id": "G0", "claim": "Do not use `defer` to unlock in ChangeFileName and SetMode when the methods are so short.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "It would be great to add a test that demonstrates the race problem.", "category": "t...
null
spf13__afero__147
spf13/afero
147
defect
8d919cbe7e2627e417f3e45c3c0e489a5b7e2536
4f332f79e74c34224b74286536c151403cb3cf92
fix File.Name() on BasePathFS (wrap File objects returned by BasePathFs)
Files returned by the BasePathFs operations don't report a usable name (using `file.Name()`) since they include the prefix, which is prepended a second time by the Fs when passed back. For instance, the following doesn't work: ```go osfs := afero.NewOsFs() bfs := afero.NewBasePathFs(osfs, "/some/base/path") f, _ ...
diff --git a/basepath.go b/basepath.go index 5e4fc2ec..004aeaa5 100644 --- a/basepath.go +++ b/basepath.go @@ -22,6 +22,16 @@ type BasePathFs struct { path string } +type BasePathFile struct { + File + path string +} + +func (f *BasePathFile) Name() string { + sourcename := f.File.Name() + return strings.TrimPre...
2
2
1
[{"id": "G0", "claim": "The pull request should add the tests ts2909 wrote for the BasePathFs Name() fix.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The debugging output (fmt.Println(tDir)) left in the test should be removed.", "category": "maintain...
null
spf13__afero__264
spf13/afero
264
defect
27c9ee049885de0846b9326ffe09d128a545a323
cb8b6bc2ffb05f108d9b406cfe7c598875181849
Make MemMapFs implement Lstater
MemMapFs does not currently implement Lstater which can make it a bit difficult when a program is wanting to call Lstat on an unknown filesystem, so I am implementing the interface. The real call is to `Stat()`, and a `false` is simply returned to indicate that an Lstat was not called. This change was prompted in my...
diff --git a/go.mod b/go.mod index abe4fe1c..7966d4bd 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,7 @@ module github.com/spf13/afero require ( github.com/pkg/sftp v1.10.1 + github.com/stretchr/testify v1.4.0 golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 golang.org/x/text v0.3.3 ) diff --git a/memmap....
1
1
0
[{"id": "G0", "claim": "The testify dependency added to go.mod should be removed for now since it is not used across all unit tests in this PR's scope.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
spf13__cast__179
spf13/cast
179
defect
ba0a5b63c8972d97f400e6d235d07a2f52532f01
f6826a1c977f1de5acee60dbd159fa31a41e1df2
Add function to cast `interface{}` to `[]float64`
Fixes #176 by adding the `ToFloat64Slice()` and `ToFloat64SliceE()` helper functions.
diff --git a/cast.go b/cast.go index 0cfe9418..54737a7d 100644 --- a/cast.go +++ b/cast.go @@ -169,6 +169,12 @@ func ToIntSlice(i interface{}) []int { return v } +// ToFloat64Slice casts an interface to a []float64 type. +func ToFloat64Slice(i interface{}) []float64 { + v, _ := ToFloat64SliceE(i) + return v +} + ...
1
1
0
[{"id": "G0", "claim": "The PR should be rebased and its ToFloat64SliceE implementation reworked to use the new generic functions (the shared toSliceE helper) instead of the hand-rolled reflection code.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
spf13__cast__261
spf13/cast
261
defect
d11fd11a5eab8c79be674a13b32f573c2648cb28
ac48031262fa1441c566e5d32719c91094a0d950
Support converting string float numbers to integer types
Fixes #204 Fixes #189 Fixes #172 Fixes #210 Fixes #170
diff --git a/number.go b/number.go index 8ee2a677..9ae39161 100644 --- a/number.go +++ b/number.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "strconv" + "strings" "time" ) @@ -391,7 +392,7 @@ func parseNumber[T Number](s string) (T, error) { } func parseInt[T integer](s string) (T, error) { - v, err := s...
1
1
1
[{"id": "G0", "claim": "Replacing trimZeroDecimal with trimDecimal, which cuts the string at the first decimal point without validating the remainder, makes strings that previously returned an error — \"10...17\", \"10.foobar\", \"10.0i\", \"10.0E9\" — now parse successfully and return 10.", "category": "correctness", ...
null
spf13__cast__49
spf13/cast
49
defect
df9611b94225ae6caad3f237aea7da77030bf780
116ed2a01c001e33b85933051cb32c5abd380ce5
Add additional type conversions
Adds float32, uint, uint64, uint32, uint16, and uint8 throughout. Fixes #33
diff --git a/cast.go b/cast.go index 8d318b6e..dc504b43 100644 --- a/cast.go +++ b/cast.go @@ -32,6 +32,12 @@ func ToFloat64(i interface{}) float64 { return v } +// ToFloat32 casts an interface to a float32 type. +func ToFloat32(i interface{}) float32 { + v, _ := ToFloat32E(i) + return v +} + // ToInt64 casts an ...
1
1
1
[{"id": "G0", "claim": "TestToUintE has no negative-value cases, so the unsigned conversion should have returned an error for negative inputs but the tests would not catch it.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
spf13__cobra-cli__1
spf13/cobra-cli
1
defect
6049ad32caa8b81f554509863266de3099279264
e68757856c174e40517f073e73e5eed484bec908
Initialize cobra-cli repo
This PR sets up various housekeeping things for the new repo: * Copies existing license/contributing/conduct/CI root files from spf13/cobra * Adds copies of make targets from spf13/cobra, adjust CI config * Rename packages and go.mod to cobra-cli * Tidy go module Because this repo placed the binary at the root, ...
diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..cc5fa07 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: +- package-ecosystem: gomod + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 99 +- package-ecosystem: ...
2
1
0
[{"id": "G0", "claim": "The reviewer recommends also including Windows in the test matrix platforms (ubuntu, macOS).", "category": "testing", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The reviewer recommends reducing the number of Go versions in the matrix by cutting one or ...
null
spf13__cobra__1146
spf13/cobra
1,146
defect
2c5a0d300f8ba1cd142776508519aba999b5e77f
9f009ea3077efffafa942c1f959d6d75c418ac6a
Bash completion V2 with completion descriptions
With Cobra supporting shell completion for Bash, Zsh, Fish and Powershell, having a uniform experience across all shells is a desirable feature. With Fish (#1048) , Zsh (#1070) and PowerShell (#1208) sharing the same Go completion logic, their behaviour is strongly aligned. This PR uses the same Go completion code ...
diff --git a/bash_completionsV2.go b/bash_completionsV2.go new file mode 100644 index 0000000000..24127f2647 --- /dev/null +++ b/bash_completionsV2.go @@ -0,0 +1,241 @@ +package cobra + +import ( + "bytes" + "fmt" + "io" + "os" +) + +func (c *Command) genBashCompletion(w io.Writer, includeDesc bool) error { + buf := ne...
9
7
6
[{"id": "G0", "claim": "Bash completions whose values contain a colon or an equal sign fail because bash treats those characters as word separators (e.g. image name:tag or filter=value completions do not complete correctly), a real problem for programs like Podman.", "category": "correctness", "verdict": "supported", "...
null
spf13__cobra__1192
spf13/cobra
1,192
defect
81e0311edd0bf6b4ff2c563005a646f6b286d059
e24bc4b6533f0097fc6017f6a005e0d49a1a6a44
Have Cobra create 'completion' command automatically
This PR has Cobra automatically provide a `completion` command at the root level if the program does not provide its own, just like for the `help` command. This lowers the barrier-to-entry and will make shell completion available to all Cobra users. With this, a program developer does not need to learn or do anythi...
diff --git a/command.go b/command.go index 5f1cacccba..e5be0f22a8 100644 --- a/command.go +++ b/command.go @@ -73,6 +73,9 @@ type Command struct { // BashCompletionFunction is custom functions used by the bash autocompletion generator. BashCompletionFunction string + // CompletionOptions is a set of options to co...
4
3
0
[{"id": "G0", "claim": "The powershell help text should tell users to pipe the generated script into Invoke-Expression instead of writing it to a temp file.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The powershell help text should also tell u...
null
spf13__cobra__1258
spf13/cobra
1,258
defect
142dfb15a8b9122dd6543adc769cbf59b976d793
6746e678d755204ec230863151812abd1e921e4e
Custom completion handle multiple shorhand flags together
Flag definitions like `-asd` are not handled correctly by the custom completion logic. They should be treated as multiple flags. For details refer to #1257. Fixes #1257
diff --git a/custom_completions.go b/custom_completions.go index f9e88e081f..8a91f86bab 100644 --- a/custom_completions.go +++ b/custom_completions.go @@ -442,7 +442,11 @@ func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg string) (*p if len(lastArg) > 0 && lastArg[0] == '-' { if index := strings...
4
4
2
[{"id": "G0", "claim": "The combined shorthand scenario `-bs=<TAB>` (boolean plus string flag with an equals sign) does not complete properly; the reviewer suggests ignoring that case if fixing it makes the code much more complicated.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "intr...
null
spf13__cobra__1308
spf13/cobra
1,308
defect
a4ab3fa09e3d6c4ac3fb7deece97a910957305ab
47bb591915a1273c363cce6e74ea76eb478b9765
custom comp: do not complete flags after args when interspersed is false
If the interspersed option is set false and one arg is already set all following arguments are counted as arg and not parsed as flags. Because of that we should not offer flag completion. The same applies to arguments followed after `--`. Fixes #1307
diff --git a/cobra/cmd/testdata/main.go.golden b/cobra/cmd/testdata/main.go.golden index 0bf75c5a16..f69d34aa10 100644 --- a/cobra/cmd/testdata/main.go.golden +++ b/cobra/cmd/testdata/main.go.golden @@ -1,5 +1,5 @@ /* -Copyright © 2020 NAME HERE <EMAIL ADDRESS> +Copyright © 2021 NAME HERE <EMAIL ADDRESS> Licensed u...
7
5
3
[{"id": "G0", "claim": "The comment on the argument-counting logic reads 'there is already one arg than' where it should say 'then'.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The new test comments misspell 'first' as 'fist' in three places.",...
null
spf13__cobra__1436
spf13/cobra
1,436
defect
07861c800d0779867f821501b892e635660847d2
d7b9dc5b14692731b3e7aa3bcf644dddf3ab5c98
Module aware generator
The `cobra` tool needed some extra updating to make it work seamlessly within the world of Go modules. I've dramatically simplified it to just work within a Go module. Now within a module you can just `cobra init` and it works. No paths or module names required. I've also made two additional behavioral changes:...
diff --git a/README.md b/README.md index 074e3979f..ab42ee095 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Cobra provides: * Fully POSIX-compliant flags (including short & long versions) * Nested subcommands * Global, local and cascading flags -* Easy generation of applications & commands with `cobra ini...
7
3
1
[{"id": "G0", "claim": "The fileToURL helper, which is called only once, is not worth a separate function and could be written inside getModImportPath.", "category": "maintainability", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The goGet function could be a one-liner: return ...
null
spf13__cobra__1438
spf13/cobra
1,438
defect
07861c800d0779867f821501b892e635660847d2
16378fafeb2a4c978ea10edb54fa5b2bb1d6f0f4
Fix flag completion
The flag completion functions should not be stored in the root cmd. There is no requirement that the root cmd should be the same when `RegisterFlagCompletionFunc` was called. Storing the flags there does not work when you add the the flags to your cmd struct before you add the cmd to the parent/root cmd. The flags ...
diff --git a/bash_completions.go b/bash_completions.go index 925e6e787b..733f4d1211 100644 --- a/bash_completions.go +++ b/bash_completions.go @@ -512,7 +512,9 @@ func writeLocalNonPersistentFlag(buf io.StringWriter, flag *pflag.Flag) { // Setup annotations for go completions for registered flags func prepareCustom...
6
6
1
[{"id": "G0", "claim": "The regression from #1423 means every program that calls cmd.RegisterFlagCompletionFunc() before joining the command to the root command no longer has functional flag completion, and it should be fixed soon.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "pre_exi...
null
spf13__cobra__1482
spf13/cobra
1,482
defect
4fd30b69ee2b62cf3bbecf0a423f8a1ee47f5f24
d0009ec6c3f4f438c2d8983d953b3c515afb1f0f
Add Active Help support
This PR is a proposal to enhance the shell completion logic with a framework for what I call "Active Help". Active Help are messages (hints, warnings, etc) that are printed during the use of the program using the shell completion system. It aims to help teach how to use the program in an "active" fashion. For ex...
diff --git a/README.md b/README.md index 074e3979f8..775e488e4e 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ name a few. [This list](./projects_using_cobra.md) contains a more extensive lis * [Suggestions when "unknown command" happens](user_guide.md#suggestions-when-unknown-command-happens) * [Genera...
3
1
1
[{"id": "G0", "claim": "Configuring ActiveHelp through a hidden flag on the __complete command is unnecessary and hard to use, and the reviewer would prefer a simpler mechanism such as an environment variable (Luap99 initially suggested a new command alias and would prefer a boolean ActiveHelpConfig, but accepted the e...
null
spf13__cobra__1530
spf13/cobra
1,530
defect
bfacc59f62c67ffd43e93655a8d933cefab0fa99
84cf71ff1f27f033b9d24f7ea0c888d3e2b9a141
Prefer ReplaceAll instead of Replace(..., -1)
Minor change that gopls pointed out. I think it improves readability a bit.
diff --git a/bash_completions.go b/bash_completions.go index 7411aba5a5..16de26d506 100644 --- a/bash_completions.go +++ b/bash_completions.go @@ -387,7 +387,7 @@ __%[1]s_handle_word() } func writePostscript(buf io.StringWriter, name string) { - name = strings.Replace(name, ":", "__", -1) + name = strings.ReplaceAl...
2
1
1
[{"id": "G0", "claim": "Reviewer asks whether the oldest Go version Cobra supports is older than 1.12, since strings.ReplaceAll was only added in Go 1.12.", "category": "compatibility", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The conversion to ReplaceAll left a trailing co...
null
spf13__cobra__1559
spf13/cobra
1,559
defect
611e16c322e3b0413a9ba4e489fcd98ef904e406
7260da100fb2a868f4a408cf6e197558660ba274
Add default completion command even if there are no other sub-commands
This supersedes #1450 and #1392 When a program has no sub-commands, its root command can accept arguments. If we add the default "completion" command to such programs they will now have a sub-command and will no longer accept arguments. What we do instead for this special case, is only add the "completion" comma...
diff --git a/command.go b/command.go index 6904bfba39..a5a466ac66 100644 --- a/command.go +++ b/command.go @@ -1085,12 +1085,6 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { // initialize help at the last point to allow for user overriding c.InitDefaultHelpCmd() - // initialize completion at the last...
2
2
1
[{"id": "G0", "claim": "Because the default `completion` command is hidden, no completions are generated for its arguments (e.g. \"foo completion <Tab>\") - a minor detail the reviewer believes is not a result of this change.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "pre_existing"...
null
spf13__cobra__1643
spf13/cobra
1,643
defect
5414d3d45d41008846e74d0f7768363014f3f5c0
effd9bafff327cfc348b3a667361a48dcd35ac0c
deprecate ExactValidArgs and test combinations of args validators
This is a subset of #841, which was approved by @jharshman and reviewed by @marckhouzam . Fix #838 and Fix #745. The original validators care about the number of arguments that a command accepts: `NoArgs`, `ArbitraryArgs`, `MinimumNArgs(int)`, `MaximumNArgs(int)`, `ExactArgs(int)`, `RangeArgs(min, max)`. We can c...
diff --git a/args.go b/args.go index 20a022b308..aad963bd10 100644 --- a/args.go +++ b/args.go @@ -7,6 +7,25 @@ import ( type PositionalArgs func(cmd *Command, args []string) error +// validateArgs returns an error if there are any positional args that are not in +// the `ValidArgs` field of `Command` +func valida...
2
2
1
[{"id": "G0", "claim": "Making ArbitraryArgs implicitly enforce ValidArgs is a breaking change that could break other Cobra users (e.g. kubectl aliases), so validation should stay opt-in rather than being applied implicitly.", "category": "design", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id"...
null
spf13__cobra__1654
spf13/cobra
1,654
defect
d622355c84521e1820d05a0c763b7997e40c36c4
5f38f45579cabc5b46f8cbe6f3509b7adf439fd1
Add ability to mark flags as required or exclusive as a group
This change adds two features for dealing with flags: - requiring flags be provided as a group (or not at all) - requiring flags be mutually exclusive of each other By utilizing the flag annotations we can mark which flag groups a flag is a part of and during the parsing process we track which ones we have see...
diff --git a/command.go b/command.go index ee5365bcba..0f4511f38e 100644 --- a/command.go +++ b/command.go @@ -863,6 +863,10 @@ func (c *Command) execute(a []string) (err error) { if err := c.validateRequiredFlags(); err != nil { return err } + if err := c.validateFlagGroups(); err != nil { + return err + } + ...
11
9
1
[{"id": "G0", "claim": "The user documentation should be updated to tell users how they can use the flag-group feature.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "MarkFlagsRequiredTogether should call FlagSet.SetAnnotation instead of manipulat...
null
spf13__cobra__1659
spf13/cobra
1,659
defect
9d15fe657a500065fb343f8a9d1474582147f828
28e6e86f87aa69b2655780b5a12a3c4bc85aa7b4
Add shell completion to flag groups
This PR teaches the shell completion logic how to handle the new flag group feature of #1654. To avoid mucking about in the already complex shell completion logic, I took a different approach. When we are doing shell completion, we first check flag groups like this: 1. when a flag in a group is present, other flag...
diff --git a/command.go b/command.go index ee5365bcba..0f4511f38e 100644 --- a/command.go +++ b/command.go @@ -863,6 +863,10 @@ func (c *Command) execute(a []string) (err error) { if err := c.validateRequiredFlags(); err != nil { return err } + if err := c.validateFlagGroups(); err != nil { + return err + } + ...
5
2
1
[{"id": "G0", "claim": "Marking the other flags of a mutually exclusive group hidden during completion may leave them hidden in non-completion scenarios such as help output, where they should still be shown.", "category": "correctness", "verdict": "opposed", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim...
null
spf13__cobra__1707
spf13/cobra
1,707
defect
5b11656e45a6a6579298a3b28c71f456ff196ad6
6495e274444691f8848eb499e6bcaa1e6b7601c7
Fix minor annoyance of missing '--version' flag from some Help output
In the current code, with a version set, `app help` does not display the switch option `--version`, while `app --help` does. * Fix missing '--version' flag from help command * with unit tests * Add vscode to .gitignore
diff --git a/.gitignore b/.gitignore index c7b459e4d..ed1f4f595 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,5 @@ bin .idea/ *.iml + +.vscode \ No newline at end of file diff --git a/command.go b/command.go index 0f4511f38..48c4f2e6b 100644 --- a/command.go +++ b/command.go @@ -1120,7 +1120,8 @@ Simply typ...
2
2
1
[{"id": "G0", "claim": "The .vscode entry the pull request added to .gitignore should be removed from this PR: it does not belong here and a personal global gitignore is recommended instead.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new...
null
spf13__cobra__1776
spf13/cobra
1,776
defect
dbf85f6104904d539cabceebec234e817fa0df0c
0729284923cb7157e6958b37c90e91040cd93205
fix: show flags that shadow parent persistent flag in child help
This fixes a bug where a child flag that shadows (has the same name as) a parent persistent flag would not be shown in the child command's help output and the parent flag would be shown instead under the global flags section. This change makes the help output consistent with the observed behavior during execution, w...
diff --git a/command.go b/command.go index 675bb1340a..5fca7dc630 100644 --- a/command.go +++ b/command.go @@ -1505,7 +1505,8 @@ func (c *Command) LocalFlags() *flag.FlagSet { } addToLocal := func(f *flag.Flag) { - if c.lflags.Lookup(f.Name) == nil && c.parentsPflags.Lookup(f.Name) == nil { + // Add the flag if...
1
1
0
[{"id": "G0", "claim": "The existing TestOverwrittenFlag test and the new test should keep to the same terminology — either \"overwritten\" for both or \"shadowed\" for both, whichever the author prefers.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
spf13__cobra__1802
spf13/cobra
1,802
defect
2e8ba6f3087bda425da42af31f7373cd2c2c08c5
1a47cd5fed48e833aa697ba1362e78b8923fff17
Support for case-insensitive command names
Add a global `EnableCaseInsensitive` variable to allow case-insensitive command names. The variable supports commands names and aliases globally. Resolves #1382
diff --git a/cobra.go b/cobra.go index d6cbfd7198..b21eeb93fa 100644 --- a/cobra.go +++ b/cobra.go @@ -40,14 +40,23 @@ var templateFuncs = template.FuncMap{ var initializers []func() +const ( + DefaultPrefixMatching = false + DefaultCommandSorting = true + DefaultCaseInsensitive = false +) + // EnablePrefixMatc...
3
3
0
[{"id": "G0", "claim": "The godoc comment on EnableCaseInsensitive should read \"by default\" instead of the typo \"be default\".", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "IsMatch should not be exported if not needed by consumers, be renamed ...
null
spf13__cobra__1813
spf13/cobra
1,813
defect
a281c8b47b315fe428cf31ad5c38b526dc136f55
ccb45fbd604ecad8328b875b215a73969a1b330a
Include --help and --version flag in completion
Fixes #1786 Thanks to @fnickels's nice work on #1707, I realized why the `--help`/`-h` and `--version`/`-v` flags where not included in shell completions. The `--help`, `-h`, `--version` and `-v` flags are normally added when the `execute()` function is called on a command. When doing completion we don't call `e...
diff --git a/command.go b/command.go index cdfd360f8..e7e976932 100644 --- a/command.go +++ b/command.go @@ -30,6 +30,8 @@ import ( flag "github.com/spf13/pflag" ) +const FlagSetByCobraAnnotation = "cobra_annotation_flag_set_by_cobra" + // FParseErrWhitelist configures Flag parse errors to be ignored type FParse...
1
1
1
[{"id": "G0", "claim": "The completion logic for this improvement is still lacking — e.g. `helm status --help <TAB>` will still suggest a list of helm releases — so the Cobra-added `--help` and `--version` flags need to be treated as exceptions in Cobra that stop further completion.", "category": "correctness", "verdic...
null
spf13__cobra__1817
spf13/cobra
1,817
defect
fce8d8aeb08dc6afe413cc0af67a7fbb3cffec4c
cf24c445d725a3fc06aa2413d961d728cab7aa64
completions: do not detect arguments with dash as 2nd char as flag
Previously, arguments with a dash as the second character (e.g., 1-ff00:0:1) were detected as a flag by mistake. This resulted in auto completion misbehaving if such an argument was last in the argument list during invocation. Fixes #1816
diff --git a/command.go b/command.go index 1867d22c9b..5cf889dd7a 100644 --- a/command.go +++ b/command.go @@ -627,7 +627,7 @@ func argsMinusFirstX(args []string, x string) []string { } func isFlagArg(arg string) bool { - return ((len(arg) >= 3 && arg[1] == '-') || + return ((len(arg) >= 3 && arg[0:2] == "--") || ...
1
1
1
[{"id": "G0", "claim": "Add a test that fails before and passes after the change, since the isFlagArg fix is untested.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
spf13__cobra__1839
spf13/cobra
1,839
defect
4b9d00dfecd605048ddf3ad2a81afcab381ac1ae
ddc80d1de6a4a19077b84b55ea85f9b495565391
Check for group presence after full initialization
Fixes #1831 Replaces #1835 By moving the check for help group existence to "ExecuteC()" we no longer need groups to be added before AddCommand() is called. This provides more flexibility to developers and works better with the use of "init()" for command creation. cc @aawsome
diff --git a/command.go b/command.go index 9d5e9cf5eb..03862a200c 100644 --- a/command.go +++ b/command.go @@ -998,6 +998,10 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { // initialize completion at the last point to allow for user overriding c.InitDefaultCompletionCmd() + // Now that all commands h...
2
1
0
[{"id": "G0", "claim": "Checking groups in a recursive pass after initialization introduces slightly more runtime overhead than checking within AddCommand, though the reviewer expects it to be negligible.", "category": "performance", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": ...
null
spf13__cobra__1952
spf13/cobra
1,952
defect
4dd4b25de38418174a6e859e8a32eaccca32dccc
4af07a5cc92b5a2de1c49bc9bfdc001f4124896e
Add 'one required flag' group
This PR addresses #1761 and #1891 - it adds a new flag group which can be used to group a set of flags of which at least one is required. If the related command is invoked and none of the flags in the group are set, the user is informed of the flag group (e.g. with two flags called 'path' and 'id'): ``` Error: at l...
diff --git a/flag_groups.go b/flag_groups.go index b35fde155..b353572c9 100644 --- a/flag_groups.go +++ b/flag_groups.go @@ -24,6 +24,7 @@ import ( const ( requiredAsGroup = "cobra_annotation_required_if_others_set" + oneRequired = "cobra_annotation_one_required" mutuallyExclusive = "cobra_annotation_mut...
4
4
4
[{"id": "G0", "claim": "Add tests for the new one-required flag group functionality.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Update enforceFlagGroupsForCompletion() so that when none of the flags in a one-required group are present, all of them a...
null
spf13__cobra__1956
spf13/cobra
1,956
defect
756ba6dad61458cbbf7abecfc502d230574c57d2
ee7aba860a78a8fb8c56d770ee3d3a0ad0160ebd
Allow linker to perform deadcode elimination for program using Cobra
Fixes #2015 Cobra, in its default configuration, will execute a template to generate help, usage and version outputs. Text/template execution calls MethodByName and MethodByName disables dead code elimination in the Go linker, therefore all programs that make use of cobra will be linked with dead code elimination d...
diff --git a/cobra.go b/cobra.go index e0b0947b04..d9cd2414e2 100644 --- a/cobra.go +++ b/cobra.go @@ -176,12 +176,16 @@ func rpad(s string, padding int) string { return fmt.Sprintf(formattedString, s) } -// tmpl executes the given template text on data, writing the result to w. -func tmpl(w io.Writer, text string...
11
9
4
[{"id": "G0", "claim": "The new test calls os.Mkdir without using its return value, which produces a warning; change the line to `_ = os.Mkdir(dirname, 0770)`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The test writes its fixture file with ...
null
spf13__cobra__2023
spf13/cobra
2,023
defect
285460dca6152bb86994fa4a9659c24ca4060e2f
48dabba4d3133af67e2edcc2be80af2fd9f3d7fd
Customizable error message prefix
You can change the prefix before the error message by `SetErrPrefix()`. It's currently `Error:`, and now it's read from `errPrefix`. It's just like the `versionTemplate` and `SetVersionTemplate()` relationship. Resolve: #1281
diff --git a/command.go b/command.go index e4945ab84..3d30a53ca 100644 --- a/command.go +++ b/command.go @@ -181,6 +181,9 @@ type Command struct { // versionTemplate is the version template defined by user. versionTemplate string + // errPrefix is the error message prefix defined by user. + errPrefix string + /...
5
5
3
[{"id": "G0", "claim": "The new errPrefix variable will be empty by default, so a getter defaulting to \"Error:\" (like VersionTemplate) is needed.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The feature should include some short documentation.",...
null
spf13__cobra__2044
spf13/cobra
2,044
defect
95d8a1e45d7719c56dc017e075d3e6099deba85d
589693b84870c0228d123904ff62fd4bca24d301
Feature: allow running persistent run hooks of all parents
Currently, only one of the persistent pre-runs and post-runs is executed. It is always the first one found in the parents chain, starting at this command. Expected behavior is to execute all parents' persistent pre-runs and post-runs. Dependent projects implemented various workarounds for this: - manually buildin...
diff --git a/cobra.go b/cobra.go index f23f5092f6..381c7b37d0 100644 --- a/cobra.go +++ b/cobra.go @@ -43,9 +43,10 @@ var initializers []func() var finalizers []func() const ( - defaultPrefixMatching = false - defaultCommandSorting = true - defaultCaseInsensitive = false + defaultPrefixMatching = false + defaul...
2
2
0
[{"id": "G0", "claim": "The second line of the EnableTraverseRunHooks doc comment should be reworded to '// By default this is disabled, which means only the first run hook to be found is executed.'", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "A...
null
spf13__cobra__2173
spf13/cobra
2,173
defect
9f9056765ccb3bfb1c72a560b4c6edbff71c0f32
ac1ca097a3b0e02414869e31d02ef963fa519715
Make detection for test-binary more universal
**This has been reverted by #2235 in release v1.9.1** == - relates to https://github.com/spf13/cobra/pull/155 - relates to https://github.com/docker/cli/pull/5224 When running tests in verbose mode (or other options), tests involving Cobra may fail if the test does not explicitly set Command.args to an empty ...
diff --git a/command.go b/command.go index 4cd712bcb..e01ea5531 100644 --- a/command.go +++ b/command.go @@ -23,7 +23,6 @@ import ( "fmt" "io" "os" - "path/filepath" "sort" "strings" @@ -1079,7 +1078,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { args := c.args // Workaround FAIL with "...
4
4
2
[{"id": "G0", "claim": "The comment above the test-binary check in command.go is stale and should be updated to describe the new isTesting() behaviour.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The copyright year in the new files command_go12...
null
spf13__cobra__2210
spf13/cobra
2,210
defect
9f9056765ccb3bfb1c72a560b4c6edbff71c0f32
9548b64a365b463b27f05752525334e541fda45f
completion: improve detection for flags that accept multiple values
The completion code attempts to detect whether a flag can be specified more than once, and therefore should provide completion even if already set. Currently, this code depends on conventions used in the pflag package, which uses an "Array" or "Slice" suffix or for some types a "stringTo" prefix. Cobra allows cus...
diff --git a/completions.go b/completions.go index 8fccdaf2c0..6b8ed8c5ae 100644 --- a/completions.go +++ b/completions.go @@ -270,6 +270,14 @@ func (c *Command) initCompleteCmd(args []string) { } } +// sliceValue is a reduced version of [pflag.SliceValue]. It is used to detect +// flags that accept multiple value...
3
1
0
[{"id": "G0", "claim": "The sliceValue interface should be exported so external programs can write `var _ sliceValue = (*customMultiString)(nil)` as the tests do.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "A compile-time assertion that pflag.SliceVal...
null
spf13__cobra__2238
spf13/cobra
2,238
defect
f98cf4216d3cb5235e6e0cd00ee00959deb1dc65
84a1965f142cf6e48f2dd3aeb3b2aeaafd393551
The default ShellCompDirective can be customized for a command and its subcommands
Closes #2209, #2221 #2221 proposed a solution where the custom `DefaultShellCompDirective` only applied to a given command. In https://github.com/spf13/cobra/pull/2221#discussion_r1923845125, alternative approaches were discussed. We agreed on a recursive solution, where a change applies to a command and its su...
diff --git a/completions.go b/completions.go index a1752f763..0733c5bbd 100644 --- a/completions.go +++ b/completions.go @@ -115,6 +115,13 @@ type CompletionOptions struct { DisableDescriptions bool // HiddenDefaultCmd makes the default 'completion' command hidden HiddenDefaultCmd bool + // DefaultShellCompDirect...
6
2
0
[{"id": "G0", "claim": "The exported pointer field DefaultShellCompDirective cannot be set to the existing ShellCompDirective constants in a struct literal, so a different mechanism is needed.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The pointer-to-c...
null
spf13__cobra__284
spf13/cobra
284
defect
336d629de064dbb12166b46c06039dbcfb935de1
2d158e16d2a66ecda86c4a944faed08ae348e13f
Support validation of positional arguments
Fixes #42 Branched from #120 Adds a new field `Args` that allows a user to define the expected positional arguments that a command should receive. If a command doesn't receive the expected args it returns an error. By accepting a validation function users can create their own custom validation for positional args. Th...
diff --git a/README.md b/README.md index 34c79eb8eb..b17357078f 100644 --- a/README.md +++ b/README.md @@ -406,6 +406,43 @@ A flag can also be assigned locally which will only apply to that specific comma RootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") ``` +### Positional Arg...
8
7
1
[{"id": "G0", "claim": "Arg validation happens before the --help flag is checked, so the new validation can incorrectly report errors when --help is used; the order of operations needs to be adjusted.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "T...
null
spf13__cobra__299
spf13/cobra
299
defect
bc69223348ce9692e3ab90f04c375ac6cd71e9ba
b3a3783bc0e4485132b240064764c43454e18d0f
Add a TraverseChildren option to allow for flags on each command in the hierarchy
Fixes #277 Currently cobra only parses flags on the last command in the chain. If you use `PersistentFlags()` you force the parent flag onto the child commands, cluttering help, and reducing the short flags available to child commands. `TraverseChildren` allows each command in the hierarchy to have its own flags....
diff --git a/README.md b/README.md index 7b00a02445..89f08520d8 100644 --- a/README.md +++ b/README.md @@ -344,6 +344,12 @@ A flag can also be assigned locally which will only apply to that specific comma RootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") ``` +### Local Flag on ...
4
3
0
[{"id": "G0", "claim": "Add a dot at the end of the comment documenting the TraverseChildren field in command.go.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add an example of usage to the new 'Local Flag on Parent Commands' section of README.m...
null
spf13__cobra__402
spf13/cobra
402
defect
7be4beda01ec05d0b93d80b3facd2b6f44080d94
236b6e93e0c99960758f1eb36b27fb35ec376bff
Fix #401
* doc: Add and edit docs * doc: Add tests Fixes #401
diff --git a/doc/man_docs.go b/doc/man_docs.go index b9266c367c..e2dae80828 100644 --- a/doc/man_docs.go +++ b/doc/man_docs.go @@ -30,8 +30,8 @@ import ( // GenManTree will generate a man page for this command and all descendants // in the directory given. The header may be nil. This function may not work -// corre...
3
3
1
[{"id": "G0", "claim": "GenManTreeFromOpts should not create the output directory with os.Mkdir: silently creating a missing directory hides a typo and generates docs where the user won't look for them, so the patch should drop directory creation and do everything else.", "category": "design", "verdict": "supported", "...
null
spf13__cobra__584
spf13/cobra
584
defect
19e54c4a2b8a78c9d54b2bed61b1a6c5e1bfcf6f
5f60cea63cced82886a4be7375cf28b51a1d5db5
Add support for --version flag
Fixes #282
diff --git a/command.go b/command.go index eb311a7373..aca79390c2 100644 --- a/command.go +++ b/command.go @@ -75,6 +75,11 @@ type Command struct { // group commands. Annotations map[string]string + // Version defines the version for this command. If this value is non-empty and the command does not + // define a ...
4
3
1
[{"id": "G0", "claim": "The default version template should use `.Name` instead of `.Use`, because `.Use` can be in the format `command [path] [flags]`; printing only the version (just `{{.Version}}`) was also suggested.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G...
null
spf13__viper__1056
spf13/viper
1,056
defect
da70fee0839cab625b0d9df6e834bc10db56437f
d49821e7a7eed51cea1089ae795caeb465b41840
Sub parent inheritance
This PR fixes two issues with Sub(): - Options were not copied from parent (e.g, automaticEnvApplied). - Environment variable names were wrong: Sub("x").Sub("y").Get("z") should look up env var x.y.z but was instead looking up z Fixes https://github.com/spf13/viper/issues/745 Fixes https://github.com/spf13/...
diff --git a/viper.go b/viper.go index 702771509..a8af78d37 100644 --- a/viper.go +++ b/viper.go @@ -201,6 +201,7 @@ type Viper struct { envKeyReplacer StringReplacer allowEmptyEnv bool + parents []string config map[string]interface{} override map[string]interface{} defaults ...
2
1
1
[{"id": "G0", "claim": "Sub() must also preserve the parent viper's envPrefix, otherwise the env lookup v.getEnv(v.mergeWithEnvPrefix(envKey)) breaks for sub-vipers.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The change could be a breaking chang...
null
spf13__viper__1181
spf13/viper
1,181
defect
a7cfd8b8e030fea088a8867ea1b5a0e59ac2e2cc
f391833d7505087f2f2e9f7e6865da8951a96b04
Allow merging configs with different types of leaf values
This fixes the problem that appears when your base config has values with different type than the override, which is valid use case. Fixes #1142
diff --git a/viper.go b/viper.go index 46b1a85ec..b616a6802 100644 --- a/viper.go +++ b/viper.go @@ -1811,12 +1811,6 @@ func mergeMaps( svType := reflect.TypeOf(sv) tvType := reflect.TypeOf(tv) - if tvType != nil && svType != tvType { // Allow for the target to be nil - jww.ERROR.Printf( - "svType != tvTy...
1
1
1
[{"id": "G0", "claim": "A test should be added (if none exists) that verifies the behavior changed by removing the type-mismatch guard in mergeMaps — merging leaf values of different types, including overriding a null target with a non-null source — hasn't changed.", "category": "testing", "verdict": "supported", "prio...
null
spf13__viper__1429
spf13/viper
1,429
defect
c4dcd31f68e5d77ce447c0091dd1ca6d7e169807
36b31a146c91a60c8b23df7d730aaa850174ff71
Implement viper.BindStruct for automatic unmarshalling from environment variables
## Description The current `viper` implementation does not allow to `viper.Unmarshal` environment variables into structs without binding them first (using `viper.BindEnv`). This behavior results in an "empty" struct (i.e no values filled) if no configuration file is provided with matching keys. This pull request ...
diff --git a/README.md b/README.md index b96180b3b9..f7369ac167 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,7 @@ with ENV: * `AutomaticEnv()` * `BindEnv(string...) : error` + * `BindStruct(interface{}) : error` * `SetEnvPrefix(string)` * `SetEnvKeyReplacer(string...) *strings.Replacer` * `AllowEmp...
6
2
2
[{"id": "G0", "claim": "Internally calling BindEnv for every struct key is a workaround rather than the right solution; bindStruct should instead make the struct's keys available so Unmarshal merges them with AllKeys.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1",...
null
spf13__viper__1433
spf13/viper
1,433
defect
419fd86e49ef061d0d33f4d1d56d5e2a480df5bb
d4014cfce75f78209a46cec221d0672491c0bf1f
Allow ConfigParseError to unwrap
Currently, viper errors cannot be unwrapped and hence do not give access to inner errors. Together with e.g. https://github.com/go-yaml/yaml/pull/760 this could be used to get access to the source file position producing the error.
diff --git a/util.go b/util.go index 64e657505..3217052b0 100644 --- a/util.go +++ b/util.go @@ -27,10 +27,15 @@ type ConfigParseError struct { } // Error returns the formatted configuration error. -func (pe ConfigParseError) Error() string { +func (pe *ConfigParseError) Error() string { return fmt.Sprintf("While...
1
1
1
[{"id": "G0", "claim": "The change of ConfigParseError's Error (and Unwrap) methods to pointer receivers lacks justification and should not be made (\"Why make it a pointer?\").", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
spf13__viper__1696
spf13/viper
1,696
defect
c4dcd31f68e5d77ce447c0091dd1ca6d7e169807
07866f18e9ab1738d8057cf0e5b195fe07752eaf
fix: gocritic lint issues
This PR enables [`gocritic` ](https://go-critic.com/)linter and fixes found lint issues. The full log of running golangci-lint: ```sh ❯ golangci-lint run internal/encoding/ini/map_utils.go:45:1: paramTypeCombine: func(shadow map[string]any, m map[string]any, prefix string, delimiter string) map[string]any could b...
diff --git a/.golangci.yaml b/.golangci.yaml index fa28eb3bb..c961c472a 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -7,6 +7,16 @@ linters-settings: - standard - default - prefix(github.com/spf13/viper) + gocritic: + # Enable multiple checks by tags. See "Tags" se...
4
4
1
[{"id": "G0", "claim": "The ini codec's Encode method should stay a value receiver; the reviewer sees no need for gocritic to force it to a pointer receiver.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The //nolint:gocritic hugeParam suppression on di...
null
spf13__viper__1791
spf13/viper
1,791
defect
8ac644165cf967d7d5be0cb149eb321c4c8ecfcf
e152d74e81e2c23a56af15023a7101bf0b7c7de8
fix #1700: update tests to use local viper instance
Updated all viper_test* to use local viper instance Fixes: #1700
diff --git a/viper_test.go b/viper_test.go index 08533699c..f1ffff0de 100644 --- a/viper_test.go +++ b/viper_test.go @@ -136,104 +136,51 @@ Coding addict. Good man. """ # Succeeding comment`) -func initConfigs() { - Reset() +func initConfigs(v *Viper) { + var r io.Reader - SetConfigType("yaml") + v.SetConfigType...
1
1
0
[{"id": "G0", "claim": "The linter violations in the pull request should be addressed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
spf13__viper__1869
spf13/viper
1,869
defect
a11ee9ae99ad877d50eaf897e3d07c41d8e2f697
158a721e31dbb931fbf6b6bbd17a2e54ae823550
New encoding layer
Expose a new encoding abstraction layer. It allows users to bring their own encoding logic into Viper. It also allows moving some of the less used formats (HCL, INI, Java properties) out of the core.
diff --git a/encoding.go b/encoding.go new file mode 100644 index 000000000..7d48d0d5a --- /dev/null +++ b/encoding.go @@ -0,0 +1,113 @@ +package viper + +import ( + "github.com/spf13/viper/internal/encoding/dotenv" + "github.com/spf13/viper/internal/encoding/hcl" + "github.com/spf13/viper/internal/encoding/ini" + "git...
4
1
0
[{"id": "G0", "claim": "The EncoderRegistry methods should maybe return an error (such as ErrEncoderNotFound) instead of a bool when no encoder is registered.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The registry interfaces could alternatively be n...
null
spf13__viper__415
spf13/viper
415
defect
aafc9e6bc7b7bb53ddaa75a5ef49a17d6e654be5
242f4890f5f6239217fa5c45bb6de3b4b5509d3b
WatchConfig and Kubernetes (#284)
Support override of symlink to config file Include tests for WatchConfig of regular files, as well as config file which links to a folder which is itself a link to another folder in the same "watch dir" (the way Kubernetes exposes config files from ConfigMaps mounted on a volume in a Pod) Also: - Add synchronization w...
diff --git a/.gitignore b/.gitignore index 352a34a56..01b5c44b9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,9 @@ _testmain.go *.exe *.test -*.bench \ No newline at end of file +*.bench + +.vscode + +# exclude dependencies in the `/vendor` folder +vendor diff --git a/viper.go b/viper.go index ad8a03729..72...
4
2
0
[{"id": "G0", "claim": "If the init wait group only ever has one member, WatchConfig could start the watcher synchronously instead of spawning the extra goroutine and waiting on initWG.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The Write||Create con...
null
spf13__viper__722
spf13/viper
722
defect
3349bd9cc2887f06cc4efdc88894e7c3c0e6d872
1655def7e9e1d46bbdfa593db175f55d8dacd250
Support config files with no extensions
Support config files with no extension. ~~Closes: spf13/viper#390~~ This was a mistake Closes: spf13/viper#336 Similar to https://github.com/spf13/viper/pull/357/files which appears to have been forgotten. Difference is: attempt a no extension right away instead of messing with the extension append and itera...
diff --git a/viper.go b/viper.go index 0699c4c16..578011f51 100644 --- a/viper.go +++ b/viper.go @@ -1863,6 +1863,10 @@ func (v *Viper) getConfigFile() (string, error) { func (v *Viper) searchInPath(in string) (filename string) { jww.DEBUG.Println("Searching for config in ", in) + if b, _ := exists(v.fs, filepath....
2
2
2
[{"id": "G0", "claim": "The README should document the extension-less config file feature and that viper.SetConfigType(...) is needed for such files to be deserialized.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The extension-less file check i...
null
spf13__viper__813
spf13/viper
813
defect
eabbc68a3ecd5cf8c11a2f84dbda5e7a38493b2f
8f40d15c5605ef83a6c73a33af90b468c0c4df7a
Add support to save file with no extension
The suppport introduced for files with no file extension is only partial as trying to save the config file would fail with `<file name> equires valid extensio` This adds support to saving such files
diff --git a/viper.go b/viper.go index eb2f5177a..2c7f42fb7 100644 --- a/viper.go +++ b/viper.go @@ -1418,11 +1418,18 @@ func (v *Viper) SafeWriteConfigAs(filename string) error { func (v *Viper) writeConfig(filename string, force bool) error { jww.INFO.Println("Attempting to write configuration to file.") - ext :...
1
1
1
[{"id": "G0", "claim": "Add a test case verifying that the config type written is still inferred from the file name, not the original config type (config type yaml with a json file name still yields JSON output), since as far as the reviewer can tell it currently is not.", "category": "testing", "verdict": "supported",...
null
spf13__viper__861
spf13/viper
861
defect
97ee7adfef4882d78c0ef26e22a0c8a7a8bf6776
3b9c8bd21fc87a99910557d6203e1c9f333cdb3a
Added support for accessing slices
Hi, I added support for accessing values within a slice as mentioned in #196. For example, if we have a config file which is structured like this: ```json { "server_name": "example.com", "interfaces": [ { "interface": "192.168.1.1", "port": 80 }, { "interface": "127.0....
diff --git a/README.md b/README.md index 45e72f29e..01e355aa8 100644 --- a/README.md +++ b/README.md @@ -579,6 +579,33 @@ the `Set()` method, …) with an immediate value, then all sub-keys of `datastore.metric` become undefined, they are “shadowed” by the higher-priority configuration level. +Viper can access array ...
8
6
0
[{"id": "G0", "claim": "The searchMapWithPathPrefixes function, which now also handles slices, should be renamed to something like searchIndexableWithPathPrefixes.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The if/else type assertions used t...
null
spf13__viper__874
spf13/viper
874
defect
97ee7adfef4882d78c0ef26e22a0c8a7a8bf6776
018de44cf77382dc0689bd08144a90dfc9825b7d
Fix: Getting the value of a StringToString pflag
As viper parses pflag values as strings, string to string values weren't being handled correctly . Fixes #608 .
diff --git a/viper.go b/viper.go index 7b12b36e9..352c77d54 100644 --- a/viper.go +++ b/viper.go @@ -1083,6 +1083,8 @@ func (v *Viper) find(lcaseKey string, flagDefault bool) interface{} { s = strings.TrimSuffix(s, "]") res, _ := readAsCSV(s) return cast.ToIntSlice(res) + case "stringToString": + return ...
1
1
0
[{"id": "G0", "claim": "The new parseStringToStringFlagValue helper should copy pflag's stringToString conversion function and keep the implementation as close to it as possible.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
spf13__viper__972
spf13/viper
972
defect
387404d518c104d209c27bc5eca310201eb721f3
e5d7915cac87bf08aa571bd3e99d75ef797a3990
Allow BindEnv to register multiple environment variables.
This change modifies BindEnv to permit a list of environment variable names in order to support multiple env. vars. for the same config key. When this form is used, env. keys take precedence in the written order. Closes #971
diff --git a/viper.go b/viper.go index 50fd66ec0..87a4440d3 100644 --- a/viper.go +++ b/viper.go @@ -205,7 +205,7 @@ type Viper struct { defaults map[string]interface{} kvstore map[string]interface{} pflags map[string]FlagValue - env map[string]string + env map[string][]...
1
1
1
[{"id": "G0", "claim": "The PR author should add documentation about the BindEnv multiple-environment-variables feature, both to the BindEnv function header and to the README.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
spglib__moyo__304
spglib/moyo
304
defect
8c4714a19cf0f3dc3ab1a6e145c3d21efe552516
ddea58178da458ea62b8b32f5135136b12473795
feat(moyo): layer-group M2 - primitive layer symmetry search + LayerCell
## Summary **Stacks on top of #303** (`feat/layer-group-foundations`). Open #303 first; this branch only adds the search pipeline + `LayerCell`/`LayerLattice` newtypes. Delivers M2 from the layer-group plan plus the layer newtype split. ### M2 search - `search_layer_bravais_group(&LayerLattice, ..)` -- wraps `search...
diff --git a/moyo/src/base.rs b/moyo/src/base.rs index 99be5b27..90fd6195 100644 --- a/moyo/src/base.rs +++ b/moyo/src/base.rs @@ -2,6 +2,8 @@ mod action; mod cell; mod error; mod lattice; +mod layer_cell; +mod layer_lattice; mod magnetic_cell; mod operation; mod permutation; @@ -12,6 +14,8 @@ pub use action::Rot...
11
11
2
[{"id": "G0", "claim": "The redundant cell-level lattice-validation wrapper in moyo/src/base/cell.rs should be removed, leaving validation only in LayerLattice::new.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Doc comments should not referenc...
null
sphinx-contrib__sphinx-lint__56
sphinx-contrib/sphinx-lint
56
defect
574fbf30a42bd8457eb6935ddc966668d2f8588c
0ce76bb5ccff9341a3a852df692887be98d02b7b
Add check for dangling hyphens
Fixes https://github.com/sphinx-contrib/sphinx-lint/issues/54. The failures are caused by finding IRL trailing hyphens in friend projects: pandas, cpython, peps, sympy. ``` E + /home/runner/work/sphinx-lint/sphinx-lint/tests/fixtures/friends/pandas/doc/source/ecosystem.rst:380: Line ends with dangling hy...
diff --git a/sphinxlint/checkers.py b/sphinxlint/checkers.py index 4df610e36..6d5e330f1 100644 --- a/sphinxlint/checkers.py +++ b/sphinxlint/checkers.py @@ -447,3 +447,12 @@ def check_block(block_lineno, block): list(hide_non_rst_blocks(lines, hidden_block_cb=check_block)) yield from errors + + +@checker("....
2
1
0
[{"id": "G0", "claim": "Lines ending in a hyphen in the sympy friend fixtures could be true positives for the new dangling-hyphen check, and either they should be flagged or lines right before a blank line should be excluded from the check.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "int...
null
sphinx-contrib__sphinx-lint__82
sphinx-contrib/sphinx-lint
82
defect
1e8c3f92317fda7e810dde2dd7b34f40af026780
e558a6ff0798845460a796979d21bcdb32f62c64
Pre-compile nearly all regex patterns
None of these changes makes a signficant difference by itself. But taken together, I measure around a 9% speedup over `main` currently! Part of #76
diff --git a/sphinxlint/checkers.py b/sphinxlint/checkers.py index f821caa88..6997461f6 100644 --- a/sphinxlint/checkers.py +++ b/sphinxlint/checkers.py @@ -63,6 +63,9 @@ def check_missing_backtick_after_role(file, lines, options=None): yield paragraph_lno + error_offset, f"role missing closing backtick: {...
3
2
0
[{"id": "G0", "claim": "The PR author offers to remove the accidentally committed debug message on the assert in test_sphinxlint_shall_not_pass if the reviewer prefers it gone.", "category": "testing", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The regexes ROLE_TAG_ENDING_L...
null
sphireinc__Foundry__100
sphireinc/Foundry
100
defect
b24b121c2d6cf433313da0e087c907cc40494782
ceedf87f7e054114012b28df398a08df1f572cc8
fix symlink vuln and add tests to ensure regression doesn't occur
## Summary Hardens Foundry's filesystem and admin surfaces against symlink-based escape attacks, and add regression coverage so those paths stay closed. ## What changed - Added a shared internal/safepath symlink guard and wired it into content loading, theme manifest loading, theme validation, theme template r...
diff --git a/internal/admin/http/router.go b/internal/admin/http/router.go index 53ecf84..d88f719 100644 --- a/internal/admin/http/router.go +++ b/internal/admin/http/router.go @@ -222,6 +222,10 @@ func (r *Router) handlePluginExtensionAsset(w http.ResponseWriter, req *http.Req http.NotFound(w, req) return } + ...
2
1
1
[{"id": "G0", "claim": "CodeQL reports uncontrolled user-provided data used in path expressions at the os.Lstat calls in EnsureNoSymlinkEscape (internal/safepath/symlink.go lines 20 and 47).", "category": "security", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "CodeQL reports...
null
spiceai__spiceai__10055
spiceai/spiceai
10,055
defect
fbb2eb427c09edf9fbcf723a25c8a01aee1296e4
5306de77888cd62d14faf19a2511ffea082d8f11
Implement RefreshDataset for distributed control stream
## 📝 Summary In distributed mode, calling `spice refresh <dataset>` on the scheduler failed with `the refresh worker is no longer running. channel closed` because the scheduler doesn't run local refresh workers but still held a dead channel sender. ...
diff --git a/crates/runtime-proto/proto/spice.proto b/crates/runtime-proto/proto/spice.proto index acd8dd3b81b..e2b168485bf 100644 --- a/crates/runtime-proto/proto/spice.proto +++ b/crates/runtime-proto/proto/spice.proto @@ -114,6 +114,7 @@ message SchedulerControlMessage { PollNowCommand poll_now = 2; ...
9
2
2
[{"id": "G0", "claim": "Serializing RefreshOverrides with serde_json::to_string hides the real serialization error by fabricating a FailedToTriggerRefresh with a synthetic SendError(None), and the actual serde_json::Error should be propagated or the correct error cause surfaced instead.", "category": "correctness", "ve...
null
spiceai__spiceai__10066
spiceai/spiceai
10,066
defect
5ecae40fe22c4933106f29814b9024e34100f05e
ed3bef49956a3aa2d8e1167bee6cc1745e383a9c
fix: Prevent write-through stalls and preserve PartitionTableProvider during catalog refresh
## Problem Three issues causing permanent ETL stalls and data loss in partitioned write-through mode during SpiceBench TPC-H benchmarks: ### 1. DoPut idle timeout (original bug) The executor's hardcoded 120s idle timeout fired on write-through partition streams receiving sparse data. With partitioned tables (e.g. `PA...
diff --git a/crates/runtime/src/catalogconnector/cayenne/provider.rs b/crates/runtime/src/catalogconnector/cayenne/provider.rs index 7160513d724..fde4c39083a 100644 --- a/crates/runtime/src/catalogconnector/cayenne/provider.rs +++ b/crates/runtime/src/catalogconnector/cayenne/provider.rs @@ -40,6 +40,7 @@ use crate::pa...
6
4
1
[{"id": "G0", "claim": "Caching the env-var value in a OnceLock inside do_put_idle_timeout() means tests (or callers) cannot change SPICE_DO_PUT_IDLE_TIMEOUT_SECS after the first call in the process, which can introduce order-dependent/flaky tests; consider reading the env var on each call or injecting the timeout via ...
null
spiceai__spiceai__10084
spiceai/spiceai
10,084
defect
bb9b56e9d1fbbceff3efda37df6f23f575a81cb3
a92725c7e0c3c39359dab164cd0eafd11613e8ce
feat: Add metrics for EXPLAIN ANALYZE in FlightSQLExec
## 📝 Summary <!-- What does this PR change? Why is it necessary? Keep it concise. --> * Adds some analyze metrics to `FlightSQLExec` for: * `first_batch_time`: time it takes for the query to begin, to when the first batch is received * `fetch_time`: the entire time it takes to consume the whole stream from...
diff --git a/crates/data_components/src/flightsql.rs b/crates/data_components/src/flightsql.rs index 5110bdb161f..4b525661851 100644 --- a/crates/data_components/src/flightsql.rs +++ b/crates/data_components/src/flightsql.rs @@ -51,6 +51,7 @@ use datafusion::{ DisplayAs, DisplayFormatType, ExecutionPlan, Parti...
4
3
3
[{"id": "G0", "claim": "first_batch_time is recorded on the first stream item even when that item is an Err, and is never recorded if the stream yields zero items; it should be recorded only on the first Ok(RecordBatch) and set to a sensible value for empty streams.", "category": "correctness", "verdict": "supported", ...
null
spiceai__spiceai__10092
spiceai/spiceai
10,092
defect
68192d7034eb730bbd1de35a09a7b2c8ac659fa4
1d29a9a3bfdb4d0f16eb46dd03f973e2935b037d
fix: resolve lint, snapshot drift, and partitioned UPDATE support
## Summary - Fix `cargo fmt` issues in `chunking.rs` and `cayenne/provider.rs` - Update `distributed_acceleration_with_bucket_partitioning` snapshot to match actual query plan output after partial aggregation deduplication fix and filter parenthesization changes - Add `update()` to `PartitionTableProvider` so UPDATE D...
diff --git a/crates/runtime-table-partition/src/provider.rs b/crates/runtime-table-partition/src/provider.rs index 085248b94fb..ddcf4d58d60 100644 --- a/crates/runtime-table-partition/src/provider.rs +++ b/crates/runtime-table-partition/src/provider.rs @@ -411,6 +411,26 @@ impl TableProvider for PartitionTableProvider ...
3
3
2
[{"id": "G0", "claim": "Add unit tests testing the partitioned UPDATE and DELETEs via the partitioned table provider.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "PartitionedUpdateSink builds a fresh default SessionContext per partition and ignores th...
null
spiceai__spiceai__10099
spiceai/spiceai
10,099
defect
da5397d3e41189fd485fa4722be229f9f8d10d8b
64fa4d57fe1b765ed47a3e548ce531367a480976
refactor: Introduce unified statement planner with DELETE migration
## Overview Introduces a **unified SQL statement planner** that intercepts Cayenne DML at the **statement level** — before DataFusion's standard planner — producing `Extension` nodes directly for distributed mode. This is **Milestone 1** of the [unified planner implementation plan](#10095): establish the planner skel...
diff --git a/crates/runtime/src/accelerated_table/refresh.rs b/crates/runtime/src/accelerated_table/refresh.rs index 29696d988c1..9c98847b38f 100644 --- a/crates/runtime/src/accelerated_table/refresh.rs +++ b/crates/runtime/src/accelerated_table/refresh.rs @@ -2476,11 +2476,8 @@ mod tests { // Case 1: stored...
4
4
2
[{"id": "G0", "claim": "create_logical_plan() unconditionally references the planner module that is gated behind #[cfg(not(windows))], so the crate will fail to compile on Windows builds; provide a #[cfg(windows)] fallback or gate the method/call site similarly.", "category": "correctness", "verdict": "supported", "pri...
null
spiceai__spiceai__10108
spiceai/spiceai
10,108
defect
7ccfe1d42583673eb0ab90f9bb5058fe395c735f
0270771e134ae78c2c26e4c046fd73b12a5649c8
Add mode: file_update acceleration mode
## Summary Adds a new acceleration mode `mode: file_update` that: 1. **Loads an existing acceleration file** if it exists (like `mode: file`) 2. **Performs schema inference** from the source on refresh 3. **Checks schema compatibility** — if the change is additive (new columns only), keeps the existing acceleration a...
diff --git a/crates/runtime/src/component/dataset/acceleration.rs b/crates/runtime/src/component/dataset/acceleration.rs index e9717a906b1..bdce3f639c9 100644 --- a/crates/runtime/src/component/dataset/acceleration.rs +++ b/crates/runtime/src/component/dataset/acceleration.rs @@ -66,6 +66,10 @@ pub enum Mode { ///...
9
7
5
[{"id": "G0", "claim": "The remap doc comment sits immediately above engine_to_acceleration_engine, so rustdoc associates the wrong documentation; move it above remap_constraints_to_refresh_schema and give the helper its own doc comment.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": ...
null
spiceai__spiceai__10140
spiceai/spiceai
10,140
defect
3d562f55312a6e9b83a6ae980a4dd6395d0ec89e
ada78730244c12a6640cbd7c802157120e914451
Fix Distributed Cayenne tests
## 📝 Summary * Add missing snapshots * Add `executor_with_app()` builder method to `ClusterHarness` to pass app configuration (catalogs) to executors * Add `wait_for_row_count()` helper to poll for partition assignment before querying after INSERT ...
diff --git a/crates/runtime/tests/cluster/distributed_cayenne_catalog.rs b/crates/runtime/tests/cluster/distributed_cayenne_catalog.rs index 99af7c171ce..ed01be43ca1 100644 --- a/crates/runtime/tests/cluster/distributed_cayenne_catalog.rs +++ b/crates/runtime/tests/cluster/distributed_cayenne_catalog.rs @@ -83,6 +83,31...
3
1
0
[{"id": "G0", "claim": "wait_for_row_count discards errors from scalar_i64(&batches) via unwrap_or(0), which can hide real failures (e.g., unexpected result type) and cause a misleading timeout; the error should be propagated (e.g., `let count = scalar_i64(&batches)?;`) so test failures surface immediately with the roo...
null
spiceai__spiceai__10217
spiceai/spiceai
10,217
defect
bab2e2da081efac4e2631d902d8514adc7e79d63
c70b7c764dbd95b077ef2432595dac00447afec5
fix: handle Utf8View/LargeUtf8 in GitHub connector ref filters
## Problem DataFusion 52 defaults to `map_string_types_to_utf8view=true`, causing string literals in `WHERE` clauses to arrive as `ScalarValue::Utf8View` instead of `ScalarValue::Utf8`. The GitHub connector's ref filter extraction only matched `Utf8`, so `WHERE ref = 'trunk'` silently failed — the filter was ignored a...
diff --git a/crates/data_components/src/github.rs b/crates/data_components/src/github.rs index fb32abb802d..c510e261d86 100644 --- a/crates/data_components/src/github.rs +++ b/crates/data_components/src/github.rs @@ -193,15 +193,26 @@ impl GithubFilesTableProvider { } } +fn scalar_utf8_value(scalar: &ScalarValu...
1
1
1
[{"id": "G0", "claim": "The GitHub ref-filter code paths in commits.rs use expect(\"checked above\") to unwrap scalar_utf8_value in non-test code, which can panic and violates the project's error-handling guidelines; they should bind the value once with if let (or similar) and return Unsupported/an error when it is mis...
null
spiceai__spiceai__10318
spiceai/spiceai
10,318
defect
4a43ee30b1e2d56034e14742f92a7e1f17fd1116
c5e056de260eef1bbbeea27ff266b52796edc225
Handle foreign table + Classic sql warehouse combination gracefully
## 📝 Summary Handle gracefully following use case: * Foreign table * Classic SQL Warehouse Print error: <img width="1726" height="261" alt="Screenshot 2026-04-13 at 6 13 21 PM" src="https://github.com/user-attachments/assets/1d4baaca-d6a3-4dee-8aa6-7bb8fe9fb8da" />
diff --git a/crates/data-connectors/connector-databricks/src/lib.rs b/crates/data-connectors/connector-databricks/src/lib.rs index 069d58c29f9..cef4338374a 100644 --- a/crates/data-connectors/connector-databricks/src/lib.rs +++ b/crates/data-connectors/connector-databricks/src/lib.rs @@ -841,11 +841,7 @@ impl DataConne...
8
5
3
[{"id": "G0", "claim": "Add unit tests covering the new Permanent precedence rules in discover_schema, for Permanent returned from each probe both when the other probe is Ok and when it is Failed/AccessDenied.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim...
null
spiceai__spiceai__10368
spiceai/spiceai
10,368
defect
188d11d099d6fbb08d4eb12f685171102a9d58ac
6cdaf7d015440c5246f7e3b9ad52396eacbeaead
Add `on_schema_resolved` dataset ready state
## Summary Adds a new configurable `ready_state` mode for datasets: `on_schema_resolved`. The dataset is marked ready as soon as the federated source's schema is resolved (which also implies permissions / access have been verified), **without** waiting for the initial data refresh to complete. Queries fall back to the...
diff --git a/.schema/spicepod.schema.json b/.schema/spicepod.schema.json index 3f82fe4205f..6a5f730f52f 100644 --- a/.schema/spicepod.schema.json +++ b/.schema/spicepod.schema.json @@ -2557,6 +2557,11 @@ "description": "The table is ready immediately on registration, with fallback to federated table for quer...
5
5
2
[{"id": "G0", "claim": "The new on_schema_resolved integration tests add new Insta snapshot names but the corresponding .snap files are not present under crates/runtime/tests/ready_state/snapshots/, so the tests will fail in CI unless the snapshots (both initial and _after_loading, including DuckDB variants) are genera...
null
spiceai__spiceai__10465
spiceai/spiceai
10,465
defect
340ff8370b3ddf15e1557bb8e0e7be13fdf3b1a4
2322af451f095dba4cc0b717fd8e64e801b9c2d2
Enable filter pushdown for `rrf` UDTF
PR Implements filter pushdown for the `rrf()` table function so that `WHERE` predicates on base columns (e.g. `WHERE review_date > '2015-06-15' `) are injected into each nested search sub-query and not applied after fusion. ### Why Consider this query — searching for problematic app reviews within a specific cate...
diff --git a/crates/runtime/src/search/rrf.rs b/crates/runtime/src/search/rrf.rs index b0c1eb025db..c360880e52a 100644 --- a/crates/runtime/src/search/rrf.rs +++ b/crates/runtime/src/search/rrf.rs @@ -30,11 +30,11 @@ use datafusion::logical_expr::{ use datafusion::physical_plan::ExecutionPlan; use datafusion::prelude...
3
3
1
[{"id": "G0", "claim": "The test helper make_rrf_provider obtains its DataFrame with ctx.table(\"t\").now_or_never(), which can return None (panicking the helper) or be flaky depending on executor behavior; prefer building the DataFrame synchronously via ctx.read_table or block_on/#[tokio::test].", "category": "testing...
null
spiceai__spiceai__10523
spiceai/spiceai
10,523
defect
cf7ccbffc786b30178276df79e234aac7d6515c3
d7b8e906bc63b8ff4b15e706284b834751119f8a
fix(llms): support Gemma models with missing attention_bias config field
## Summary Loading Gemma models (e.g. `google/gemma-2-2b-it`, Gemma 3 variants) from HuggingFace fails with: ``` Failed to load LLM: gemma. Failed to load the model. An error occurred: missing field `attention_bias` at line 197 column 1 ``` Newer Gemma HuggingFace configs omit the `attention_bias` field, but mistral...
diff --git a/Cargo.lock b/Cargo.lock index 082423b939c..66281c63e49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11363,7 +11363,7 @@ dependencies = [ [[package]] name = "mistralrs" version = "0.7.0" -source = "git+https://github.com/spiceai/mistral.rs?rev=27405ba1a1fe5d6dfc70ad8fc9ca037da85b5f84#27405ba1a1fe5d6dfc70...
6
4
1
[{"id": "G0", "claim": "The regression-test doc comment links to a placeholder issue URL (https://github.com/spiceai/spiceai/issues/...); replace it with the real issue number or remove the link so the reference is actionable.", "category": "documentation", "verdict": "uncertain", "priority": "P2", "scope": "introduced...
null
spiceai__spiceai__10554
spiceai/spiceai
10,554
defect
9e561c3ec8aa2b3b63df80fc63ac9671320878e7
e28376c3e5d9bf5651f12b3246797b02bc385a79
Support views on DDL catalogs
## 📝 Summary Cannot create views on Cayenne catalogs because the catalog is not checked during view-dependency checking. This PR now checks all catalogs when checking if the view's dependencies exist. Note: There is a broader DX issue with views on Cayenne catalogs worth mentioning. To create a view, one must sti...
diff --git a/crates/runtime/src/datafusion/mod.rs b/crates/runtime/src/datafusion/mod.rs index eff6f45bb17..8f3db44117c 100644 --- a/crates/runtime/src/datafusion/mod.rs +++ b/crates/runtime/src/datafusion/mod.rs @@ -1369,7 +1369,13 @@ impl DataFusion { #[must_use] pub fn table_exists(&self, dataset_name: T...
6
4
4
[{"id": "G0", "claim": "Inside the tokio::spawn task the call to self.table_exists captures self by reference and typically prevents the spawned future from being 'static; use the already-cloned df_ref instead.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "...
null
spiceai__spiceai__10601
spiceai/spiceai
10,601
defect
59fbd32c481cca2b43ae604e560243eb47e16f51
7e1b3a838aaacc2747d38c0afc41ca56118d964e
fix(iceberg): rebuild storage factory when Hadoop catalog scheme is inferred
## Description When a Hadoop catalog's warehouse root scheme (e.g. `s3://`) does not match the scheme used in the table metadata locations (e.g. `s3a://`), the existing scheme inference logic in `HadoopCatalogBuilder::inner_build` rebuilds the catalog with the inferred warehouse root. However, since the iceberg-rust v...
diff --git a/crates/data_components/src/iceberg/catalog/hadoop/catalog.rs b/crates/data_components/src/iceberg/catalog/hadoop/catalog.rs index c415e7d34ca..c182c9328c8 100644 --- a/crates/data_components/src/iceberg/catalog/hadoop/catalog.rs +++ b/crates/data_components/src/iceberg/catalog/hadoop/catalog.rs @@ -41,17 +...
3
2
2
[{"id": "G0", "claim": "inner_build returns the generic \"Either file_io, storage_factory, or storage_factory_builder must be provided\" error when storage_factory_builder is set but warehouse_root lacks a '://' scheme, which is misleading; it should validate the scheme and return a more specific DataInvalid error inst...
null
spiceai__spiceai__6482
spiceai/spiceai
6,482
defect
e5cb32f912116f163a93c310dc833cfea108c7af
eef4faed357966d2e2d5dd8df0ec80e718feb20d
Add per-dataset availability monitor configuration
## Summary Adds a new `check_availability` configuration option to individual datasets to control whether the dataset availability monitor checks that specific dataset. This provides granular control over which datasets are monitored, preventing unnecessary remote calls that could wake up expensive warehouses. - Cl...
diff --git a/crates/runtime/src/component/dataset/builder.rs b/crates/runtime/src/component/dataset/builder.rs index c59244016b5..e0c6e1ddf98 100644 --- a/crates/runtime/src/component/dataset/builder.rs +++ b/crates/runtime/src/component/dataset/builder.rs @@ -17,8 +17,8 @@ limitations under the License. use std::{col...
2
1
0
[{"id": "G0", "claim": "The name of the AvailabilityMonitor::Default variant does not convey what it means; the reviewer assumes it is just an 'Enabled'-style variant and asks for the naming to be clarified.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", ...
null
spiceai__spiceai__6830
spiceai/spiceai
6,830
defect
04f96b4cee3e507c9b3bcd183e4d893a0508b2f1
a3b1ad5a48acd36b9ab441faa77d8bc8d6ac1400
Add non-streaming and streaming support for OpenAI Responses API endpoint
## 📝 Summary - This PR adds support for a non-streaming and streaming endpoint compatible with the OpenAI Responses API ## 🔗 Related - Closes #6759
diff --git a/crates/llms/src/chat/mod.rs b/crates/llms/src/chat/mod.rs index 3c17c9ddcf1..9b15ead1371 100644 --- a/crates/llms/src/chat/mod.rs +++ b/crates/llms/src/chat/mod.rs @@ -162,6 +162,11 @@ pub enum Error { model: String, source: Box<dyn std::error::Error + Send + Sync>, }, + + #[snafu...
10
9
3
[{"id": "G0", "claim": "The handler holds the store's read lock for the whole match arm including model inferencing; it would be better practice to clone the reference-counted model out first so the lock scope excludes inferencing.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introdu...
null
spiceai__spiceai__6941
spiceai/spiceai
6,941
defect
099466c4485b86aceab82717ac755f2a1f7dc247
92401d211b1e98bc668ff3a00e82d88d230bc86b
Support Streaming with Tool Calls
## 📝 Summary - See title - https://github.com/spiceai/async-openai/pull/25 ## 🔗 Related - Closes #6927
diff --git a/Cargo.lock b/Cargo.lock index fe6b3474eba..66f34106c05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -841,7 +841,7 @@ dependencies = [ [[package]] name = "async-openai" version = "0.29.1" -source = "git+https://github.com/spiceai/async-openai?rev=0001d1237b46269740d2a4a50402a7880ee8f917#0001d1237b46269740...
5
5
0
[{"id": "G0", "claim": "The '// Show spinner if requested' comment in handleResponsesAPI should be kept.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The removed blank line above the handleChatCompletions comment should be restored.", "category"...
null
spiceai__spiceai__6979
spiceai/spiceai
6,979
defect
246c46c4d96458ef8520f87225f01e4cc8b4f10b
c147e42eec554bf385ece76b21386c5128d67e70
Add integration tests for models endpoint
## 📝 Summary <!-- What does this PR change? Why is it necessary? Keep it concise. --> ## 🔗 Related - Closes #6956 ## 🚨 Breaking Changes <!-- Describe breaking changes if any, or delete this section. --> <!-- If breaking, make sure the "breaking change" label is added. --> ## 📚 Docs <!-- Note an...
diff --git a/crates/runtime/tests/models/mod.rs b/crates/runtime/tests/models/mod.rs index c6e56fd6fc5..6c7c290e628 100644 --- a/crates/runtime/tests/models/mod.rs +++ b/crates/runtime/tests/models/mod.rs @@ -35,6 +35,7 @@ mod bedrock; mod embedding; mod hf; mod local; +mod models_http_endpoint; pub(crate) mod open...
2
2
0
[{"id": "G0", "claim": "Use insta::assert_json_snapshot (with redactions where needed so snapshots don't depend on parts that change between test runs) instead of hand-written assertions on the models response.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim...
null
spiceai__spiceai__7055
spiceai/spiceai
7,055
defect
f859d8141a96d0ce5de99153b9f08d274b340cf2
ee984aea921f4995fb54f652134946aa41c9b8e1
Use proper federation in `max_timestamp_df` during acceleration refresh
Closes #6908 The way we currently initilize dataframe in `max_timestamp_df` results in a full `TableScan` (see original ticket for more details) In order to fix this we can downcast `accelerator` to `PolyTableProvider`, and then extract federated table source. After doing this I ran into an issue with casting...
diff --git a/Cargo.lock b/Cargo.lock index a5ff453c220..f9e8683e308 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3744,7 +3744,7 @@ dependencies = [ [[package]] name = "datafusion" version = "48.0.1" -source = "git+https://github.com/spiceai/datafusion.git?rev=0c7ce0f94a4d3888ab280d81f06106ed736aba24#0c7ce0f94a4d3888...
2
2
2
[{"id": "G0", "claim": "The accelerator_df change dropped the EnsureSchema wrapper that was there before, and it may no longer be needed.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Tests should be added covering the accelerator_df change.", "cat...
null