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

[MM-55224] convert plugin config to scraper config #3

Merged
merged 8 commits into from
Dec 14, 2023
Merged

Conversation

isacikgoz
Copy link
Member

Summary

Convert plugin config to scraper config

Ticket Link

https://mattermost.atlassian.net/browse/MM-55224

@isacikgoz isacikgoz added the 2: Dev Review Requires review by a core committer label Nov 27, 2023
server/configuration.go Outdated Show resolved Hide resolved
if *c.ScrapeTimeoutSeconds < 1 {
return errors.New("scrape timeout should be greater than zero")
}
if *c.BodySizeLimitBytes < 100 {
Copy link
Member

Choose a reason for hiding this comment

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

Should we also impose a max body size limit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, we can do that. Ideally it should be unbounded as we are unaware of possible sample size but for our case we can forecast.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should have some limit as a config for customers to enforce. We can have some large value as default, but it'd be good to allow customers to set some limit as their preference.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add that check for the next PR

server/plugin.go Show resolved Hide resolved
server/plugin.go Outdated Show resolved Hide resolved
server/plugin.go Outdated Show resolved Hide resolved
server/sample.go Show resolved Hide resolved
server/sample.go Show resolved Hide resolved
server/plugin.go Outdated Show resolved Hide resolved
@agnivade
Copy link
Member

Why do we have to disable typecheck though? I've never seen a need for that. Just curious.

@isacikgoz
Copy link
Member Author

Why do we have to disable typecheck though? I've never seen a need for that. Just curious.

There were quite a lot false positives, you can check: https://github.com/mattermost/mattermost-plugin-metrics/actions/runs/7207283664/job/19634510528

I am not sure how it started to happen as they are all unrelated. Tried with the newer version of golangci-lint, but it was all okay. Searched the issues but couldn't find a good explanation. Only a issue related the false positives. Attached it to the .golangci-lint.yml file.

@isacikgoz isacikgoz added 3: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Dec 14, 2023
@isacikgoz isacikgoz merged commit 9b4153b into master Dec 14, 2023
4 checks passed
@isacikgoz isacikgoz deleted the MM-55224 branch December 14, 2023 16:19
@agnivade
Copy link
Member

This

Error: server/configuration.go:159:20: p.API undefined (type *Plugin has no field or method API) (typecheck)
	serverConfig := p.API.GetConfig()
	                  ^
Error: server/configuration.go:161:5: p.API undefined (type *Plugin has no field or method API) (typecheck)
		p.API.LogError("OnConfigurationChange: failed to get server config")
		  ^
Error: server/configuration.go:175:14: p.API undefined (type *Plugin has no field or method API) (typecheck)
	if err := p.API.LoadPluginConfiguration(cfg); err != nil {

looks like a setup issue for sure. Somewhere, it's not able to compile the code correctly.

@isacikgoz
Copy link
Member Author

I tired to build it was compiling but something with the golangci-lint not being able to parse correctly. And it was not complaining until I fixed a spelling error :)

@hanzei
Copy link
Contributor

hanzei commented Dec 18, 2023

That is a CI issue. @fmartingr is working on it: mattermost/actions-workflows#38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants