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

Move to go 1.18. #958

Merged
merged 2 commits into from
Oct 23, 2023
Merged

Move to go 1.18. #958

merged 2 commits into from
Oct 23, 2023

Conversation

duglin
Copy link
Contributor

@duglin duglin commented Oct 18, 2023

Upgrade to go v1.18
Had to run gofmt on a few files too.
Added more time.Sleep calls to try to fix the race condition, again.

@@ -12,7 +12,7 @@ jobs:
name: CloudEvents
strategy:
matrix:
go-version: [1.17.x]
go-version: [1.18.x]
Copy link
Member

Choose a reason for hiding this comment

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

nit: you can use the latest available go version in the workflows

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok I changed them all to use "stable".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think one downside to this is that the first person to do a PR after a new release of golang might be forced to do things like run "gofmt" on everything if the format rules change. Just ran into that. But let's see how it goes...

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, not a big fan of these abstract version identifiers, especially when it comes to troubleshooting and you don't see immediately which version we are using in CI. Feel free to revert to 1.21 for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok back to 1.21

@duglin
Copy link
Contributor Author

duglin commented Oct 23, 2023

with the race condition behind us, this one is now ready for final review and merge.
I had to add a few more time.Sleep calls to avoid another race condition. I'm not happy about it but it seems to help.... at least for now.
@embano1 @lionelvillard

@@ -86,7 +86,8 @@ func Format(v interface{}) (string, error) {
}

// Validate v is a valid CloudEvents attribute value, convert it to one of:
// bool, int32, string, []byte, types.URI, types.URIRef, types.Timestamp
//
Copy link
Member

Choose a reason for hiding this comment

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

question: is this newline intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea how this got here aside from gofmt doing it - I would not have added this. I'll remove it and see what happens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there were tabs in the comments and gofmt converted them to blank lines

@@ -24,7 +24,8 @@ type RequestData struct {
}

// WithRequestDataAtContext uses the http.Request to add RequestData
// information to the Context.
//
// information to the Context.
Copy link
Member

Choose a reason for hiding this comment

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

nit: spacing seems off

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same here

@@ -29,6 +30,9 @@ func SendReceive(t *testing.T, protocolFactory func() interface{}, in event.Even
wg := sync.WaitGroup{}
wg.Add(2)

// Give time for Kafka client protocol to get setup
time.Sleep(5 * time.Second)
Copy link
Member

Choose a reason for hiding this comment

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

question: why did we add those sleeps in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I had this PR open :-)
I can create a separate PR but in the end does it really matter as long as it all gets merged?

@@ -104,7 +104,7 @@ func testSenderReceiver(t testing.TB) (func(), bindings.Sender, bindings.Receive

// Not perfect but we need to give OpenInbound() as chance to start
// as it's a race condition. I couldn't find something on 'p' to wait for
time.Sleep(5 * time.Second)
time.Sleep(15 * time.Second)
Copy link
Member

Choose a reason for hiding this comment

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

question: why did we change this in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

once i added the other sleeps I saw this race condition appear again. So I increased this one to be more than the other 2 sleep values combined. Not 100% sure if I'm just getting lucky or not but my local testing seems happier now

@duglin duglin force-pushed the go1.18 branch 2 times, most recently from 9e42e52 to 30fd973 Compare October 23, 2023 15:30
embano1
embano1 previously approved these changes Oct 23, 2023
Copy link
Member

@embano1 embano1 left a comment

Choose a reason for hiding this comment

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

LGTM

Doug Davis added 2 commits October 23, 2023 15:37
Had to run gofmt and fix some weird typos due to tabs in the comments

Signed-off-by: Doug Davis <[email protected]>
Signed-off-by: Doug Davis <[email protected]>
@embano1 embano1 merged commit 9c0547b into cloudevents:main Oct 23, 2023
9 checks passed
@duglin duglin deleted the go1.18 branch October 23, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants