Skip to content

Conversation

oncilla
Copy link
Contributor

@oncilla oncilla commented Aug 28, 2019

The recover defer was removed by a code refactor in #2707.


This change is Reviewable

@oncilla oncilla added the bug Something isn't working label Aug 28, 2019
@oncilla oncilla added this to the Q3S3 milestone Aug 28, 2019
@oncilla oncilla requested a review from karampok August 28, 2019 12:17
Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 4 unresolved discussions (waiting on @karampok and @oncilla)


go/proto/cereal.go, line 22 at r1 (raw file):

	"io"

	capnp "zombiezen.com/go/capnproto2"

Seems that is being added by my go-import automatically.
Do you understand why?


go/proto/cereal.go, line 113 at r1 (raw file):

		return err
	}
	return parseStruct(c, s)

Do we use this function? if not maybe delete the implementation


go/proto/cereal_test.go, line 61 at r1 (raw file):

			a := &asEntry{}
			raw := make(common.RawBytes, 1024)
			n, err := WriteRoot(a, raw)

Ideally your unit test on function ParseFromRaw should not depend on any other function within the file. Maybe you could hardcode the raw (or maybe rewrite the help-testing function)


go/proto/cereal_test.go, line 67 at r1 (raw file):

				err = ParseFromRaw(a, raw)
			}
			pogsExtractF = test.Extractor

This is confusing to me, I would like more to have the ParseFromRaw to accept another argument (the function pogsExtractF) for readability. But it is okay to let it like that

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @oncilla)

Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @karampok)


go/proto/cereal.go, line 113 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

Do we use this function? if not maybe delete the implementation

Good point.
Done.


go/proto/cereal_test.go, line 61 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

Ideally your unit test on function ParseFromRaw should not depend on any other function within the file. Maybe you could hardcode the raw (or maybe rewrite the help-testing function)

It is a bit hard to hard-code this.
If we change the proto file for ASEntry, then the unit tests will suddenly fail, which is unexpected.
Also, if WriteRoot does not work as expected, we are in a completely different world of pain :)


go/proto/cereal_test.go, line 67 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

This is confusing to me, I would like more to have the ParseFromRaw to accept another argument (the function pogsExtractF) for readability. But it is okay to let it like that

Yeah. I also don't like the package variable that defines of stuff is extracted.
But I think it was the only way to make this testable without having an API that you suggested.

Note, in normal operation it does not make sense to provide any other extractor function, this is truly just for testing the code and the API exposed by ParseFromRaw is the correct one.

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @oncilla)


go/proto/cereal_test.go, line 61 at r1 (raw file):

Previously, Oncilla wrote…

It is a bit hard to hard-code this.
If we change the proto file for ASEntry, then the unit tests will suddenly fail, which is unexpected.
Also, if WriteRoot does not work as expected, we are in a completely different world of pain :)

In theory you could use once the WriteRoot and save to a buffer var the value you need (assuming that now WriteRoot currently works).
I would prefer that mainly because of keeping the files short (fewer lines of code).
But up to you, not strong feeling.


go/proto/cereal_test.go, line 67 at r1 (raw file):

Previously, Oncilla wrote…

Yeah. I also don't like the package variable that defines of stuff is extracted.
But I think it was the only way to make this testable without having an API that you suggested.

Note, in normal operation it does not make sense to provide any other extractor function, this is truly just for testing the code and the API exposed by ParseFromRaw is the correct one.

fair

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @oncilla)

@oncilla oncilla force-pushed the pub-catch-pogs-panic branch from 8dacb7d to 0ab45b7 Compare August 29, 2019 11:16
Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @karampok)


go/proto/cereal_test.go, line 61 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

In theory you could use once the WriteRoot and save to a buffer var the value you need (assuming that now WriteRoot currently works).
I would prefer that mainly because of keeping the files short (fewer lines of code).
But up to you, not strong feeling.

Done.


go/proto/cereal_test.go, line 67 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

fair

Done.

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@oncilla oncilla force-pushed the pub-catch-pogs-panic branch from 0ab45b7 to f8e8a70 Compare August 29, 2019 14:03
@oncilla oncilla merged commit 32648b6 into scionproto:master Aug 29, 2019
@oncilla oncilla deleted the pub-catch-pogs-panic branch August 29, 2019 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants