Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Explicit Commit, Dynamo Equivalence Check, and Temporary and Permanent Error Distinctions #179

Merged
merged 100 commits into from
Nov 16, 2022
Merged
Changes from 1 commit
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
a002379
fixed valid to from and issuer signing
clD11 Jul 29, 2022
d533976
update so buffer can be one
clD11 Jul 29, 2022
4bdeae7
commented test
clD11 Jul 29, 2022
e86b39c
added blinded creds to schema
clD11 Aug 2, 2022
2368408
Add temporary error handling
Sneagan Feb 10, 2022
352cfd4
Merge branch 'master' into feature/temporary-permanent-error-distinct…
Sneagan Aug 11, 2022
b011345
Resolve conflicts
Sneagan Aug 11, 2022
07e4333
Resolve conflicts
Sneagan Aug 11, 2022
e6cdbd8
Remove leading caps and trailing punctuation from error message strings
Sneagan Aug 11, 2022
56c540e
Make error messages match master
Sneagan Aug 11, 2022
c9a7a9d
Resolve conflicts
Sneagan Feb 9, 2022
5710210
WIP
Sneagan Feb 9, 2022
6a89b66
Merge branch 'feature/dynamo-duplicate-distinction' of github.com:bra…
Sneagan Aug 12, 2022
180fb26
WIP
Sneagan Aug 12, 2022
b877ea4
Fix some linting
Sneagan Aug 12, 2022
dd7be0f
Fix const reference
Sneagan Aug 12, 2022
a1d3e8b
Remove tolerable equivalence reference
Sneagan Aug 12, 2022
0aa857d
Manage equivalence
Sneagan Aug 12, 2022
23b2b8b
Remove unneeded function
Sneagan Aug 12, 2022
54a8ba0
Make duplicate all the new integer instead of remapping integers
Sneagan Aug 12, 2022
bdb1b69
Remove unrelated offset change
Sneagan Aug 12, 2022
8736e97
Merge pull request #99 from brave-intl/feature/improve-batching
Sneagan Feb 9, 2022
fdc2421
WIP Restore explicit commit
Sneagan Aug 16, 2022
5c4020a
WIP
Sneagan Aug 16, 2022
829d935
WIP
Sneagan Aug 16, 2022
2d7e165
Add simple backoff for temporary errors
Sneagan Feb 11, 2022
0a83e2e
Default offset for unrelated use case
Sneagan Aug 16, 2022
d4cd246
Move brace
Sneagan Aug 16, 2022
613230b
Normalize strings
Sneagan Aug 16, 2022
94db0c0
Restore old logging variable names
Sneagan Aug 16, 2022
ffc2db0
Restore old logging variable names
Sneagan Aug 16, 2022
9eddf8c
Defer context cancel
Sneagan Aug 17, 2022
6275e9e
Improve comments
Sneagan Aug 17, 2022
687f2dd
Only commit after result emission
Sneagan Aug 17, 2022
a2b82ee
Improve variable name
Sneagan Aug 17, 2022
051870b
Remove unneeded kafka emit.
Sneagan Aug 17, 2022
85392d4
Emit a response for permanent errors, but not temporary
Sneagan Aug 18, 2022
e406890
Use logger with request id
Sneagan Aug 18, 2022
678c938
Return errors as avro structures
Sneagan Aug 19, 2022
57135aa
Emit permanent errors in the goroutines instead of after the channel …
Sneagan Aug 19, 2022
681b08a
Make emission code more DRY and readable
Sneagan Aug 19, 2022
7fb12e5
Remove unneeded EOF handling
Sneagan Aug 23, 2022
d16cab9
Remove unneeded continue
Sneagan Aug 23, 2022
ab466f9
Move context outside of loop
Sneagan Aug 23, 2022
d8acc46
Map kafka message in error handling
Sneagan Aug 23, 2022
5e5bb58
Omit timestamp from equivalence check
Sneagan Aug 24, 2022
4949399
Only check payload equivalence and use BindingEquivalence for the ass…
Sneagan Aug 25, 2022
f41fc19
Add idempotent redemption and use avro result status instead of enum
Sneagan Aug 25, 2022
7972f22
Resolve conflicts
Sneagan Aug 26, 2022
0071619
Merge pull request #192 from brave-intl/feature/explicit-commit
Sneagan Sep 1, 2022
c119200
Merge pull request #187 from brave-intl/feature/dynamo-duplicate-dist…
Sneagan Sep 1, 2022
490c3b5
WIP
Sneagan Sep 7, 2022
60827d4
Implement channel-based commit management
Sneagan Sep 13, 2022
7fd264a
Break out behavior into functions
Sneagan Sep 13, 2022
ce8f2a7
Merge branch 'feature/explicit-commit' into feature/temporary-permane…
Sneagan Sep 13, 2022
baa45dc
Resolve conflicts
Sneagan Sep 13, 2022
bab4dc8
Temporarily revert linter workflow go version
Sneagan Sep 13, 2022
91061c6
Undo temporary revert of linter workflow go version
Sneagan Sep 13, 2022
3904bad
Try latest version of golang-lint in CI action
Sneagan Sep 13, 2022
f0103fa
Revert version of golang-lint in CI action
Sneagan Sep 13, 2022
44ec8e8
WIP Conform to linting
Sneagan Sep 13, 2022
b02237e
Improve linting results slightly
Sneagan Sep 13, 2022
c3227cd
Fix go.mod
Sneagan Sep 14, 2022
3e67d68
Use version 1.49 of golangci-lint
Sneagan Sep 14, 2022
7807ecf
Skip cache for golangci-lint
Sneagan Sep 14, 2022
5a12575
Test go mod tidy in lint script
Sneagan Sep 14, 2022
a1b9da2
Try golangci-lint with go 1.17
Sneagan Sep 14, 2022
3d59362
Return to go 1.18 in golangci-lint
Sneagan Sep 14, 2022
bcee8d2
Add clean to golangci-lint
Sneagan Sep 14, 2022
3f6ddb1
Return golangci-lint configuration to match master
Sneagan Sep 14, 2022
4c0e5e0
up golint version to 1.49 in github action
husobee Sep 14, 2022
0d53807
Add changes relating to PR feedback
Sneagan Sep 15, 2022
bbf7e62
Resolve minor conflict
Sneagan Sep 15, 2022
d08711b
Revert challenge-bypass-ristretto-ffi
Sneagan Sep 16, 2022
cd1306e
Change from temporary-based logic to nil indicating temporary failure…
Sneagan Sep 19, 2022
b706a4d
Fix minor comment typo
Sneagan Sep 24, 2022
c2e1249
Re-add error that is needed for results
Sneagan Sep 27, 2022
a9a90cb
Merge branch 'feature/temporary-permanent-error-distinctions' of gith…
Sneagan Sep 28, 2022
d637417
Improve error handling readability
Sneagan Oct 6, 2022
0835261
Refactor Issuer Fetch from Postgres
Sneagan Oct 10, 2022
f79498c
Address PR comments
Sneagan Oct 11, 2022
cfb8c9a
Use error instead of ProcessingError for MessageContext
Sneagan Oct 12, 2022
4f9ad6b
Refactor errors and panics
Sneagan Oct 15, 2022
b8678a4
Break from inner loop
Sneagan Oct 15, 2022
20396d4
Update comments
Sneagan Oct 15, 2022
a234a4b
Make small idiomatic change
Sneagan Oct 15, 2022
03fbc21
Resolve conflicts
Sneagan Nov 5, 2022
521852d
Fix go.mod and go.sum from conflict resolution
Sneagan Nov 11, 2022
67e4368
Fix string formatting mistake.
Sneagan Nov 11, 2022
0c9f202
Move linting step into CI github workflow.
husobee Nov 14, 2022
0904d27
merge master
husobee Nov 15, 2022
f4ca678
Make batchPipeline a buffered channel
Sneagan Nov 15, 2022
617c4f4
Merge branch 'feature/temporary-permanent-error-distinctions' of gith…
Sneagan Nov 15, 2022
9f3f78e
Use generic and errors.As for dynamo failures
Sneagan Nov 15, 2022
bf67ca6
Use generic error instead of ProcessingError for exposed function
Sneagan Nov 15, 2022
4bdf169
Use errors.Is instead of string comparison
Sneagan Nov 15, 2022
e054fde
Resolve conflicts
Sneagan Nov 16, 2022
6977dae
fixing linting issues
husobee Nov 16, 2022
8cddd72
fixing testing issues
husobee Nov 16, 2022
27fe455
error type issue for get issuer fix
husobee Nov 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
commented test
clD11 authored and Sneagan committed Aug 11, 2022
commit 4bdeae78865f182ad063d598f45bdf54bb1ac817
57 changes: 25 additions & 32 deletions kafka/avro_test.go
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
package kafka

