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

chore(deps): remove minio dependency #5933

Merged
merged 2 commits into from
Dec 8, 2023
Merged

chore(deps): remove minio dependency #5933

merged 2 commits into from
Dec 8, 2023

Conversation

domasx2
Copy link
Contributor

@domasx2 domasx2 commented Dec 7, 2023

PR Description

Turns out vendored minio dep used for faro receiver has AGPL license. This PR removes the dependency, instead copying in relevant code from older Apache licenesed version of minio.

Which issue(s) this PR fixes

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@domasx2 domasx2 added the app-agent-receiver Related to the app-agent-receiver label Dec 7, 2023
Copy link
Contributor

@ptodev ptodev left a comment

Choose a reason for hiding this comment

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

Thanks! I know it's just copied code, but I couldn't help but put in some comments :) I'm happy to just merge it though.

// supports '*' and '?' wildcards in the pattern string.
// unlike path.Match(), considers a path as a flat name space while matching the pattern.
// The difference is illustrated in the example here https://play.golang.org/p/Ega9qgD4Qz .
func Match(pattern, name string) (matched bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment above talks about a "text", whereas the function's input variable is "name". It'd be nice if both the comment and the function are using the same name.

Comment on lines +66 to +67
str = str[1:]
pattern = pattern[1:]
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems a bit inefficient? I suppose performance is not important in this case?

Comment on lines +374 to +377
actualResult := wildcard.Match(testCase.pattern, testCase.text)
if testCase.matched != actualResult {
t.Errorf("Test %d: Expected the result to be `%v`, but instead found it to be `%v`", i+1, testCase.matched, actualResult)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
actualResult := wildcard.Match(testCase.pattern, testCase.text)
if testCase.matched != actualResult {
t.Errorf("Test %d: Expected the result to be `%v`, but instead found it to be `%v`", i+1, testCase.matched, actualResult)
}
t.Run(fmt.Sprintf("%d", i+1), func(t *testing.T) {
actualResult := wildcard.Match(testCase.pattern, testCase.text)
require.Equal(t, actualResult, testCase.matched)
})

It's a personal preference, but I'd prefer something like this.

@ptodev ptodev merged commit bd19926 into main Dec 8, 2023
8 checks passed
@ptodev ptodev deleted the domas-remove-minio-dep branch December 8, 2023 09:26
BarunKGP pushed a commit to BarunKGP/grafana-agent that referenced this pull request Feb 20, 2024
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
app-agent-receiver Related to the app-agent-receiver frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants