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
twmb__franz-go__1057
twmb/franz-go
1,057
defect
669b18eeee83408f04b848f0a5069dcd86153413
d19d8f9241c8e060f30a318050693248c4393b8f
Use unlimited ring buffers in the Produce path, to allow in-flight Produce requests per broker to go above 9 (when configured to a higher value)
In this PR I propose a refactoring to ring buffers to address the issue https://github.com/twmb/franz-go/issues/1041. In details: 1. Replace type-specific implementation with generics 2. Have two ring buffer implementations, both supporting `die()`: - `fixedRing`: this is the fixed size ring (8 elements). `die()...
diff --git a/pkg/kgo/broker.go b/pkg/kgo/broker.go index b1681a5a4..c3d3b0d22 100644 --- a/pkg/kgo/broker.go +++ b/pkg/kgo/broker.go @@ -159,7 +159,7 @@ type broker struct { reapMu sync.Mutex // held when modifying a brokerCxn // reqs manages incoming message requests. - reqs ringReq + reqs unlimitedRing[promised...
3
3
0
[{"id": "G0", "claim": "Remove the now-unused fixedRing completely and rename unlimitedRing to simply ring (adjusting the docs too).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The added overflow-shrink logic can never fire, because each pull...
null
twmb__franz-go__1085
twmb/franz-go
1,085
defect
29dc44e616cd48d1c37bfae651ee9ac7120c32f7
612f26b66479c715648c156ae6d3374aa8d3b92c
kgo: add Fetches.RecordsAll to return a Go native iterator of records in fetches
The PR adds a new method `Fetches.RecordsAll`, to return an iterator over the records in the fetches. The method is similar to the existing `Fetches.RecordIter` and `Fetches.EachRecord`, but it returns the `iter.Seq`, allowing users to opt for the range-over-function. I'm not sure if it's worth adding iterator-ve...
diff --git a/pkg/kgo/group_test.go b/pkg/kgo/group_test.go index d3a21d5e2..d3e614dd1 100644 --- a/pkg/kgo/group_test.go +++ b/pkg/kgo/group_test.go @@ -202,8 +202,7 @@ func (c *testConsumer) etl(etlsBeforeQuit int) { } netls++ - for iter := fetches.RecordIter(); !iter.Done(); { - r := iter.Next() + for r :...
2
2
0
[{"id": "G0", "claim": "The RecordsAll doc comment should reference RecordIter using the Go doc-link syntax [RecordIter] instead of RecordIter().", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "It may be worth adding a reference to RecordsAll in th...
null
twmb__franz-go__1205
twmb/franz-go
1,205
defect
c3eeb81fdaf1be68ab254548eb53c37cd9024ca1
a9b8ab823e8114b7a84c9e73816da950d1fdc6d8
Fix deadlock polling multiple times before allowing rebalance
Closes: https://github.com/twmb/franz-go/issues/1200 Fixes deadlock when polling multiple times before allowing a rebalance when `BlockRebalanceOnPoll` is set.
diff --git a/pkg/kgo/consumer.go b/pkg/kgo/consumer.go index f37d3f1f2..8ad7a4cd5 100644 --- a/pkg/kgo/consumer.go +++ b/pkg/kgo/consumer.go @@ -239,8 +239,10 @@ func (c *consumer) waitAndAddPoller() { } c.pollWaitMu.Lock() defer c.pollWaitMu.Unlock() - for c.pollWaitState>>32 != 0 { - c.pollWaitC.Wait() + if c....
2
2
1
[{"id": "G0", "claim": "The reviewer asks why the conditional that fails the test when a poll error comes with unexpected records was deleted.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The test should include a doc comment explaining that the p...
null
twmb__franz-go__1210
twmb/franz-go
1,210
defect
24b7a27738c13e48c345f391a4cfeab3e9a1bb60
1de163c3e8e50e7461243dfd6dd85ed6db82ef49
Include uncompressed/compressed message size in MessageTooLarge error
Fixes [1204](https://github.com/twmb/franz-go/issues/1204) Error message when originated from client-side: `MESSAGE_TOO_LARGE: The request included a message larger than the max message size the server will accept (uncompressed_bytes=100000500).` Error message when originated from broker-side: `MESSAGE_TOO_...
diff --git a/pkg/kerr/kerr.go b/pkg/kerr/kerr.go index b61f72a7c..09c6a9e73 100644 --- a/pkg/kerr/kerr.go +++ b/pkg/kerr/kerr.go @@ -83,7 +83,7 @@ var ( RequestTimedOut = &Error{"REQUEST_TIMED_OUT", 7, true, "The request timed out."} BrokerNotAvailable = &Error{"BROKER_NOT_AVAILAB...
3
3
0
[{"id": "G0", "claim": "The hasHook bool on produceRequest is unnecessary now and should be deleted.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "A bool could be saved in the sink struct, leaving the lgtm aside as a minor cleanup.", "category"...
null
twmb__franz-go__1245
twmb/franz-go
1,245
defect
80decedc8916c5c5b2d7d594e22b2671dd779a51
8e73b92f6bd0fe5fd844758f3b03e849e3f0cf85
kgo: do not reuse idle connection after connIdleTimeout
Check `connIdleTimeout` in `loadConnection` before reusing a connection, instead of solely relying on the background reap loop. If a connection has been idle for longer than `connIdleTimeout`, it is killed and a new connection is created. This gives a hard guarantee that a connection is never reused after the configure...
diff --git a/pkg/kgo/broker.go b/pkg/kgo/broker.go index f32414488..ab7a9ca6c 100644 --- a/pkg/kgo/broker.go +++ b/pkg/kgo/broker.go @@ -555,6 +555,12 @@ func (b *broker) loadConnection(ctx context.Context, req kmsg.Request) (*brokerC pcxn = &b.cxnSlow } + // Do not reuse a connection that has been idle for long...
7
5
1
[{"id": "G0", "claim": "Calling (*pcxn).die() inline may block loadConnection (die can block, e.g. on a TLS close write), so consider calling it in a goroutine instead.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Consider bumping the connIdleTime...
null
twmb__franz-go__1267
twmb/franz-go
1,267
defect
0873149f2e76aa392809bffdacea4434c433ebc7
1e1da7021c286f3419c05d203bd0c86e375681da
sr: add schema context support and generic context handling in srfake
## Summary - Add `WithSchemaContext` / `DefaultSchemaContext` to scope any `sr.Client` request to a schema registry context by prepending `/contexts/{name}` to paths - Add new API methods: `Contexts`, `DeleteContext` - Add `ContextPrefix`, `Offset`, and `Limit` query parameters - Update `srfake` with a generic co...
diff --git a/pkg/sr/api.go b/pkg/sr/api.go index 3ba091481..54c7a1733 100644 --- a/pkg/sr/api.go +++ b/pkg/sr/api.go @@ -9,9 +9,6 @@ import ( "sync/atomic" ) -// TODO -// * /contexts (get) // looks niche right now - // This file is an implementation of: // // https://docs.confluent.io/platform/current/schem...
6
5
1
[{"id": "G0", "claim": "Rename DeleteContext's argument `context_` to a clearer name.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The DefaultSchemaContext doc comment should say it sets a default schema registry context (namespacing) applied ...
null
twmb__franz-go__1287
twmb/franz-go
1,287
defect
72fe24297b24b071f1a1e8524d6f6f65af3086bd
32fb43a4ab7258162e12c462502d85234a293d04
kprom, kvictoria: Add `BrokerLabels` Opt for fine-tuning broker metric labels
fixes: https://github.com/twmb/franz-go/issues/1284 * Several labels can be emitted on the broker metrics. This PR adds a config `Opt` to allow control over which labels are emitted. * Add the same option to `kvictoria` since it has the same label. * Added some basic tests.
diff --git a/plugin/kprom/config.go b/plugin/kprom/config.go index 0458f1747..f2621f76c 100644 --- a/plugin/kprom/config.go +++ b/plugin/kprom/config.go @@ -21,6 +21,7 @@ type cfg struct { histograms map[Histogram][]float64 defBuckets []float64 fetchProduceOpts fetchProduceOpts + brokerLabels []st...
2
2
1
[{"id": "G0", "claim": "kvictoria should include the rack label with an empty value when the broker has no rack, so that adding a rack later does not create a different time series.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The BrokerLabels doc...
null
twmb__franz-go__1289
twmb/franz-go
1,289
defect
72fe24297b24b071f1a1e8524d6f6f65af3086bd
2b542caaa3033735fa3e54bddc0a66b174bf7a00
kgo: add HookPollStart hook
As part of the franz-go [dd-trace-go integration](https://github.com/DataDog/dd-trace-go/pull/4623), we need a way to finish consumer spans. In other Kafka integrations we follow the convention of closing the previous poll's spans when the next fetch begins, but franz-go had no hook for that boundary. This PR adds `...
diff --git a/pkg/kgo/client_test.go b/pkg/kgo/client_test.go index a60c9ca7d..072a68c92 100644 --- a/pkg/kgo/client_test.go +++ b/pkg/kgo/client_test.go @@ -207,6 +207,24 @@ type someHook struct { index int } +type pollStartHook struct{} + +func (*pollStartHook) OnPollRecordsStart() {} + +func TestHookPollRecordsS...
2
2
0
[{"id": "G0", "claim": "OnPollRecordsStart should take the context that the user passes to PollRecords/PollFetches.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The hook should be named OnPollStart / HookPollStart since it is used for both PollFetches ...
null
twmb__franz-go__356
twmb/franz-go
356
defect
de9eca20945de922a5d0b6a43a1888c0355b78a6
11dba8ee441ff29088ad663fba6bfb6fdb1dc059
plugin/klogr: support for go-logr
Benchmark results of different LogLevels: ``` goos: darwin goarch: amd64 pkg: github.com/twmb/franz-go/plugin/klogr cpu: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz BenchmarkLogError BenchmarkLogError-16 675142 1769 ns/op BenchmarkLogInfo BenchmarkLogInfo-16 712615 1632 ns/op BenchmarkLo...
diff --git a/plugin/klogr/go.mod b/plugin/klogr/go.mod new file mode 100644 index 000000000..0c14c1130 --- /dev/null +++ b/plugin/klogr/go.mod @@ -0,0 +1,8 @@ +module github.com/twmb/franz-go/plugin/klogr + +go 1.16 + +require ( + github.com/go-logr/logr v1.2.3 + github.com/twmb/franz-go v1.5.3 +) diff --git a/plugin/k...
1
1
1
[{"id": "G0", "claim": "The Debug-only option is not enough: Level() only ever returns Error or Debug, so warn is currently missing and kgo's Info (and Warn) calls will never be logged when the klogr level is Error; the maintainer asks that the plugin support all levels instead, e.g. via the proposed levelMap/LevelToV ...
null
twmb__franz-go__467
twmb/franz-go
467
defect
18e3c132ada05a3c6b782bcc33e3c03932c4ded7
ca4c5e2ec90a86184ec5f920ea7a6a8b884ff5f0
Serde Header
This PR introduces `SerdeHeader` and defines `ConfluentHeader` as the default implementation. The behavior of `Serde` is the same, ~one small but important difference is a fixed bug in the encoding of the message index (see the second part of the PR description)~. The changes are mostly just a refactoring and extractio...
diff --git a/pkg/sr/serde.go b/pkg/sr/serde.go index 3f95af017..8d91f6de3 100644 --- a/pkg/sr/serde.go +++ b/pkg/sr/serde.go @@ -1,19 +1,14 @@ package sr import ( + "bytes" "encoding/binary" "errors" - "io" "reflect" "sync" "sync/atomic" ) -// The wire format for encoded types is 0, then big endian uin...
11
10
3
[{"id": "G0", "claim": "The documentation describing the index array encoding is worded confusingly (\"reading the array backwards\" describes the sentence itself, not the wire encoding), which cast doubt on the PR's reversed index encoding order.", "category": "correctness", "verdict": "supported", "priority": "P1", "...
null
twmb__franz-go__601
twmb/franz-go
601
defect
6a961da9c19bd201bdf444aa80164cc94267c8ed
e06aa3d6c12c3bf298bf48aa62f7258ed83438dc
kgo: do not rotate the consumer session when pausing topics/partitions
Issue #489 asked to stop returning data after a partition was paused -- the original implementation of pausing kept returning any data that was in flight or already buffered, and simply stopped fetching new data. 489 was dealt with by bumping the consumer session, which kills all in flight fetch requests. This was e...
diff --git a/pkg/kgo/consumer.go b/pkg/kgo/consumer.go index 475270ed5..4c88b112e 100644 --- a/pkg/kgo/consumer.go +++ b/pkg/kgo/consumer.go @@ -433,6 +433,10 @@ func (cl *Client) PollRecords(ctx context.Context, maxPollRecords int) Fetches { }() } + c.pausedMu.Lock() + defer c.pausedMu.Unlock() + paused :=...
1
1
0
[{"id": "G0", "claim": "takeBuffered should return early (via s.takeBufferedFn(true, usedOffsets.finishUsingAllWithSet)) when nothing is paused, so the per-offset paused check inside eachOffset can be dropped.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
twmb__franz-go__619
twmb/franz-go
619
defect
a6d10d4ad93528f7c2e8ed735a40bb1bd8a03c8a
c298e612f2f91eeea2b5030c72243798ed9a116a
use interface instead *logrus.Logger in plugin klogrus
Hello We use some wrappers around `*logrus.Logger` and we don't want to write a wrapper each time we need to set the kafka logger Instead, since most of the time we use `logrus.FieldLogger` with some extra methods, I decided to send this small contribution where we can use this _minimal_ interface ```go // Fi...
diff --git a/plugin/klogrus/go.mod b/plugin/klogrus/go.mod index 5f4e7366c..4e596a0e5 100644 --- a/plugin/klogrus/go.mod +++ b/plugin/klogrus/go.mod @@ -4,13 +4,16 @@ go 1.18 require ( github.com/sirupsen/logrus v1.9.3 + github.com/stretchr/testify v1.8.0 github.com/twmb/franz-go v1.14.3 ) require ( + github...
3
2
0
[{"id": "G0", "claim": "The explicitly added `case kgo.LogLevelNone: return logrus.TraceLevel, false` is redundant with the unconditional return just below and should be removed.", "category": "maintainability", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The `// FieldLogger...
null
twmb__franz-go__681
twmb/franz-go
681
defect
52a9ebaedf4718ca77692a91fca699383d76dd7c
a6473e31fe0d755080ff41271f2c540988c22664
Added ability to retrieve current clients target topics
Currently I am looking at multiple dynamic deployments of this library and I'm looking to implement checks prior to initialized polling which need to verify that the necessary topics have been assigned to the consumer client. Please advise if you require additional unit tests for the ConsumerGroup path.
diff --git a/pkg/kgo/consumer.go b/pkg/kgo/consumer.go index 76ba397b5..bc0ef5456 100644 --- a/pkg/kgo/consumer.go +++ b/pkg/kgo/consumer.go @@ -758,6 +758,32 @@ func (cl *Client) AddConsumeTopics(topics ...string) { cl.triggerUpdateMetadataNow("from AddConsumeTopics") } +// GetConsumeTopics retrives a list of cur...
1
1
1
[{"id": "G0", "claim": "The doc note on GetConsumeTopics wrongly states that when directly consuming with ConsumePartitions the function is not aware of the consumption topic target(s) — twmb says the code adds to `tps` for partition consuming too — and the note's \"If\" should be \"if\".", "category": "documentation",...
null
twmb__franz-go__774
twmb/franz-go
774
defect
a5f2b710830e32fc3f90374be47ec59849807342
221133201653640ed6bd21ca2b46285b846f25ef
refactor: replace sliceWriter with bytes.Buffer and use it in decompression
This MR resolves #623 by using a byte buffer in decompression instead of always creating a new one. It also replaces the custom `sliceWriter` with the standard `bytes.Buffer` everywhere.
diff --git a/pkg/kgo/compression.go b/pkg/kgo/compression.go index c5f272349..803800a39 100644 --- a/pkg/kgo/compression.go +++ b/pkg/kgo/compression.go @@ -14,15 +14,7 @@ import ( "github.com/pierrec/lz4/v4" ) -// sliceWriter a reusable slice as an io.Writer -type sliceWriter struct{ inner []byte } - -func (s *sl...
1
1
1
[{"id": "G0", "claim": "The bytes.Buffer-based Snappy/Zstd compression doubly writes and can doubly allocate, since EncodeSnappy/EncodeAll may return a new larger slice that dst.Write then copies, so the change should avoid the extra copy/allocation, e.g. by keeping sliceWriters or pre-growing the buffer with the codec...
null
twmb__franz-go__870
twmb/franz-go
870
defect
cea7aa5d803781e5f0162187795482ba1990c729
aa1c73c2530a20efdc28285f66a861c4417e1106
kadm: add func to decode AuthorizedOperations
The authorized operations is an int32 bitfield that represents ACL operations. This commit adds a func that allows to decode the bitfield into a slice of kmsg.ACLOperation values. This bitfield is used in the metadata, describe clusters and describe groups API responses. Fixes https://github.com/twmb/franz-go/...
diff --git a/pkg/kadm/acls.go b/pkg/kadm/acls.go index 62676b5b8..790086844 100644 --- a/pkg/kadm/acls.go +++ b/pkg/kadm/acls.go @@ -3,6 +3,7 @@ package kadm import ( "context" "fmt" + "math" "strings" "sync" @@ -1115,3 +1116,55 @@ func createDelDescACL(b *ACLBuilder) ([]kmsg.DeleteACLsRequestFilter, []*kmsg...
1
1
0
[{"id": "G0", "claim": "DecodeACLOperations should return the kadm package's own ACLOperation type instead of kmsg.ACLOperation, which would require changing only the signature line.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
twmb__franz-go__963
twmb/franz-go
963
defect
24c7bd02efb58f2e61f11966bbed590596c0b85f
13e34ee6f8635a8039fd12321779e95060c2e472
sr: add `Client.OptValue` and `Client.OptValues` functions
This PR adds `Client:OptValue` and `Client.OptValues` functions to the `sr` package. These are heavily based on the functions of the same name in the `kgo` package. ~~Note that I did not add a case and unit test for the `DialTLSConfig` option because this option creates a new `http.Client` object with TLS preconfig...
diff --git a/pkg/sr/client.go b/pkg/sr/client.go index a436255de..d41b26751 100644 --- a/pkg/sr/client.go +++ b/pkg/sr/client.go @@ -25,6 +25,9 @@ import ( "io" "net/http" "net/url" + "reflect" + "runtime" + "strings" "time" ) @@ -87,6 +90,19 @@ func NewClient(opts ...ClientOpt) (*Client, error) { return c...
3
3
1
[{"id": "G0", "claim": "The DialTLSConfig option should be switched to store the TLS config itself, with the client initialized in NewClient.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "OptValues should return the BasicAuth user and pass as two sepa...
null
twmb__franz-go__978
twmb/franz-go
978
defect
a6799499b8d12f5278590df269566d0556d379dc
bf5238b3aaa7cfb36c1ef2087e5d62a8f79f8de3
sr: refactor DialTLSConfig option so it is stored in client
This PR refactors the `DialTLSConfig` option setter so the TLS config is stored in `sr.Client` and applied in `sr.NewClient` instead of the option setter. Note that using `DialTLSConfig()` overrides any client set with `HTTPClient()`. This is the same behaviour as before. After this PR is merged, I will add the m...
diff --git a/pkg/sr/client.go b/pkg/sr/client.go index a436255de..904338379 100644 --- a/pkg/sr/client.go +++ b/pkg/sr/client.go @@ -19,10 +19,12 @@ package sr import ( "bytes" "context" + "crypto/tls" "encoding/json" "errors" "fmt" "io" + "net" "net/http" "net/url" "time" @@ -55,6 +57,7 @@ func (e *...
3
3
1
[{"id": "G0", "claim": "DialTLSConfig should not unconditionally override a custom HTTPClient set via the HTTPClient option (a behavior change from the old last-option-wins code); instead the PR should support combining them, returning errors when the custom client's transport is not an *http.Transport or has its own d...
null
twofas__2fas-server__14
twofas/2fas-server
14
defect
134b4b3ac4f5d99ebc7974bd45d063c7d05123ae
fc1db7eb97c8ff5ed30abdf2087589e8d266ff10
fix: concurrency problems in ws handler
Synchronise access to hubs, properly remove hubs when they no longer have clients.
diff --git a/internal/websocket/common/client.go b/internal/websocket/common/client.go index 0877694..d1af2b6 100644 --- a/internal/websocket/common/client.go +++ b/internal/websocket/common/client.go @@ -2,9 +2,10 @@ package common import ( "bytes" + "time" + "github.com/gorilla/websocket" "github.com/twofas/...
4
3
0
[{"id": "G0", "claim": "Rename the Hub struct field onHubIsHasNoClients to onHubHasNoClients.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Rewrite isEmpty so that the Range lambda returns false and the method returns true, simplifying the impl...
null
twofas__2fas-server__24
twofas/2fas-server
24
defect
1413d107b3ab6f26f8e2dbfbded6fda3d5925039
4f68cc2e611dca18b9787942e5cf12fc16518dd4
feat(pass): tokens
Add token signing and veryfication to be used by pass.
diff --git a/.gitignore b/.gitignore index 9758ec4..d3e3f43 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ licenses-errors data/ .env.testing + diff --git a/docker-compose.yml b/docker-compose.yml index 17ec399..4a63fc6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -93,6 +93,18 @@ services...
5
5
0
[{"id": "G0", "claim": "The tests named TestKeyEncryptionAndVerification* in tests/pass/kms_test.go and internal/pass/sign/lib_test.go should be renamed to say they sign rather than encrypt.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The 'in...
null
twolfson__spritesmith__96
twolfson/spritesmith
96
defect
3bb5516add71bc17fe11f2112707208eed8a632a
6d6a3cfcdf877601849ea57817961cee33aca064
Fix deprecation warnings
* ~resolve moderate severity npm audit warning with tough-cookie override~ * fix deprecation warning message for tests by updating Buffer * add package-lock to .gitignore
diff --git a/.gitignore b/.gitignore index ed8c35a..1d897c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /node_modules /src-test/actual_files -/scratch \ No newline at end of file +/scratch +package-lock.json \ No newline at end of file diff --git a/package.json b/package.json index eb50b9d..6d30e34 10064...
1
1
1
[{"id": "G0", "claim": "Putting an `overrides` entry in package.json is not something a package maintainer should ship — the tough-cookie override belongs on a per-project basis (e.g. documented as a workaround in #93 until get-pixels releases) rather than imposed by this package.", "category": "design", "verdict": "su...
null
twoslashes__twoslash__7
twoslashes/twoslash
7
defect
a15255beeecd5d5b9d9c2e833ab1708cd17d6680
900947e912d5073f2665ccbc11b26fca8b7ded00
docs: some work on moving over the reference docs
I've started porting over the reference docs from the shiki-twoslash playground! One tricky deprecation blocker so far, which is the auto-complete query doesn't work because it can't grab the character _after_ the last one ``` console.e // ^| ``` => ``` Error: [shikiji-twoslash] Cannot find token at L...
diff --git a/docs/.vitepress/theme/homepage.scss b/docs/.vitepress/theme/homepage.scss index 91ed0a9d..430af060 100644 --- a/docs/.vitepress/theme/homepage.scss +++ b/docs/.vitepress/theme/homepage.scss @@ -9,7 +9,7 @@ } -main.main { +main.main-intro { padding: 5rem 0; flex: 1; display: flex; @@ -19,7 +19...
2
1
0
[{"id": "G0", "claim": "Document the `---cut-start---`/`---cut-end---` cut pairs, which the reviewer says are supported and would be useful, in the notations reference docs — the reviewer offers to add them later if the author prefers.", "category": "documentation", "verdict": "uncertain", "priority": "P2", "scope": "i...
null
twpayne__chezmoi__4013
twpayne/chezmoi
4,013
defect
fe2dba7aee848dcd10a28482c6c2166a6a3d9641
1e6c7961273cd4322654d1ab4dc5915ce0a12072
feat: Extend squote template func to handle more types
<!-- Thanks for contributing! Please make sure that you have followed the contributing guide: https://chezmoi.io/developer-guide/contributing-changes/ --> Similar to #4009 but for `squote` this time. As you correctly mentioned on #4007 current implementation of `squote` in `sprig` is far from being correc...
diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 42ff35520294..07bb2a3ea4de 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -406,6 +406,7 @@ func newConfig(options ...configOption) (*Config, error) { delete(c.templateFuncs, "fromJson") delete(c.templateFuncs, "quote") delete(...
3
1
0
[{"id": "G0", "claim": "quote, quoteList, squote (and squoteList if it exists) should share a single function that applies the appropriate quoting.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "chezmoi should not support squote beyond Sprig's c...
null
twpayne__chezmoi__4076
twpayne/chezmoi
4,076
defect
d26788d49f13db1b2b793d44e1260f9853191c4b
28a3273dbf45d0be00a0c20a633df35f631ebcfb
chore: Run tests in parallel jobs
<!-- Thanks for contributing! Please make sure that you have followed the contributing guide: https://chezmoi.io/developer-guide/contributing-changes/ --> ## Changes - Add `-filter` flag to `TestScript` which allows to filter scripts by filename using regex. This can be useful for tests sharding and run...
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03f98ff05938..a86ca8e075a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -126,6 +126,11 @@ jobs: export DOCKER_GOCACHE="$HOME/.go-archlinux" ./assets/docker/test.sh archlinux test-macos: + na...
3
1
0
[{"id": "G0", "claim": "Before splitting the tests, confirm that CI runtime is dominated by test execution rather than cache loading/compiling; if it is not, splitting may not help.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Running the I/O-heavy tests...
null
twpayne__chezmoi__4163
twpayne/chezmoi
4,163
defect
562177ae26a2869599a722f4dd5cf8e064b8a0d5
60c1bb2d717dea5c9eaf533156ccf14c6bfc15d9
feat: Add chezmoi:template:format-indent template directive
Fixes #3873. Implements @bradenhilton's suggestion in https://github.com/twpayne/chezmoi/pull/3875#issuecomment-2241866024. This still needs some work, so this is draft PR.
diff --git a/assets/chezmoi.io/docs/reference/templates/directives.md b/assets/chezmoi.io/docs/reference/templates/directives.md index 75531dc86779..174218411a54 100644 --- a/assets/chezmoi.io/docs/reference/templates/directives.md +++ b/assets/chezmoi.io/docs/reference/templates/directives.md @@ -37,6 +37,22 @@ inheri...
2
1
1
[{"id": "G0", "claim": "The single format-indent directive, which accepts either an integer number of spaces or a string, should be replaced by two mutually exclusive directives: format-indent-width for the integer number of spaces per level and format-indent for a string value.", "category": "design", "verdict": "supp...
null
twpayne__chezmoi__4189
twpayne/chezmoi
4,189
defect
94f00d11d79581d5bc755574861a22b7716d81b0
7d7c3995d758e613f25b8e34e7d16ddf766038c5
fix: Correct nested groups for keepassxc builtin mode
This PR fixes nested groups for keepassxc when run in builtin mode and adds additional tests to assure the functionality.
diff --git a/internal/cmd/keepassxctemplatefuncs.go b/internal/cmd/keepassxctemplatefuncs.go index 96165983028a..499f4c0f8512 100644 --- a/internal/cmd/keepassxctemplatefuncs.go +++ b/internal/cmd/keepassxctemplatefuncs.go @@ -425,6 +425,9 @@ func keepassxcBuiltinBuildCache( entry, mapper, ) + if len(ma...
1
1
0
[{"id": "G0", "claim": "Instead of passing lots of same-typed positional arguments to setupKeepassEntry, pass a struct with named fields (as in the linked chezmoi sourcestate.go example).", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
twpayne__chezmoi__4294
twpayne/chezmoi
4,294
defect
84c5790e5f96a425cdbe8e7e079a699a5db89efc
eac1541e5c0e59377034f12bdd3a75dbcbd98609
feat: Add -0 flag to ignored, managed, and unmanaged commands
Refs #4194. The goal here is to handle filenames with spaces so that a command like chezmoi managed -0 | xargs -0 tar czf chezmoi-backup-$(date -Iseconds).tar.gz would work. PR in progress. Needs tests. Draft for now.
diff --git a/assets/chezmoi.io/docs/reference/commands/ignored.md b/assets/chezmoi.io/docs/reference/commands/ignored.md index b50f8cd7f4d..921b6adbb35 100644 --- a/assets/chezmoi.io/docs/reference/commands/ignored.md +++ b/assets/chezmoi.io/docs/reference/commands/ignored.md @@ -4,6 +4,10 @@ Print the list of entries ...
2
1
1
[{"id": "G0", "claim": "CI fails on Windows because the pull request adds a documentation snippet file named nul.md, which Windows cannot check out.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "unclear"}, {"id": "G1", "claim": "Unless other numeric parameters are planned, helpFlagsRx...
null
twpayne__chezmoi__4532
twpayne/chezmoi
4,532
defect
64ef7933a5531466fd5b3978d1c8f3baf783b90d
8fce818e6a45ee5c2e3ee65ab82b8391de1e8d89
docs: Refactor configuration variables reference page
This PR changes the format of the configuration variables reference page from a large table (with one row per variable) to a hierarchy of sections (with one section per variable). This permits directly linking directly to individual configuration variable (which should eventually improve the usability of the docs) a...
diff --git a/assets/chezmoi.io/docs/reference/configuration-file/variables.md.tmpl b/assets/chezmoi.io/docs/reference/configuration-file/variables.md.tmpl index b5e4844b3844..ae272f52c891 100644 --- a/assets/chezmoi.io/docs/reference/configuration-file/variables.md.tmpl +++ b/assets/chezmoi.io/docs/reference/configurat...
3
3
0
[{"id": "G0", "claim": "The hcpVaultSecrets section should probably be marked as deprecated in the configuration variables reference.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "Restructure the data so each section carries a description that ...
null
twpayne__chezmoi__665
twpayne/chezmoi
665
defect
49fb0849d1515987b4d1bf967442818eae4ff8f6
0f60f88f4d8a911941e89136651bed302d47cbd5
Add managed command
Closes #659
diff --git a/cmd/docs.gen.go b/cmd/docs.gen.go index 2dcb7105b03b..601face5052b 100644 --- a/cmd/docs.gen.go +++ b/cmd/docs.gen.go @@ -261,6 +261,10 @@ func init() { "`chezmoi unmanaged` will list everything not managed by chezmoi. You can add\n" + "entire directories with `chezmoi add -r`.\n" + "\n" + + "## ...
4
4
3
[{"id": "G0", "claim": "recurseEntries (and the other make calls) should allocate with make([]string, 0, len(in)) instead of make([]string, len(in)) so the slice starts empty rather than pre-filled with empty strings.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": ...
null
twpayne__chezmoi__856
twpayne/chezmoi
856
defect
efca26712116df0ff4fafc17c28e17f88de86efd
9dc9df17d55e4ced3839c211a1c1f5eea79f1022
Remove init --clone flag and only clone repo if needed
As suggested by @felipecassiors in #855. Fixes #855.
diff --git a/cmd/config_test.go b/cmd/config_test.go index cb22ba3f0bf5..18b946e0df31 100644 --- a/cmd/config_test.go +++ b/cmd/config_test.go @@ -137,9 +137,6 @@ func TestValidateKeys(t *testing.T) { func newTestConfig(fs vfs.FS, options ...configOption) *Config { return newConfig(append( []configOption{ - wit...
2
2
1
[{"id": "G0", "claim": "The example install line should quote \"$chezmoi\" and \"--source=$script_dir\" (e.g. exec \"$chezmoi\" init --apply \"--source=$script_dir\") so it does not break when the directory contains spaces.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {...
null
twpayne__go-geom__120
twpayne/go-geom
120
defect
75a9bdcdba12d84e8a93fe4f33f87ea6578bc750
70fb4cb3ca19f5c2513969f4fa2cba48ee3f4ecc
add rdp simplify
fixes #117
diff --git a/xy/rdp_simplify.go b/xy/rdp_simplify.go new file mode 100644 index 00000000..fc22bdfb --- /dev/null +++ b/xy/rdp_simplify.go @@ -0,0 +1,140 @@ +package xy + +import ( + "math" +) + +const stride = 2 + +// Adopted from https://github.com/paulmach/orb/blob/master/simplify/douglas_peucker.go +// Original lice...
4
4
3
[{"id": "G0", "claim": "The stride should be a parameter, not the fixed constant `const stride = 2`.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "`earthRadius` and `MeterToAngleThreshold` should be removed because the xy package is about planar geometr...
null
twpayne__go-geom__138
twpayne/go-geom
138
defect
a8c7ef77c3648070f7da7da3836ea0e54d8919e0
e29a404e36fe3e67df78b9e3089293ca4d8c7739
Added Bounding Box support to geojson encoding
This adds bounding box support as described in the [geojson spec](https://tools.ietf.org/html/rfc7946#section-5). I wasn't sure if you'd want me to add more errors, I noticed that there's only 2 kinds of errors in geojson.go at the moment but I could potentially add 3 more for this change (on lines 310 and 325, and ...
diff --git a/encoding/geojson/geojson.go b/encoding/geojson/geojson.go index 2e4771f0..51f02d55 100644 --- a/encoding/geojson/geojson.go +++ b/encoding/geojson/geojson.go @@ -35,26 +35,30 @@ type Geometry struct { // A Feature is a GeoJSON Feature. type Feature struct { - ID string - Geometry geom.T - Pro...
1
1
0
[{"id": "G0", "claim": "Rename the `BoundingBox` field in `geojsonFeature` to `BBox` to match the JSON property name, and do the same for the `BoundingBox` fields in the `Feature`, `FeatureCollection`, and `geojsonFeatureCollection` structs.", "category": "maintainability", "verdict": "supported", "priority": "P2", "sc...
null
twpayne__go-geom__156
twpayne/go-geom
156
defect
4c063617d0bb181d28ed2703f9e7aaa6050dab42
d73c4a98226324194e90138fee72d38ebc40e760
add Empty to T interface and correct Empty for GeometryCollection
* Add Empty() to the T interface, which is defined on all geom.T types. * Add interface assertions for all the types, makes unimplemented interface errors easier to read at compile time. * In PostGIS (at least), its possible for a GeometryCollection to have multiple Empty elements and still be considered empty, e.g...
diff --git a/geom.go b/geom.go index 08e15f20..e8044811 100644 --- a/geom.go +++ b/geom.go @@ -128,6 +128,7 @@ type T interface { Ends() []int Endss() [][]int SRID() int + Empty() bool } // MIndex returns the index of the M dimension, or -1 if the l does not have an diff --git a/geometrycollection.go b/geomet...
1
1
0
[{"id": "G0", "claim": "Move the interface satisfaction tests (the `var _ T = ...` declarations) out of the implementation files into test files, using the style `var _ T = &GeometryCollection{}`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
twpayne__go-geom__160
twpayne/go-geom
160
defect
078e8ab21d838b07c627dc1d704f1f80688b1b90
577d2d8755974a6385bd536afbf4c39e9a44f6fe
fix MultiPolygon and MultiLineString to handle EMPTY sub-geometries
MultiLineString / MultiPolygon should be to handle extreme cases such as MULTILINESTRING (EMPTY, EMPTY) or MULTIPOLYGON (EMPTY, POLYGON(1.0...)). This PR adapts the code to make this happen. This is compliant with the `ST_IsEmpty` definition. ---- Unfortunately, it will not work for MultiPoint. I'm guessing thi...
diff --git a/flat.go b/flat.go index 24df4fc2..b0c7dd2c 100644 --- a/flat.go +++ b/flat.go @@ -290,7 +290,9 @@ func deflate1(flatCoords []float64, coords1 []Coord, stride int) ([]float64, err return flatCoords, nil } -func deflate2(flatCoords []float64, ends []int, coords2 [][]Coord, stride int) ([]float64, []int,...
3
3
0
[{"id": "G0", "claim": "Remove MultiLineString.Empty unless there is an example MultiLineString where geom2.Empty alone fails and the loop over the individual LineStrings is needed, since the tests still pass with geom2.Empty only.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "int...
null
twpayne__go-geom__171
twpayne/go-geom
171
defect
3fe80a471512350a75b2d3fd31db536e3a375cd2
c00e993122c93e36d4f0065cb5abf15fae120458
*: handle MULTIPOINT containing empty elements
To handle empty, we convert MultiPoint to inherit geom2 and use the ends array to determine whether there are empty "holes" in the flat coords array. This involves a bunch of overriding geom2 methods with geom1-like methods. Updated the WKB/EWKB methods to reflect the changes.
diff --git a/derived.gen.go b/derived.gen.go index a86c9b39..44fda319 100644 --- a/derived.gen.go +++ b/derived.gen.go @@ -168,9 +168,9 @@ func deriveDeepCopy_3(dst, src *MultiLineString) { // deriveDeepCopy_4 recursively copies the contents of src into dst. func deriveDeepCopy_4(dst, src *MultiPoint) { func() { - ...
2
1
1
[{"id": "G0", "claim": "NewPointFlatMaybeEmpty should test that all elements of flatCoords are the specific NaN value used to represent empty points instead of using math.IsNaN, which is too eager to set isEmpty to true.", "category": "correctness", "verdict": "uncertain", "priority": "P1", "scope": "introduced"}, {"id...
null
twpayne__go-geom__184
twpayne/go-geom
184
defect
95e229f313d50c5c08964ba1015d410fc6213319
b7d756ec63b5e14250065d3ab3a0d5cbfcf1c37e
encoding/wkt: fix handling of collections with empty elements
WKT encoding of collections with empty elements resulted in empty collections. Consider the following geometry: ```golang geom.NewGeometryCollection().MustPush( geom.NewPointEmpty(geom.XY), geom.NewLineString(geom.XY), ) ``` Which resulted in the following encoding: ``` GEOMETRYCOLLECTION EMPTY ...
diff --git a/encoding/wkt/decode.go b/encoding/wkt/decode.go index 669cc2e0..1aba5442 100644 --- a/encoding/wkt/decode.go +++ b/encoding/wkt/decode.go @@ -19,7 +19,7 @@ func decode(wkt string) (geom.T, error) { switch t { case tPoint: - coords, _, err := readCoordsDim1(l, wkt) + coords, _, err := readCoordsDim1...
2
2
1
[{"id": "G0", "claim": "The same empty-element handling should be applied to the MULTI* types, e.g. decoding MULTIPOINT (EMPTY, EMPTY).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The allowEmpty parameter of readCoordsDim1 is misleading because e...
null
twpayne__go-geom__190
twpayne/go-geom
190
defect
596b546d9cd06706e1db7ed2a79e3e449471a579
9c376c8688e75706182dba28c779709216cd16ac
geometrycollection: Allow layout to be specified and enforced
This is a possible fix for #189. cc @otan @andyyang890
diff --git a/geometrycollection.go b/geometrycollection.go index 58fcef7f..c6edbc4d 100644 --- a/geometrycollection.go +++ b/geometrycollection.go @@ -3,8 +3,9 @@ package geom // A GeometryCollection is a collection of arbitrary geometries with the same // SRID. type GeometryCollection struct { - geoms []T - srid i...
2
2
1
[{"id": "G0", "claim": "The decoders should be fixed to set the layout when a GEOMETRYCOLLECTIONZ is empty.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "MustSetLayout should call SetLayout and panic if it errors, the same way that MustPush calls P...
null
twpayne__go-geom__26
twpayne/go-geom
26
defect
3af3508e5a897fa669a78f23d25a35a1d37c94ee
cbefc5e8c7143ada203ae3abd11ea327def6bb18
Port xyz algorithms
Ported all algorithms in the JTS CGAlgorithms3D class to the xyz package
diff --git a/xy/cga.go b/xy/cga.go index dd3a11ea..ffda251a 100644 --- a/xy/cga.go +++ b/xy/cga.go @@ -365,7 +365,7 @@ func Equal(coords1 []float64, start1 int, coords2 []float64, start2 int) bool { return internal.Equal(coords1, start1, coords2, start2) } -// Distance2D calculates the 2d distance between the two ...
2
2
0
[{"id": "G0", "claim": "`len` is a Go keyword used as a variable name in VectorNormalize, which the reviewer did not expect to compile.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Imports in xyz/vector.go should be ordered with stdlib package...
null
twpayne__go-geom__28
twpayne/go-geom
28
defect
cbefc5e8c7143ada203ae3abd11ea327def6bb18
490a86c4ee6e4011972a8c8263691f9074bd3736
Added method for calculating the centroid of a generic geometry
Added method for calculating the centroid of a generic geometry (geom.T) in 2d space
diff --git a/xy/angle.go b/xy/angle.go new file mode 100644 index 00000000..02e85341 --- /dev/null +++ b/xy/angle.go @@ -0,0 +1,183 @@ +package xy + +import ( + "github.com/twpayne/go-geom" + "github.com/twpayne/go-geom/xy/orientation" + "math" +) + +const piTimes2 = math.Pi * 2 + +// ToDegrees converts from radians to...
4
1
1
[{"id": "G0", "claim": "Centroid should not let panics escape the package boundary; change it to return (geom.Coord, error) instead of panicking on unsupported types.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Test failure messages in xy/line_centroi...
null
twpayne__go-gpx__34
twpayne/go-gpx
34
defect
267ba12f685d473e937de6a8476c3702aec4f2c2
b09aa7590ab73886f3f71a259734b51fe750545e
Migrate xsd file URI scheme from http to https
The change eliminates the 301 Moved Permanently redirect Additional change includes updating the TopoGrafix version from 1.0 to 1.1 in the read and write example
diff --git a/README.md b/README.md index 990a6c1..ac64d40 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Package `gpx` provides convenince methods for reading and writing GPX documents. ```go r := bytes.NewBufferString(` <?xml version="1.0" encoding="UTF-8"?> - <gpx version="1.0" creator="ExpertGPS 1....
2
2
1
[{"id": "G0", "claim": "The three const declarations added at the top of gpx.go (timeLayout, http, https) should be rewritten as one parenthesized const block to be idiomatically gofmt-formatted.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Ex...
null
twpayne__go-gpx__5
twpayne/go-gpx
5
defect
64cebde7be079e0f695dc21ec2b540184696021e
1fb26878221a1596d07a713ef1901873da51251a
Support speed and course
Support speed and course according to the[ gpx spec](https://www.topografix.com/gpx_manual.asp).
diff --git a/gpx.go b/gpx.go index cc26dc0..5e94222 100644 --- a/gpx.go +++ b/gpx.go @@ -119,6 +119,8 @@ type WptType struct { Lat float64 Lon float64 Ele float64 + Speed float64 + Course float64 Time time.Time MagVar float64 GeoidHeight float64 @@ -343...
3
3
3
[{"id": "G0", "claim": "The `if w.Speed > 0` conditional should be removed because `maybeEmitFloatElement` already handles w.Speed != 0, and negative speeds should not be excluded.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The `if w.Course > 0`...
null
txpipe__pallas__341
txpipe/pallas
341
defect
645989465d8f0e5a0e6da64ae2189f7e73b1b65b
862e3f711495278333d3df9efa3cebf44afc2ee4
implement UTxO by Address local state query
fixes #317
diff --git a/examples/n2c-miniprotocols/src/main.rs b/examples/n2c-miniprotocols/src/main.rs index 4695390f7..b08ceaca8 100644 --- a/examples/n2c-miniprotocols/src/main.rs +++ b/examples/n2c-miniprotocols/src/main.rs @@ -28,6 +28,12 @@ async fn do_localstate_query(client: &mut NodeClient) { .unwrap(); inf...
2
2
2
[{"id": "G0", "claim": "The networking crate should not be coupled with pallas-addresses or pallas-primitives, so those must not be added as regular dependencies of pallas-network.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The network crate should n...
null
txpipe__pallas__648
txpipe/pallas
648
defect
1d09b6177b023b0622876347c140bc67a80f60a8
98a5badb6b705badb6d78ecffbefbedcb29caf3b
Separate PParamsUpdate from ProtocolParam
Fix some localstate queries which are treating `PParamsUpdate` and `ProtocolParam` as the same type. The former describes (potential) updates to protocol parameters, the latter describes the current or previous set of protocol parameters. With this change, the n2c localstate queries in the examples directory all suc...
diff --git a/examples/n2c-miniprotocols/src/main.rs b/examples/n2c-miniprotocols/src/main.rs index 5f6b704ae..ba075dbc4 100644 --- a/examples/n2c-miniprotocols/src/main.rs +++ b/examples/n2c-miniprotocols/src/main.rs @@ -63,11 +63,10 @@ async fn do_localstate_query(client: &mut NodeClient) { let result = queries_v...
4
3
0
[{"id": "G0", "claim": "The reviewer asks whether the get_gov_state response size is expected and, if it has changed, asks that the stale ~120MB size comment in the example be updated.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "pre_existing"}, {"id": "G1", "claim": "The @todo com...
null
tyfkda__xcc__211
tyfkda/xcc
211
defect
9af79ce36c74abc89eaabce152fcfe322fd1ce64
4f96b21fbdf3e72be9c51ef0407197439673ee34
Cast rhs to int when assigning bitfield
Also, apply constant folding. Re-extract bitfield for the result. #210
diff --git a/src/cc/frontend/fe_misc.c b/src/cc/frontend/fe_misc.c index 6a9cf1192..0478909a8 100644 --- a/src/cc/frontend/fe_misc.c +++ b/src/cc/frontend/fe_misc.c @@ -806,6 +806,8 @@ Expr *new_expr_num_bop(enum ExprKind kind, const Token *tok, Expr *lhs, Expr *rh case EX_BITAND: value = lval & rval; break; \ c...
1
1
1
[{"id": "G0", "claim": "In assign_to_bitfield's else branch the comma expression should be built with `type` instead of `vtype`, because a comma expression's type is its right operand's type (the result of assign_bitfield_member) and the `assign` variable's type should be `type` in both branches for consistency and cor...
null
tyfkda__xcc__213
tyfkda/xcc
213
defect
79badbaf735b48e7f91a9a635153de430fdf568d
9ff517c9b025b11e9d4e475d0cbd121d62997de9
feat: adds 32-bit clz, ctz, popcount builtins
Adds support for the following builtins for WASM: - `__builtin_clz` - `__builtin_ctz` - `__builtin_popcount` Also added very basic tests for the above. I only added 32-bit support as I ran into issues with 64-bit support. But this is a start.
diff --git a/src/wcc/gen_wasm.c b/src/wcc/gen_wasm.c index e52ca4cee..7f25734ae 100644 --- a/src/wcc/gen_wasm.c +++ b/src/wcc/gen_wasm.c @@ -2138,6 +2138,60 @@ static void gen_alloca(Expr *expr, enum BuiltinFunctionPhase phase) { gen_expr(result, true); } +static void gen_builtin_clz(Expr *expr, enum BuiltinFunct...
6
3
1
[{"id": "G0", "claim": "The nearly identical gen_builtin_clz, gen_builtin_ctz and gen_builtin_popcount functions should have their common logic extracted into a helper function taking the WASM opcode, to reduce duplication.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "introduced"...
null
tylertreat__comcast__35
tylertreat/comcast
35
defect
1d58d8d827fdaa444f7c86170b74c60089f88474
0f1db24c74181f89aacf62abb864488bc8820cf0
Mac OSX Yosemite+ support via pfctl and dnctl
Adds support for Mac OSX Yosemite via the `pfctl` and `dnctl` commands. As part of the implementation, I've removed the check for OSX version and instead replaced it with tests for the 2 known firewall implementations (namely `pfctl` and `ipfw`). If this makes it in, we may want to consider updating the OSX stanza in ...
diff --git a/throttler/pfctl.go b/throttler/pfctl.go new file mode 100644 index 0000000..3c091bd --- /dev/null +++ b/throttler/pfctl.go @@ -0,0 +1,215 @@ +package throttler + +import ( + "errors" + "fmt" + "strconv" + "strings" +) + +const ( + // TODO: use printf in favour of echo due to shell portability issues + pfct...
1
1
0
[{"id": "G0", "claim": "The newly added osxFirewall() function in throttler/throttler.go does not appear to be called from anywhere (dead code).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
typedb__typedb__7060
typedb/typedb
7,060
defect
8b3656088fdc3115b1b1082200c4603c4925a180
a8200698a034759a2fc2c8434b74802ac70d98a0
Fix snapshots to respect buffered deletes on get
## Usage and product changes We fix a bug where the get operation on snapshots would treat a buffered delete as an absent key. Usages of it would then fall back to storage and find the key.. ## Usage and product changes * Make usages of snapshot.get explicitly handle deletes. * Add test checking deletes of commit...
diff --git a/storage/snapshot/buffer.rs b/storage/snapshot/buffer.rs index 6427b46d065..5062e723c48 100644 --- a/storage/snapshot/buffer.rs +++ b/storage/snapshot/buffer.rs @@ -136,11 +136,8 @@ impl WriteBuffer { self.writes.get(key.bytes()).is_some() } - pub(crate) fn get<const INLINE_BYTES: usize>(...
4
2
0
[{"id": "G0", "claim": "In the required-key get path, the missing-key case should perhaps not be an unreachable! panic but a returned error.", "category": "design", "verdict": "uncertain", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The GetRequiredKeyDoesntExist error variant perhaps does not need ...
null
typedb__typedb__7254
typedb/typedb
7,254
defect
2c5e3114cb4d19085a329b379eef590d7a3e9eda
ee7adf0ab5a96050ddc39db3409857b182673a49
Guarantee transaction causality
## Release notes: product changes Under concurrent write workloads, causality can appear to be violated. For example: ``` - Open tx1, tx2 - start tx1 commit (validation begins) - start tx2 commit (validation begins and ends, no conflict with tx1!) - open tx3 - end tx1 commit (validation finishes) ``` When ...
diff --git a/concept/benches/bench_thing_write.rs b/concept/benches/bench_thing_write.rs index 10c395ed9b9..51045d2a6e0 100644 --- a/concept/benches/bench_thing_write.rs +++ b/concept/benches/bench_thing_write.rs @@ -114,7 +114,7 @@ fn criterion_benchmark(c: &mut Criterion) { let definition_key_generator = Arc...
2
2
0
[{"id": "G0", "claim": "The name `latest_utilised_sequence_number` is unclear; it should say what the value means (e.g. claimed or committed).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The watermark-waiting loop should be extracted into a f...
null
typedb__typedb__7314
typedb/typedb
7,314
defect
f9fe695e751f8f47e0eb37552147862bb44c692d
a974159403bc71495bc032558bdf6204ae0a8881
Update VERSION to 3.0.2 and create release notes
## Release notes: product changes We merge development into master for 3.0.2 release.
diff --git a/RELEASE_NOTES_LATEST.md b/RELEASE_NOTES_LATEST.md index bbef16e79d9..257b964fccd 100644 --- a/RELEASE_NOTES_LATEST.md +++ b/RELEASE_NOTES_LATEST.md @@ -1,935 +1,87 @@ **Download from TypeDB Package Repository:** -[Distributions for 3.0.0](https://cloudsmith.io/~typedb/repos/public-release/packages/?q=na...
1
1
1
[{"id": "G0", "claim": "The newline at the end of the VERSION file will break prints, because the Rust code will initialize `const VERSION` as `3.0.2\\n`.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
typedb__typedb__7338
typedb/typedb
7,338
defect
ccd981af4927fc2a869ea5c8f8abc81d16dab3b9
4279828adbb30e6163f8c69a86beeacd9d16da84
Add flag to type-seeder for write stages
## Release notes: product changes Adds a flag to type-seeder to indicate the stage is a write stage. This ensures variables constrained by `isa`, or labelled roles are seeded with the exact type, and not (transitive) subtypes. This fixes a bug where one could not insert a role-player for a role with a subtype. ## M...
diff --git a/compiler/annotation/match_inference.rs b/compiler/annotation/match_inference.rs index 4a3f315c947..9fda7c8964e 100644 --- a/compiler/annotation/match_inference.rs +++ b/compiler/annotation/match_inference.rs @@ -11,7 +11,7 @@ use std::{ sync::Arc, }; -use answer::{variable::Variable, Type as TypeAn...
2
2
1
[{"id": "G0", "claim": "The new boolean flag passed as `true` at the delete-stage annotate_stage call site (pipeline.rs:338) is unclear and misnamed for that stage - it is called `is_insert` but the stage does not insert and the reviewer is unsure how it behaves for deletes - so if it does not matter there it should be...
null
typedb__typedb__7344
typedb/typedb
7,344
defect
5e2818df90bf37c8124d41e951c9b2c0190f4d1d
b52b79e216e8651af6311495d1b38003aa19dfa3
Let attribute supertypes be not abstract and fix independent attributes behavior
## Release notes: product changes Remove the constraint that attribute types can be subtyped only if they are abstract. Now, it is possible to build schemas like: ``` define attribute name; attribute first-name sub name; attribute surname sub name; entity dog owns name; entity passport owns first-na...
diff --git a/concept/type_/type_manager.rs b/concept/type_/type_manager.rs index 361e25153d6..94cee2ecb84 100644 --- a/concept/type_/type_manager.rs +++ b/concept/type_/type_manager.rs @@ -1726,9 +1726,6 @@ impl TypeManager { ) .map_err(|typedb_source| ConceptWriteError::SchemaValidation { typedb_sour...
2
2
0
[{"id": "G0", "claim": "The error variants this pull request deletes leave holes in the error enumeration (e.g. ... 8, 9, 11 ...); the author asks what the approach to error numbering should be.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G4", "claim": "The error va...
null
typedb__typedb__7359
typedb/typedb
7,359
defect
6f51c369e9d64389a24ebcfd121bfeb15e037a9a
1a27734a5277eeb711f94eea242c3709b855fa59
Unsatisfiable type constraints do not cause type-inference errors; Enable more BDD tests
## Release notes: product changes Queries containing unsatisfiable type-constraints no longer fail type-inference. Instead the (sub)pattern returns 0 answers. We also enable BDD tests which were failing due to overly strict debug_asserts ## Motivation More BDD coverage, more intuitive behaviour on type-queries. ...
diff --git a/compiler/annotation/match_inference.rs b/compiler/annotation/match_inference.rs index 32afec6aa50..7d8dc791449 100644 --- a/compiler/annotation/match_inference.rs +++ b/compiler/annotation/match_inference.rs @@ -11,7 +11,7 @@ use std::{ sync::Arc, }; -use answer::{variable::Variable, Type as TypeAn...
17
14
2
[{"id": "G0", "claim": "The PR suffers from a loss of information in TypeAnnotation's vertex_annotations because vertices can have different annotations in each subpattern, so VertexAnnotations cannot accurately capture them; the author proposes extending ConstraintAnnotations to include unary constraints and removing ...
null
typedb__typedb__7365
typedb/typedb
7,365
defect
97c6671fe410a188fb310b08e96d92125e6d1106
4c953ec9ff1fbeb739976d05632eeac45b8d4b1b
Enable functions in write pipelines
## Release notes: product changes Enable functions in write pipelines ## Motivation Enable functions in write pipelines. fixes #7363 Requires typedb/typedb-behaviour#337 ## Implementation * Passes the function registry to the write pipeline. * Fixes a bug in type_seeder where we didn't recurse into negatio...
diff --git a/compiler/annotation/match_inference.rs b/compiler/annotation/match_inference.rs index a2938a4ea46..682535e495c 100644 --- a/compiler/annotation/match_inference.rs +++ b/compiler/annotation/match_inference.rs @@ -166,8 +166,21 @@ pub(crate) fn prune_types(graph: &mut TypeInferenceGraph<'_>) { } ...
3
2
2
[{"id": "G0", "claim": "Do not unwrap the result of the recursive seed_types_in_nested_negations_and_optionals call; propagate the error with `?` instead, which is simpler here.", "category": "maintainability", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The aggregate-return...
null
typedb__typedb__7377
typedb/typedb
7,377
defect
0d3e48281923e0d984ae39228f822781448b6e42
918365623ab3db36fe64d30764a5a90b1b9442b9
Allow multiple expression assignments in different branches
## Release notes: product changes Allows multiple expression assignments for the same variable in different branches - essential for meaningful recursive functions. * Assignments in different branches of the same disjunction are allowed * Assignments in different constraints/nested-patterns of the same conjunction a...
diff --git a/compiler/annotation/expression/block_compiler.rs b/compiler/annotation/expression/block_compiler.rs index 6e5fb392e1c..b5f837a02c9 100644 --- a/compiler/annotation/expression/block_compiler.rs +++ b/compiler/annotation/expression/block_compiler.rs @@ -12,6 +12,7 @@ use ir::{ pattern::{ conjun...
8
3
0
[{"id": "G0", "claim": "The release notes should include some TypeQL examples.", "category": "documentation", "verdict": "uncertain", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "The Rust optimizer might inline and then eliminate the call inside the debug_assert! in the optimised build, which the ...
null
typedb__typedb__7380
typedb/typedb
7,380
defect
0d3e48281923e0d984ae39228f822781448b6e42
769677499f6f204889ae7e366b7580276bc4b2af
Fix retries for suspended recursive functions
## Release notes: product changes Fixes a bug where recursive functions were not retried properly if called by a negation, or collecting stage such as 'sort' or 'reduce'. Also fixes a panic which wrongly assumed suspend points could not exist at certain modifiers. ## Motivation Correctness, avoids crashes, simpli...
diff --git a/executor/read/pattern_executor.rs b/executor/read/pattern_executor.rs index 5222690f0ed..881616f6c7e 100644 --- a/executor/read/pattern_executor.rs +++ b/executor/read/pattern_executor.rs @@ -516,7 +516,19 @@ fn restore_suspension( input: input_row.into_owned(), ...
1
1
1
[{"id": "G0", "claim": "Suspend points from a StreamModifier / Reduce likely still need to be restored the same way suspend points are restored at a negation.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
typedb__typedb__7403
typedb/typedb
7,403
defect
c89f27e38f6944789c55a1185a1c09a6fb23250e
1dff7c8bf155c5a3762132d6654eb9679a90cbca
Fix write transactions left open and blocking other transactions after receiving errors
## Release notes: product changes The gRPC service no longer leaves any of the transactions open after receiving transaction or query errors. This eliminates scenarios where schema transactions cannot open due to other hanging schema or write transactions and where read transactions can crash the server using incorrec...
diff --git a/server/service/transaction_service.rs b/server/service/transaction_service.rs index a1ccbb2a224..23bde26e215 100644 --- a/server/service/transaction_service.rs +++ b/server/service/transaction_service.rs @@ -566,7 +566,8 @@ impl TransactionService { let diagnostics_manager = self.diagnostics_man...
2
1
0
[{"id": "G0", "claim": "The added import in tests/behaviour/steps/connection/mod.rs should be formatted with rustfmt.", "category": "maintainability", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The catch-all match arm should use `transaction =>` instead of the redundant `tr...
null
typedb__typedb__7404
typedb/typedb
7,404
defect
c89f27e38f6944789c55a1185a1c09a6fb23250e
a0b23caf31334ff9343d2b711800e7f67050e46d
Handle assignment to anonymous variables
## Release notes: product changes We allow function assignment to discard values assigned to anonymous variables (such as in `let $_ = f($x);`) as there is no space allocated for those outputs. Previously the compilation would crash as it could not find the allocated slot for the value. ## Motivation ## Implem...
diff --git a/compiler/executable/match_/planner/match_executable.rs b/compiler/executable/match_/planner/match_executable.rs index 025b1db9ed4..40132ea8ff3 100644 --- a/compiler/executable/match_/planner/match_executable.rs +++ b/compiler/executable/match_/planner/match_executable.rs @@ -491,7 +491,7 @@ impl fmt::Displ...
2
1
0
[{"id": "G0", "claim": "The new assignment-writing loop in tabled_call_executor.rs should just use `copy_mapped` as is done elsewhere in the codebase.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The author should check whether expression assi...
null
typedb__typedb__7450
typedb/typedb
7,450
defect
ee7dc43a5833d54617e12d0a44cf71755c1855fd
75a39dc818bd95c9e0f89e1658a8bb95089df454
Add HTTP schema retrieval, root and version endpoints
## Product change and motivation TypeDB HTTP endpoint acquired: * `GET /schema` and `GET /type-schema` methods for database schema retrieval. Similarly to GRPC, the `GET /schema` method returns both type and function schemas. * `GET /version` method returning the server's version and distribution in JSON. * redirec...
diff --git a/.factory/automation.yml b/.factory/automation.yml index e30b995c7f8..97f04b6c75b 100644 --- a/.factory/automation.yml +++ b/.factory/automation.yml @@ -148,13 +148,12 @@ build: bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh bazel test //tests/assembly:test_assembl...
2
1
1
[{"id": "G0", "claim": "The typedb_behaviour git_repository points at the author's personal fork (farost/typedb-behaviour) instead of the upstream typedb/typedb-behaviour, and will be returned to the upstream repo.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1...
null
typedb__typedb__7479
typedb/typedb
7,479
defect
9ea4a37b83e4dcddfec3d1feb5472a3b759129bb
3fdf79fb7c196859bb44877de2134dd09fd679b4
Open-up server state component for extension
## Product change and motivation The `ServerState` component has been converted into a trait, with the actual implementation moved into a new component `LocalServerState`. This change is motivated by the need of allowing additional server state implementations with extended functionalities. ## Implementation - I...
diff --git a/Cargo.lock b/Cargo.lock index f2a82525d2e..77edf10d0f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,9 +388,9 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.87" +version = "0.1.88" source = "registry+https://github.c...
3
1
1
[{"id": "G0", "claim": "Having main.rs construct a shutdown channel and call the newly added Server::new_with_local_server_state directly is not the best user-facing interface given plans to expose the server as a crate; a wrapper should be introduced and this call site refactored.", "category": "design", "verdict": "s...
null
typedb__typedb__7510
typedb/typedb
7,510
defect
806409419fee2b493c9844a5c9243262f4d2c670
40647c37637f0da9dc5d43ba41ba9581546c7a2e
Handle trailing partial writes in WAL
## Product change and motivation We implement the ability to discard partially written trailing WAL records. ## Implementation
diff --git a/Cargo.lock b/Cargo.lock index 29067de1178..cf40cbf39d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1332,7 +1332,9 @@ dependencies = [ "error", "itertools 0.10.5", "logger", + "lz4", "primitive", + "rand 0.8.5", "resource", "serde", "tempdir", @@ -4445,7 +4447,6 @@ dependencies = [ "itertoo...
5
2
1
[{"id": "G0", "claim": "The name of the `trim_corrupted_tail` function could probably be improved.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The star (`*`) imports in durability/tests/basic.rs (e.g. `use rand::prelude::*`) are a style the p...
null
typedb__typedb__7654
typedb/typedb
7,654
defect
a03f209340df8e30623158ff2ec96b14772887c2
22e26013d541b8b5c4e7af3b9d89b0d5fc212509
Improve start up resilience
## Product change and motivation We reduce the possibility of crashes during startup after an operating system failure by doing the following: - detect and discard corrupted database checkpoints on startup, - ignore extraneous (non-database) directories in the data directory, - separate checkpoints in progress ...
diff --git a/.factory/automation.yml b/.factory/automation.yml index 86b4e72c179..21f35758705 100644 --- a/.factory/automation.yml +++ b/.factory/automation.yml @@ -170,6 +170,17 @@ build: bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh bazel test $(bazel query 'kind(rust_test,...
5
3
1
[{"id": "G0", "claim": "The consistency-checking helper should be renamed to better describe what it checks (`is_valid` / `is_complete`).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The remaining Checkpoint type should be renamed to Checkpoin...
null
typedb__typedb__7681
typedb/typedb
7,681
defect
ce4ec131162016c6c3e8b8c86f5b12f63ff6b9f8
c4d5faec9579f3b720c75e33833aad992035885d
Implement date/time and string binary operators
## Product change and motivation We implement addition and subtraction operators for `date`, `datetime`, `datetime_tz`, and `duration`. We also implement string concatenation, also performedd with the `+` operator. ## Implementation Drive-by: datetime-tz parsing from `TypeQLLiteral` is fixed. Previously it ...
diff --git a/compiler/annotation/expression/expression_compiler.rs b/compiler/annotation/expression/expression_compiler.rs index 7d08add8398..04de2ae9794 100644 --- a/compiler/annotation/expression/expression_compiler.rs +++ b/compiler/annotation/expression/expression_compiler.rs @@ -375,12 +375,16 @@ impl<'this> Expre...
4
1
0
[{"id": "G0", "claim": "The new error message 'Attempting to subtract future from past' is oddly worded and should say something like 'subtract larger/later date from smaller/earlier'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The pull reques...
null
typedb__typeql__256
typedb/typeql
256
defect
3b96a320388631f8c0764569dfaa5376a710212b
45a0e336454e9887181463cf3931190ab49cb01f
Enable BDD testing
## What is the goal of this PR? We enable cucumber BDD tests and add them to the CI. ## What are the changes implemented in this PR? We implement the BDD test steps and fix a couple bugs caught by the tests.
diff --git a/.factory/automation.yml b/.factory/automation.yml index 0146311b3..9702c33a2 100644 --- a/.factory/automation.yml +++ b/.factory/automation.yml @@ -60,6 +60,7 @@ build: image: vaticle-ubuntu-22.04 command: | bazel test //rust/... --test_output=errors + bazel test //rust/tests/...
5
4
1
[{"id": "G0", "claim": "The `bazel test //rust/tests/behaviour/...` line in the Factory build job should be removed because `//rust/tests/behaviour/...` is a subset of `//rust/...`, so the two lines duplicate coverage.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id":...
null
typedb__typeql__356
typedb/typeql
356
defect
4bd1275acc260125d1281fbed5c1c7e22a8ae64e
73d5fd4e1be3b6adb0565daa047dc5fd879239b7
Allow type declarations without capabilities
## Usage and product changes Updates the grammar to allow standalone type-declarations. ## Implementation This change arises from changing `mytype sub entity` to `entity mytype`. * Type annotations are now directly on the declaration rather than on the `sub` capability. Makes a few fields pub as well.
diff --git a/rust/annotation.rs b/rust/annotation.rs index 994b5e4a7..3aa5e31b4 100644 --- a/rust/annotation.rs +++ b/rust/annotation.rs @@ -65,7 +65,7 @@ impl fmt::Display for Abstract { #[derive(Debug, Clone, Eq, PartialEq)] pub struct Cardinality { span: Option<Span>, - range: CardinalityRange, + pub ra...
1
1
1
[{"id": "G0", "claim": "The type-definition grammar rule should be restructured so that the (annotations | type_capability) choice and the following capability list sit inside a single optional group: definition_type = { kind? ~ label ~ ( ( annotations | type_capability ) ~ ( COMMA ~ type_capability )* )? }.", "categor...
null
typedb__typeql__389
typedb/typeql
389
defect
bb23f987091855a6ac56081206b9d3a736a1a9d5
f6b082aae7b9469d2d2d701028cf0457ab19ee24
Add 'dec' suffix to decimal literals
## Usage and product changes Require decimal literals to be suffixed with 'dec' ## Implementation Updates grammar & datastructures.
diff --git a/rust/parser/literal.rs b/rust/parser/literal.rs index e312ece6..5303cc6c 100644 --- a/rust/parser/literal.rs +++ b/rust/parser/literal.rs @@ -9,8 +9,8 @@ use crate::{ parser::{IntoChildNodes, Node, Rule, RuleMatcher}, value::{ BooleanLiteral, DateFragment, DateLiteral, DateTimeLiteral, D...
2
2
1
[{"id": "G0", "claim": "The string stored in the literal structs should not contain the 'dec' suffix (the parser stores the raw literal text, e.g. SignedDecimalLiteral.decimal ends up holding \"4.0dec\").", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim"...
null
typeddjango__django-stubs__1260
typeddjango/django-stubs
1,260
defect
b0edae31f50efab880aab98bb3f5ce0ca32fe306
8aaaee9fcbfaa56c3f7df4051259ba947d266bfa
Update to mypy 0.991 for compatible-mypy & CI
Made a few tweaks that were needed to get our CI passing with mypy 0.991. ~~There is still a new regression with `mypy_django_plugin` that I haven't investigated, which happens with Django 3.2 only. Created an issue for it: #1261 Disabled testing with Django 2.2 and 3.2 in CI for now.~~ Thanks to @flaeppe for the f...
diff --git a/mypy.ini b/mypy.ini index ef5b0612f..fa0b71fc6 100644 --- a/mypy.ini +++ b/mypy.ini @@ -7,13 +7,14 @@ ignore_missing_imports = True incremental = True strict_optional = True show_traceback = True -warn_no_return = False warn_unused_ignores = True warn_redundant_casts = True warn_unused_configs = True...
2
1
0
[{"id": "G0", "claim": "The compatible-mypy extra should require \"mypy>=0.991,<1.0\" instead of \"mypy>=0.991,<0.1000\".", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G2", "claim": "Consider working towards show_error_codes = True over time, e.g. by linting ...
null
typeddjango__django-stubs__2021
typeddjango/django-stubs
2,021
defect
cb7e3685805fe3a0bc1e3e77a76954540ab325bb
8ec6874fd7f1ca1de749febc1a687a7b193a94f2
feat: Allow setting django_settings_module from env
<!-- Hi, thanks for submitting a Pull Request. We appreciate it. Please, fill in all the required information to make our review and merging processes easier. Cheers! --> ## What changed * `django_settings_module` is now not required as part of the config * When not given, `django_settings_module` will be p...
diff --git a/README.md b/README.md index 82c2d36fb..1a36e1dcc 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ django_settings_module = "myproject.settings" Two things happening here: 1. We need to explicitly list our plugin to be loaded by `mypy` -2. Our plugin also requires `django` settings module (what ...
2
2
0
[{"id": "G0", "claim": "The `[mypy.plugins.django-stubs]` config example should use `os.getenv(DJANGO_SETTINGS_MODULE)` for the `django_settings_module` default, for consistency with the other config example.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "...
null
typeddjango__django-stubs__2182
typeddjango/django-stubs
2,182
defect
e19698594e69f3dc925533044d96f6d84ea9e063
578b0c53b7fdd62a25d4b4778f2e7d2fd5ee8ad5
Migrate 'test_conf.yml' to 'assert_type' tests
I tried to get started on moving `.yml` tests to `assert_type` style tests. Also tried to adjust the cases to fit the `assert_type` style a little bit better. Let me know what you think.
diff --git a/django-stubs/urls/conf.pyi b/django-stubs/urls/conf.pyi index d73e4fb4a..965352e96 100644 --- a/django-stubs/urls/conf.pyi +++ b/django-stubs/urls/conf.pyi @@ -11,9 +11,7 @@ from ..http.response import HttpResponseBase _URLConf: TypeAlias = str | ModuleType | Sequence[_AnyURL] -def include( - arg: ...
1
1
0
[{"id": "G0", "claim": "The type alias introduced by this pull request should not be public: rename IncludedURLConf to _IncludedURLConf or move it to the ext module and import from there.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
typeddjango__django-stubs__2230
typeddjango/django-stubs
2,230
defect
ec37d06ef630f7bc78a9df3a3cfd9030566655ad
71d2f1539aac5eb26916b7bd5639ca0e15d619e0
Make plugin handle explicitly declared reverse descriptors for FKs
If a reverse descriptor was explicitly declared on a model, the plugin skipped to create a more specific subclass for its related manager. Refs: #2227
diff --git a/mypy_django_plugin/transformers/models.py b/mypy_django_plugin/transformers/models.py index 5c17b930a..461e8aa8a 100644 --- a/mypy_django_plugin/transformers/models.py +++ b/mypy_django_plugin/transformers/models.py @@ -463,34 +463,43 @@ def many_to_many_descriptor(self) -> TypeInfo: def process_rel...
2
1
0
[{"id": "G0", "claim": "The reviewer asks when explicitly declaring a reverse many-to-one descriptor via a ClassVar annotation is useful and suggests it might be better to instead write `= ReverseManyToOneDescriptor(...)`.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": ...
null
typeddjango__django-stubs__2298
typeddjango/django-stubs
2,298
defect
b9a7c83ace974611040d9fbea864a7c9d1bbaddb
5c0bf533e4ee2eeff49a2a4c1c70c14ca264f6dd
Improve `get_context_object_name` on `SingleObjectMixin` and `MultipleObjectMixin`
Get in an overload for method `get_context_object_name` ## Related issues - Refs #873
diff --git a/django-stubs/views/generic/detail.pyi b/django-stubs/views/generic/detail.pyi index a833c72cc..20a34b99f 100644 --- a/django-stubs/views/generic/detail.pyi +++ b/django-stubs/views/generic/detail.pyi @@ -1,4 +1,4 @@ -from typing import Any, Generic, TypeVar +from typing import Any, Generic, TypeVar, overlo...
2
2
1
[{"id": "G0", "claim": "Making `SingleObjectMixin.model` optional (`type[_M] | None`) can be a breaking change for a lot of code.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The new `_HasModel` protocol class should be marked `@type_check_only` so it ...
null
typeddjango__django-stubs__2331
typeddjango/django-stubs
2,331
defect
0e323311b9e52a124f75c66314074e049f3a0212
4c96c386076280e6d93e53e5965d964eeff72374
5.1: Deprecate CheckConstraint.check
# I have made things! > [The check keyword argument of CheckConstraint is deprecated in favor of condition.](https://docs.djangoproject.com/en/5.1/releases/5.1/#features-deprecated-in-5-1) https://github.com/django/django/blob/ecf13f192de7c26a7606f5ba46a3773a9c84ef72/django/db/models/constraints.py#L137 Added ov...
diff --git a/django-stubs/db/models/constraints.pyi b/django-stubs/db/models/constraints.pyi index 7b96ada72..674a61878 100644 --- a/django-stubs/db/models/constraints.pyi +++ b/django-stubs/db/models/constraints.pyi @@ -44,11 +44,22 @@ class BaseConstraint: class CheckConstraint(BaseConstraint): check: Q | Bas...
1
1
1
[{"id": "G0", "claim": "Use typing_extensions.deprecated on the appropriate overload to deprecate CheckConstraint.check.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
typeddjango__django-stubs__2659
typeddjango/django-stubs
2,659
defect
68cc7ed165ffe7af33d940cebe8a6265704276c2
08399291a82c768f024507c8dbc7095b8a8b6602
Add a test for missing generics in stubs
# I have made things! Followup to this discussion https://github.com/typeddjango/django-stubs/pull/2384#discussion_r2072873073 This introduce a test ensuring every generic we define in stubs are generic at runtime too. This also adds the missing ones (`SetPasswordForm`, discussed above, being one of them) <...
diff --git a/ext/django_stubs_ext/patch.py b/ext/django_stubs_ext/patch.py index e8e85ebd7..b1279a579 100644 --- a/ext/django_stubs_ext/patch.py +++ b/ext/django_stubs_ext/patch.py @@ -1,4 +1,5 @@ import builtins +import logging from collections.abc import Iterable from typing import Any, Generic, TypeVar @@ -8,24...
4
3
1
[{"id": "G0", "claim": "The `SetPasswordMixin`/`SetUnusablePasswordMixin` generics cannot be patched before `django.setup()` is called, the warning logging it was left commented out, and there is no documented path for users who configure django late, so the PR needs a way to handle this case.", "category": "correctnes...
null
typeddjango__django-stubs__2774
typeddjango/django-stubs
2,774
defect
1f76ba83625cf7d4e9f429bbafb8c157dfb6fb04
d9e5e6f768329729222226f6af782a670686f7da
Allow all error types to `BaseForm.add_error()` in documentation
# I have made things! The documentation for the method `BaseForm.add_error()` says the following: > The `error` argument can be a single error, a list of errors, or a dictionary that maps field names to lists of errors. An "error" can be either a simple string or an instance of `ValidationError` with its messa...
diff --git a/django-stubs/forms/forms.pyi b/django-stubs/forms/forms.pyi index e4af63a59..d503810a8 100644 --- a/django-stubs/forms/forms.pyi +++ b/django-stubs/forms/forms.pyi @@ -1,5 +1,5 @@ from collections.abc import Iterable, Iterator, MutableMapping -from typing import Any, ClassVar +from typing import Any, Clas...
1
1
1
[{"id": "G0", "claim": "Add a test in tests/assert_type showcasing which BaseForm.add_error calls the new overloads should accept and which they should refuse, using type-ignore comments on offending lines for the refused cases.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
typeddjango__django-stubs__2830
typeddjango/django-stubs
2,830
defect
ed5046ec7395d4492147524f050e7bd9ae27396b
08ed5be11112377b81fb2e29194cec845b55cd8f
Add `strict_model_abstract_attrs` setting to allow `models.Model.objects` access
We need this setting so we can test `sentry` in `mypy-primer`. To test it, we need to help Sentry's team to use our package, without their custom fork. So, setting `strict_model_abstract_attrs = false` should do the trick for them. It can be also helpful for other big projects to adopt `django-stubs`. CC @flaepp...
diff --git a/README.md b/README.md index 39f9d672a..a1b1e7712 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,14 @@ The supported settings are: Set to `false` if using dynamic settings, as [described below](https://github.com/typeddjango/django-stubs#how-to-use-a-custom-library-to-handle-django-settings). ...
1
1
0
[{"id": "G0", "claim": "The newly documented `strict_model_abstract_attrs` section misspells 'dangerous' as 'dangeours' and should be corrected to 'dangerous'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
typeddjango__django-stubs__2967
typeddjango/django-stubs
2,967
defect
b02a901bbc141751342ec67f612609631b52e7b0
fb0abd4a43e5490539dd814af8c131cc0001a4bb
Django 6.0: Add Django Tasks framework
I wrote stubs for the Django Task framework introduced in Django 6.0. They still need some polish but feedback is very welcome. If you are reviewing this, pay special attention to the Task class generic parameters which have an influence in how many other methods are typed. *Update:* this now passes all tests, I ...
diff --git a/django-stubs/tasks/__init__.pyi b/django-stubs/tasks/__init__.pyi new file mode 100644 index 000000000..e63a1a3cb --- /dev/null +++ b/django-stubs/tasks/__init__.pyi @@ -0,0 +1,28 @@ +from django.utils.connection import BaseConnectionHandler + +from .backends.base import BaseTaskBackend +from .base import ...
8
7
0
[{"id": "G0", "claim": "The tasks stub dataclasses should not hand-annotate __init__; @dataclass(kw_only=True) should be used instead.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The __match_args__ and __post_init__ entries the pull request adds to th...
null
typeddjango__django-stubs__2996
typeddjango/django-stubs
2,996
defect
897617ad3669a1e218b5d9ec6efc825175ad8e86
a602e7ed6e9d38430285f5190c893a01960b3b74
Allow plain `Form` in `DeleteView` type parameters
## PR Summary `DeleteView` and `BaseDeleteView` were incorrectly typed to only accept `ModelForm` subclasses. Django's actual implementation sets `form_class = Form` by default (since Django 4.0) because delete views use forms for confirmation, not for saving model data. This change relaxes the type parameter from `_M...
diff --git a/django-stubs/views/generic/edit.pyi b/django-stubs/views/generic/edit.pyi index c464f2417..68a824d5b 100644 --- a/django-stubs/views/generic/edit.pyi +++ b/django-stubs/views/generic/edit.pyi @@ -66,9 +66,9 @@ class DeletionMixin(Generic[_M]): def delete(self, request: HttpRequest, *args: Any, **kwarg...
1
1
1
[{"id": "G0", "claim": "Please add a test for the change under `test/typecheck`.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
typeddjango__django-stubs__3080
typeddjango/django-stubs
3,080
defect
2e46f6de16d2237c6cb3a698d818f31b3c092017
2a215d4a2a917e5d5b9a97a2341d0e3c06cfc809
Fix conflated decorator and decorator factory return types
## PR Summary The `_DECORATOR` type alias was incorrectly defined as a union that conflated decorators with decorator factories. This caused type errors when using `decorator_from_middleware` in return type annotations and failed to catch bugs like passing non-callables to decorators. This PR splits it into two distin...
diff --git a/django-stubs/utils/decorators.pyi b/django-stubs/utils/decorators.pyi index 4280a5165..8dce9c88a 100644 --- a/django-stubs/utils/decorators.pyi +++ b/django-stubs/utils/decorators.pyi @@ -7,16 +7,21 @@ from django.views.generic.base import View _ViewType = TypeVar("_ViewType", bound=View | Callable[...,...
4
2
1
[{"id": "G0", "claim": "Type `middleware_class` more specifically as a protocol (one validating the middleware signature) instead of plain `type`.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Type `_DecoratorFactory`'s arguments precisely (e.g. with Pa...
null
typeddjango__django-stubs__3106
typeddjango/django-stubs
3,106
defect
ef8215c993fe569a174f13f7ecb2b7b4650ee4ec
e20b06203b7d205fd69002b5ccfebbbe4bc14b2c
Fix encoding functions returning Any instead of str/bytes
### PR Summary This PR contains the following changes (tricky PR!): - Fix `force_str`/`force_bytes`/`smart_str`/`smart_bytes` returning `Any` when given `Any` input -When you pass a variable typed as `Any` to these functions, mypy was inferring the return type as `Any` instead of `str`/`bytes`. This happened because ...
diff --git a/django-stubs/utils/encoding.pyi b/django-stubs/utils/encoding.pyi index a074ba2ae..552f51adb 100644 --- a/django-stubs/utils/encoding.pyi +++ b/django-stubs/utils/encoding.pyi @@ -4,9 +4,7 @@ from typing import Any, Literal, TypeGuard, TypeVar, overload from django.utils.functional import Promise -cla...
1
1
1
[{"id": "G0", "claim": "Move the new test_encoding.yml case to the tests/assert_type folder so that it also runs under pyright and pyrefly.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
typeddjango__django-stubs__3180
typeddjango/django-stubs
3,180
defect
ca16c465d25a2cdce62558724b903b02e8d93092
0bd5c0c9e08a36dc73eff8feb5949826bc791554
Loosen ListFilter.choices() return type to allow custom filter templates
Fix `ListFilter.choice()` to return a more generic type, since the specific content is supposed to be customised and used by subclasses. Instead, I pushed down to subclasses the more restrictive type, since those actually expect those fields to be there. Previously AI generated PR description: > ## Summary > ...
diff --git a/django-stubs/contrib/admin/filters.pyi b/django-stubs/contrib/admin/filters.pyi index d05417dd6..d67929e5c 100644 --- a/django-stubs/contrib/admin/filters.pyi +++ b/django-stubs/contrib/admin/filters.pyi @@ -1,4 +1,4 @@ -from collections.abc import Callable, Iterable, Iterator +from collections.abc import ...
1
1
1
[{"id": "G0", "claim": "Add a test in tests/assert_type to showcase what this change fixes.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
typeddjango__django-stubs__3204
typeddjango/django-stubs
3,204
defect
298c4723d83bcf84c85c724a02b6e6427c4ed86f
98c312bf1c63a8ac2da0a0a240dfaeb47dbdfe75
Add missing `swappable` parameter to ForeignKey and OneToOneField
### PR Summary This PR adds the `swappable` keyword argument to `ForeignKey` and `OneToOneField` stubs. This param is defined in `ForeignObject` and passed through via `**kwargs` at runtime, but was missing from the child class stubs. Without it, using `swappable=False` (common for non-swappable model references) rais...
diff --git a/django-stubs/db/models/fields/related.pyi b/django-stubs/db/models/fields/related.pyi index 436d0bf2b..b69f5c8ea 100644 --- a/django-stubs/db/models/fields/related.pyi +++ b/django-stubs/db/models/fields/related.pyi @@ -191,6 +191,7 @@ class ForeignKey(ForeignObject[_ST, _GT]): to_field: str | Non...
2
1
0
[{"id": "G0", "claim": "The new typecheck test case could be an `assert_type` test instead, which would be a little more lightweight.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The reviewer asks why the added `swappable` parameter passes the stubtes...
null
typeddjango__django-stubs__3206
typeddjango/django-stubs
3,206
defect
b476e7806830ff6940ebdba96a1af1d214b50806
37b8773ea78069c103a7a2caaa83fcd3f3aa5500
Fix `in` operator false positive with union types
### PR Summary This PR fixes false positives when using the `in` operator with union types on container classes. Python falls back to `__iter__` for membership tests at runtime, but mypy requires an explicit `__contains__` to type-check `x in container` when `x` is a union like `Model | None`. Added a `_SupportsMember...
diff --git a/django-stubs/db/models/query.pyi b/django-stubs/db/models/query.pyi index 8e191e25b..46e2de7c6 100644 --- a/django-stubs/db/models/query.pyi +++ b/django-stubs/db/models/query.pyi @@ -1,7 +1,7 @@ import datetime import sys from collections.abc import AsyncIterator, Collection, Iterable, Iterator, Mappin...
6
4
1
[{"id": "G0", "claim": "forms.pyi should reuse the `_SupportsMembership` protocol from query.pyi instead of defining its own copy, since importing protected types here is fine.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The in-operator test ...
null
typeddjango__django-stubs__3228
typeddjango/django-stubs
3,228
defect
9eed37534fa216860757fe72157b55428f85f97e
051a5462a8cd2f7346cf4ac50d4d6949d069e6d3
Use `Model` instead of `Self` in parms and add `AltersData` inheritance
### PR Summary `refresh_from_db`, `arefresh_from_db`, `_do_update`, `_get_pk_val`, and `unique_error_message` used `Self` in their parameter types, which is unsound in contravariant positions - overriding these methods in a subclass with the same `Self` pattern triggers `reportIncompatibleMethodOverride` in pyright/ty...
diff --git a/django-stubs/db/models/base.pyi b/django-stubs/db/models/base.pyi index 1c2c7f6d6..d68459ed6 100644 --- a/django-stubs/db/models/base.pyi +++ b/django-stubs/db/models/base.pyi @@ -8,6 +8,7 @@ from django.core.exceptions import ObjectDoesNotExist, ObjectNotUpdated, Validat from django.db.models import Base...
3
3
2
[{"id": "G0", "claim": "Add an `assert_type` test showing that it is possible to override `Model.refresh_from_db` with the correct annotation.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The PR's `QuerySet[Model]` typing of `from_queryset` is too loo...
null
typeddjango__django-stubs__3235
typeddjango/django-stubs
3,235
defect
a32bb3c8ad3125ee3bfa6acb1f75ffdb74114f6b
8dc5cc9a24e97672f87309b91ee66aa03b762a07
Make Lookup type argument optional by defaulting _T to Any
Fixes #2649. The type argument is still required because: 1. Subclasses specialize `_T` with concrete types, for ex `PatternLookup(BuiltinLookup[str])`, `IsNull(BuiltinLookup[bool])`, `Exact[int | float]`, etc. 2. The plugin code in `_resolve_lookup_type_from_lookup_class` extracts that t...
diff --git a/django-stubs/db/models/lookups.pyi b/django-stubs/db/models/lookups.pyi index 8518e1398..57f73ed18 100644 --- a/django-stubs/db/models/lookups.pyi +++ b/django-stubs/db/models/lookups.pyi @@ -10,7 +10,7 @@ from django.utils.datastructures import OrderedSet from django.utils.functional import cached_proper...
1
1
1
[{"id": "G0", "claim": "Add a test case covering the new default (Lookup's _T type argument defaulting to Any).", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
typeddjango__django-stubs__3255
typeddjango/django-stubs
3,255
defect
44df163ca2967c00697ae617d824a89f71bd89e1
fc199719c27e200afa4c5c62a0c92989147bd57f
Remove patching of `reveal_type()` and `reveal_locals()`
This was originally added to avoid a release of django-stubs-ext going out with these left in mistakenly which would cause projects using the stubs downstream to break. As we have enabled the `unimported-reveal` error code for mypy in 2602ed8d487ac9fdab6cf5aabb8a96175c954d7c, errors will be caught in CI and we should r...
diff --git a/ext/django_stubs_ext/patch.py b/ext/django_stubs_ext/patch.py index 10c265559..af018d4cf 100644 --- a/ext/django_stubs_ext/patch.py +++ b/ext/django_stubs_ext/patch.py @@ -1,7 +1,5 @@ from __future__ import annotations -import builtins -import logging from typing import TYPE_CHECKING, Any, Generic, Typ...
1
1
1
[{"id": "G0", "claim": "The README example uses `reveal_type` without `from typing import reveal_type`, and the reviewer asks that the import be added there too.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
typeddjango__django-stubs__3291
typeddjango/django-stubs
3,291
defect
f99e7e9cfbb7f4896a201c8c3043d6bbc5e134c9
1da4c4fae769a3cd1af77335fe56b2f08e424fa1
Type EmailMessage.message() return as stdlib email.message.EmailMessage
## Summary - Replace `Any` return type of `EmailMessage.message()` with `email.message.EmailMessage` - Django 5+ returns a stdlib `EmailMessage` directly, making the old TODO obsolete - Add `assert_type` coverage ## AI Policy * [x] I have read and agree to the AI Policy, removed any "Co-Authored-By" lines attrib...
diff --git a/django-stubs/core/mail/message.pyi b/django-stubs/core/mail/message.pyi index 793837cf8..944914d07 100644 --- a/django-stubs/core/mail/message.pyi +++ b/django-stubs/core/mail/message.pyi @@ -1,4 +1,5 @@ from collections.abc import Sequence +from email.message import EmailMessage as _StdlibEmailMessage f...
3
2
1
[{"id": "G0", "claim": "The mypy_primer corpus run reports one new downstream type error in zulip (zerver/lib/send_email.py:305: Invalid index type \"int\" for \"Message[str, str]\"), implying the PR's change may have broken downstream type checking.", "category": "correctness", "verdict": "opposed", "priority": "P2", ...
null
typeddjango__django-stubs__3349
typeddjango/django-stubs
3,349
defect
cf1aa8a718b8d36cb9dcc1f23ee2e5b648d0c765
7128d566ae95d4134d9373ffafd3135c57e32c61
Just another quick fix
# I have made things! ## Related issues ``` Type of "check_password" is partially unknown   Type of "check_password" is "(password: str | None, encoded: str, setter: ((...) -> Unknown) | None = ..., preferred: str = ...) -> bool" ``` ## Fix Callable[..., Any] ## AI Policy - [x] I have read and agre...
diff --git a/django-stubs/contrib/auth/hashers.pyi b/django-stubs/contrib/auth/hashers.pyi index a00a4bd90..c29ff02a2 100644 --- a/django-stubs/contrib/auth/hashers.pyi +++ b/django-stubs/contrib/auth/hashers.pyi @@ -9,7 +9,9 @@ UNUSABLE_PASSWORD_SUFFIX_LENGTH: int def is_password_usable(encoded: str | None) -> bool...
2
2
1
[{"id": "G0", "claim": "check_password's setter parameter is typed too loosely as Callable[..., Any] and should be typed more precisely, per Django's implementation, as Callable[[str | None], Any].", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The stub ...
null
typeddjango__django-stubs__3353
typeddjango/django-stubs
3,353
defect
9048fdcdf9d02e5ffd32a8923e1a2183620a84a0
fef8f06cfe17a8033b05b27f914a895ed175ce42
Migrate `test_options.yml` to py
# I have made things! So that #3308 will be able to add an `assert_type` test instead ## AI Policy - [x] I have read and agree to the [AI Policy](https://github.com/typeddjango/django-stubs/blob/master/.github/AI_POLICY.md), removed any "Co-Authored-By" lines attributing coding agents, and manually reviewed the ...
diff --git a/tests/assert_type/contrib/admin/test_options.py b/tests/assert_type/contrib/admin/test_options.py new file mode 100644 index 000000000..da23372d1 --- /dev/null +++ b/tests/assert_type/contrib/admin/test_options.py @@ -0,0 +1,163 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, An...
1
1
0
[{"id": "G0", "claim": "Model admin test classes should be moved out of their enclosing functions and named descriptively, so the `# pyright: ignore[reportUnusedClass]` suppressions can be removed and scope-related differences between function and module level are avoided.", "category": "maintainability", "verdict": "s...
null
typeddjango__django-stubs__3361
typeddjango/django-stubs
3,361
defect
e021f6593758a74f89e79f8571d2c7665bc0fce2
27d18a0ab036017d5a109e75d3756ee7173c553b
Accept datetime/timedelta on reverse ops of Combinable
## Related issues Fixes https://github.com/typeddjango/django-stubs/issues/1548 ## AI Policy - [x] I have read and agree to the [AI Policy](https://github.com/typeddjango/django-stubs/blob/master/.github/AI_POLICY.md), removed any "Co-Authored-By" lines attributing coding agents, and manually reviewed the final ...
diff --git a/django-stubs/db/models/expressions.pyi b/django-stubs/db/models/expressions.pyi index 801d5e181..2f454de60 100644 --- a/django-stubs/db/models/expressions.pyi +++ b/django-stubs/db/models/expressions.pyi @@ -52,8 +52,10 @@ class Combinable: def bitxor(self, other: int) -> CombinedExpression: ... ...
7
5
1
[{"id": "G0", "claim": "The forward ops __add__ and __sub__ should also have their operand types aligned with the reverse ops the pull request changed.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "A type alias should be introduced for the operand ...
null
typegoose__mongodb-memory-server__252
typegoose/mongodb-memory-server
252
defect
8853d9c1b6e3af699071589c7a75d8c30c5d0800
d6857a954156d7cd32abad9dc6a65b8e9d35f0ba
Improve Example code & adding TSDoc
## What this PR is about - Improving examples - Adding TSDoc - making code more readable ## Additional - adds a static function `create` so that an instance can be created, autoStarted and awaited - change internal functions (inferred by starting with `_`) to identifier `private` --- PS: do not merge ...
diff --git a/README.md b/README.md index f626dc4e6..2e5ed4265 100644 --- a/README.md +++ b/README.md @@ -31,21 +31,21 @@ Choose any package, because they are the same. Differs only by default configura ### `mongodb-memory-server` -Auto-downloads the latest `mongod` binary on npm install to: `node_modules/.cache`. ...
6
3
1
[{"id": "G0", "claim": "getConnectionString should perhaps be marked deprecated because it is just a pass-through to getUri.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "The getters (getPort, getDbPath, getDbName) should perhaps return false/null inste...
null
typegoose__mongodb-memory-server__261
typegoose/mongodb-memory-server
261
defect
bfc38a9f8a87a2fdd720beed3ae5ebca238db9a4
27c2b400a099351bb70e1d723c977d2684e73020
Add TSDoc to MongoInstance
- add TSDoc to MongoInstance - add `@deprecated` to `getConnectionString` (TSDoc deprecated) - rename some variables to make more sense - fixed some types (This is a draft, because of some `TODO: ask` notes)
diff --git a/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts b/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts index cd61e74fe..c0c704cf7 100644 --- a/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts +++ b/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts @@ -16,6 +16,9 ...
3
3
1
[{"id": "G0", "claim": "The startup-failure error should not be hidden behind the debug flag; instead a console.warn about debug should be shown and the real error re-thrown.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "The data object in _startUpIns...
null
typegoose__mongodb-memory-server__265
typegoose/mongodb-memory-server
265
defect
3373411d4c365be547d87a7fa61b0416da0c648e
95e9090cee029c1a6158559517bdbc2c0617f792
fix(mongodb-memory-server-core): change import syntax and moved packa…
…ges to dependencies <!-- ## Make sure you have done these steps - Make sure you read [Mastering-Markdown](https://guides.github.com/features/mastering-markdown/) - remove the parts that are not applicable - Please have "Allow edits from maintainers" activated --> ## Related Issues <!--Remove this part if...
diff --git a/packages/mongodb-memory-server-core/package.json b/packages/mongodb-memory-server-core/package.json index 1ce1baa05..21f3d100c 100644 --- a/packages/mongodb-memory-server-core/package.json +++ b/packages/mongodb-memory-server-core/package.json @@ -31,6 +31,9 @@ }, "homepage": "https://github.com/nodk...
1
1
1
[{"id": "G0", "claim": "The @types packages that the pull request moved from devDependencies into the package's `dependencies` do not belong there and should be moved back (to `devDependencies` per the reviewer and the maintainer, or alternatively into `peerDependencies` to avoid consumers nested-installing type packag...
null
typegoose__mongodb-memory-server__274
typegoose/mongodb-memory-server
274
defect
a498bef1ab18d6bc229c76551ebc7ce4289af1b9
06bb3779a00a0c00212546158810c5018943fd9a
refactor(MongoBinaryDownloads): Replace decompress
decompress has a known vulnurability. It can be replaced by tar-stream for tgz files, and yauzl for zip files. I haven't tested this on a Windows machine, but I did check if the files download and extract as expected. According to `file` they look like windows binaries :smiley: <!-- ## Make sure you have done...
diff --git a/packages/mongodb-memory-server-core/package.json b/packages/mongodb-memory-server-core/package.json index 0d71aad1a..d97a165e8 100644 --- a/packages/mongodb-memory-server-core/package.json +++ b/packages/mongodb-memory-server-core/package.json @@ -31,12 +31,13 @@ }, "homepage": "https://github.com/no...
6
6
1
[{"id": "G0", "claim": "The new if-else statements that choose between extractTarGz and extractZip should be surrounded with \"{}\" to match the other code.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "In extractZip the optional chaining on `z...
null
typegoose__mongodb-memory-server__375
typegoose/mongodb-memory-server
375
defect
82606d8ade8e3532cfeb867c0c262cab54dd2949
39ca5754acdb26e822262d56189c2ddc203857a8
fix(MongoBinary): improve code
- add tsdoc to many functions - getCachePath: remove being async - getDownloadPath: change the times to be more understandable - getDownloadPath: use "this.getCachePath" instead of "this.cache[]" - getPath: remove unnecessary variables - getPath: add an Error if "binaryPath" is still false-y - improve debug loggi...
diff --git a/packages/mongodb-memory-server-core/src/util/MongoBinary.ts b/packages/mongodb-memory-server-core/src/util/MongoBinary.ts index dd399cf76..b68366327 100644 --- a/packages/mongodb-memory-server-core/src/util/MongoBinary.ts +++ b/packages/mongodb-memory-server-core/src/util/MongoBinary.ts @@ -32,54 +32,65 @@...
2
2
1
[{"id": "G0", "claim": "The rewritten lock options are wrong: wait was changed to 1000 * 12 (12 s) and stale to 1000 * 11 (11 s), one tenth of the original 120 s / 110 s that the inline comments still claim.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "cla...
null
typegoose__mongodb-memory-server__389
typegoose/mongodb-memory-server
389
defect
7214f09c514fa6e3f2bbaddc6949c400fea77c72
bdb52992fac99c1c7e820206c0b6ccc433fb0cfd
fix/improveMongoInstance
- rename interface "MongodOps" to "MongodOpts" to keep naming consistency - remove static value "childProcessList" because it was never used - move "dynamic" function "debug" into private class function - shorten "constructor" to use less lines - outsource "MongodOpts.instance" into own interface "MongoInstanceOpts...
diff --git a/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts b/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts index 5684f15ff..bfdb5bf12 100644 --- a/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts +++ b/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts @@ -12,6 +1...
2
1
0
[{"id": "G0", "claim": "Move kill_internal out of the kill method into utils so the `this`/`call` indirection disappears and readability improves (no function-in-function).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Consider renaming the `as...
null
typegoose__mongodb-memory-server__394
typegoose/mongodb-memory-server
394
defect
4768ad86a08644fc90c2e07e603481bd1c1321fc
3f3a4a2c0d8bfb456cb3c2fb4a0a6e7a5cb1134e
Fix/improveMongoMemoryServer
- remove double check - remove "null" use "undefined" - convert one if to optional-chaining - remove unnecessary "else" path - test that "stop" returns "true" if not running - test that "getDbPath" returns the dbPath - add "assertion" - change "getPort" to be sync - change "getDbPath" to be sync - change "getD...
diff --git a/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts b/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts index 9efb0effe..cbe5662c7 100644 --- a/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts +++ b/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts @@ -215,7 +...
1
1
0
[{"id": "G0", "claim": "Add a note to the readme that the URI or port can be obtained only after starting a mongod process, since getPort and getDbPath are now synchronous and throw when no port or path exists.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
typegoose__mongodb-memory-server__508
typegoose/mongodb-memory-server
508
defect
bf7fb5c6c84638e49aad4ca6204c2ff11eba50b3
8ae41bf9199491ea7dbb9064e433f97d5ff4f512
Mongo Replica set - Add replicaMemberConfig to replica instance
## Replica Set Configuration - Add member config Ref: https://docs.mongodb.com/manual/reference/replica-configuration/#replica-set-configuration-document-example Sample code: ```javascript const replSet = new MongoMemoryReplSet({ instanceOpts: [ { args: ["--quiet"], replicaMemberConfig: { ...
diff --git a/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts b/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts index b746f6733..5a4398a26 100644 --- a/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts +++ b/packages/mongodb-memory-server-core/src/MongoMemoryReplSet.ts @@ -272,6 +...
1
1
0
[{"id": "G0", "claim": "The `// Ref: ...` comment above the ReplicaMemberConfig interface should be changed to a tsdoc comment.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
typegoose__mongodb-memory-server__625
typegoose/mongodb-memory-server
625
defect
5badaeca30b9f397ad7c881e219e60d0272ecca4
5c7e5d3cdfbf9e16c9a0de4d5092d77167ca3365
fix(MongoBinary): Fix mongo binary matching regex
Fix regex that tests the local mongo binary version so that it can handle versions that include patches and/or other tags. ## Related Issues <!--Remove this part if not applicable--> - fixes #624
diff --git a/packages/mongodb-memory-server-core/src/util/MongoBinary.ts b/packages/mongodb-memory-server-core/src/util/MongoBinary.ts index 9dcd1c620..88de7258c 100644 --- a/packages/mongodb-memory-server-core/src/util/MongoBinary.ts +++ b/packages/mongodb-memory-server-core/src/util/MongoBinary.ts @@ -92,8 +92,8 @@ e...
3
3
0
[{"id": "G0", "claim": "The test's comment claiming the mocked output was taken from mongodb x64 for \"ubuntu\" version \"4.0.25\" does not match the mocked v4.2.19-11-ge2f2736 output and should be updated to reflect the proper version.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "...
null
typegoose__mongodb-memory-server__636
typegoose/mongodb-memory-server
636
defect
8c0afc00fa54b3de93cb78bcc21eb819d3a3cf92
19a724b3e89d8861fb01974df064d71e101b86ae
feat: add environment variable to use archive name for binary name
<!-- ## Make sure you have done these steps - Make sure you read [Mastering-Markdown](https://guides.github.com/features/mastering-markdown/) - remove the parts that are not applicable - Please have "Allow edits from maintainers" activated --> ## Related Issues <!--Remove this part if not applicable--> ...
diff --git a/packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts b/packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts index 3536d2e63..06747f8a3 100644 --- a/packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts +++ b/packages/mongodb-memory-server-core/src/util/DryMongoBinary.ts @@ -4,8...
9
7
1
[{"id": "G0", "claim": "MongoBinaryDownloadUrlOpts should keep deriving version/arch/os from the shared BaseDryMongoBinaryOptions types instead of inlining plain string/AnyOS, so types are defined in a single place across the project.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "...
null
typegoose__mongodb-memory-server__762
typegoose/mongodb-memory-server
762
defect
ebee09413ba669307403066cad4df0c9376fdc76
84980270b9914340c6b2c51dc8e77e4c09828681
download correct package for arch
Arch Linux is on OpenSSL 3 (instead of 1.1), like Ubuntu 22.04 (not like 20.04), so currently the `mongod` startup fails because of missing `libcrypto.so.1.1` (unless one has the `openssl-1.1` package installed for this or some other reason). Tested by making this same change locally in the distributed `node_modules...
diff --git a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts b/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts index bf6c8325f..3394cd1d2 100644 --- a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts +++ b/packages/mongodb-memory-server-core/src/util/M...
3
3
2
[{"id": "G0", "claim": "The new arch test was added in the wrong place: this describe block tests that getLinuxOSVersionString behaves correctly, while distro-specific tests belong under getDownloadUrl() -> for linux, where similar 'for arch' and 'for unpopular arch' tests already exist (ideally in their own describe b...
null
typegoose__mongodb-memory-server__787
typegoose/mongodb-memory-server
787
defect
36bc0502c5c88e1ac86ba9bba414d158455e151a
3316a95496dae1319f9e1be68aa0b5821551260d
fix: Fix binary download on debian testing/unstable
VERSION_ID was removed. See https://tracker.debian.org/news/1433360/accepted-base-files-13-source-into-unstable/ and a similar bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008735
diff --git a/packages/mongodb-memory-server-core/src/__tests__/testUtils/globalSetup.ts b/packages/mongodb-memory-server-core/src/__tests__/testUtils/globalSetup.ts index c563919ad..f61509608 100644 --- a/packages/mongodb-memory-server-core/src/__tests__/testUtils/globalSetup.ts +++ b/packages/mongodb-memory-server-cor...
5
5
2
[{"id": "G0", "claim": "The pull request includes no test illustrating what the change is meant to cover; a test should be added.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Skipping the test on platforms where the binary is not available is handled ...
null
typegoose__mongodb-memory-server__826
typegoose/mongodb-memory-server
826
defect
fd853379844f5bb4a0987effa06b4c849677be31
e704da560fc4da995ffb34a4b4785ab44d84658f
Add support for amazon linux 2023
The os string in the download url for amazon linux 2023 should be "amazon2023" <!-- ## Make sure you have done these steps - Make sure you read [Mastering-Markdown](https://guides.github.com/features/mastering-markdown/) - remove the parts that are not applicable - Please have "Allow edits from maintainers" ac...
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4aa1b002d..afacfc0bf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: ref: ${{ github.event.inputs.git-ref }} fetch-depth: 5 # because this is an manual trigger, only fetc...
2
1
1
[{"id": "G0", "claim": "The pull request adds no tests for the new amazon 2023 download-url path; please add tests, at least for version 7.0.0 which seems to be supported for 2023.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "How would versions like 6...
null