import (
"bytes"
"testing"

avroSchema "github.com/brave-intl/challenge-bypass-server/avro/generated"
)

func TestOriginalAvroNewSchema(t *testing.T) {

buf := bytes.NewBuffer([]byte{})

orig := &avroSchema.SigningResultV1{
Signed_tokens: []string{"signed token"},
Issuer_public_key: "issuer public key",
Proof: "proof",
}

if err := orig.Serialize(buf); err != nil {
t.Error("failed to serialize original message type: ", err)
return
}

newSigningResult, err := avroSchema.DeserializeSigningResultV2(buf)
if err != nil {
t.Error("failed to deserialize into new message type: ", err)
return
}
if newSigningResult.Proof != "proof" {
t.Error("invalid attribute in signing result: ", newSigningResult.Proof)
return
}
}
//func TestOriginalAvroNewSchema(t *testing.T) {
//
// buf := bytes.NewBuffer([]byte{})
//
// orig := &avroSchema.SigningResultV1{
// Signed_tokens: []string{"signed token"},
// Issuer_public_key: "issuer public key",
// Proof: "proof",
// }
//
// if err := orig.Serialize(buf); err != nil {
// t.Error("failed to serialize original message type: ", err)
// return
// }
//
// newSigningResult, err := avroSchema.DeserializeSigningResultV2(buf)
// if err != nil {
// t.Error("failed to deserialize into new message type: ", err)
// return
// }
// if newSigningResult.Proof != "proof" {
// t.Error("invalid attribute in signing result: ", newSigningResult.Proof)
// return
// }
//}