Skip to content

Added test workflow for PR and upgraded dependencies #76

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

Merged
5 commits merged into from
Feb 19, 2025
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 30, 2025

Description

@ghost ghost force-pushed the sonamt/test-run branch 4 times, most recently from 61bb7c6 to 0b4bdf0 Compare February 4, 2025 05:29
@ghost ghost marked this pull request as ready for review February 4, 2025 05:35
@ghost ghost requested review from a team as code owners February 4, 2025 05:35
@ghost ghost changed the title Added build and test workflow for PRs Added test workflow for PR and fixed security vulnerabilities Feb 4, 2025
Copy link

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

Thanks for this, the security vulnerability fix is just the mod update, and I'm guessing you decided to fix the tests because they were failing on your machine? I think that makes sense. I added some comments, let me know what you think!

Comment on lines 400 to 419
// {
// // Assume the private IPs available on the host are: 10.1.2.3
// // fe80::1025:f732:1001:203
// name: "GetPrivateIPs",
// input: `{{GetPrivateIPs}}`,
// output: `10.1.2.3 fe80::1025:f732:1001:203`,
// },
// {
// // Assume the public IPs available on the host are: 1.2.3.4 6.7.8.9
// name: "GetPublicIPs",
// input: `{{GetPublicIPs}}`,
// output: `1.2.3.4 6.7.8.9`,
// },
// {
// // Assume the private IPs on this host are just the IPv4 addresses:
// // 10.1.2.3 and 172.16.4.6
// name: "GetInterfaceIPs",
// input: `{{GetInterfaceIPs "en0"}}`,
// output: `10.1.2.3 and 172.16.4.6`,
// },

Choose a reason for hiding this comment

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

Remove these

schmichael
schmichael previously approved these changes Feb 7, 2025
Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

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

+1 to @johanbrandhorst's comments about bumping Go and dropping commented out tests.

Logic fix looks good.

Can we update the title and description to drop the security vulnerabilities reference or at least clarify it's a vulnerability in a dependency that is unused by go-sockaddr. go-sockaddr does not have a vulnerability, and I would hate people (or security scanners) to flag the wrong package!

Please correct me if I'm missing something.

@schmichael
Copy link
Member

schmichael commented Feb 7, 2025

This will supersede and close #50. Many apologies for missing the opportunity to merge that one!

@ghost ghost changed the title Added test workflow for PR and fixed security vulnerabilities Added test workflow for PR and upgraded dependencies Feb 13, 2025
@ghost ghost requested review from johanbrandhorst and schmichael February 13, 2025 06:22
schmichael
schmichael previously approved these changes Feb 13, 2025
ifaddrs_test.go Outdated
@@ -632,7 +633,7 @@ func TestGetIfAddrs(t *testing.T) {
t.Fatalf("No loopback interfaces found, loInt nil")
}

if val := sockaddr.IfAddrAttr(*loInt, "flags"); !(val == "up|loopback|multicast" || val == "up|loopback") {
if val := sockaddr.IfAddrAttr(*loInt, "flags"); !strings.Contains(val, "up|loopback") {

Choose a reason for hiding this comment

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

Why was this changed? This isn't the same behavior anymore.

Copy link
Author

Choose a reason for hiding this comment

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

We are now getting, up|loopback|running as the response on CI and up|loopback|multicast|running on local when running with go1.23. Changed the function from contains check to a stricter exact string match

Comment on lines 15 to 19
- '1.19'
- '1.20'
- '1.21'
- '1.22'
- '1.23'

Choose a reason for hiding this comment

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

To make this a little more future proof, we can use the stable and oldstable aliases to use the current and the previous release for this.

Suggested change
- '1.19'
- '1.20'
- '1.21'
- '1.22'
- '1.23'
- 'oldstable'
- 'stable'

@@ -27,6 +27,6 @@ require (
github.com/posener/complete v1.1.1 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/crypto v0.32.0 // indirect

Choose a reason for hiding this comment

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

Could you also change the go stanza at the top of the file to 1.23?

@ghost ghost requested a review from johanbrandhorst February 14, 2025 08:03
Copy link

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

Thanks for this, this repo needed a bit of love, just in time for valentines day ❤️

Copy link
Contributor

@mohanmanikanta2299 mohanmanikanta2299 left a comment

Choose a reason for hiding this comment

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

LGTM

@ghost ghost merged commit d46bd78 into master Feb 19, 2025
3 checks passed
This pull request was closed.
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.

5 participants