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

feat: trigger name limit #1080

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

AleksandrMatsko
Copy link
Member

PR Summary

Before this PR there was no limit to trigger name. This can lead to problems with alert delivering.

This PR adds configurable limit for trigger name. It is highly recommended not to increase it.

@AleksandrMatsko AleksandrMatsko requested a review from a team as a code owner September 4, 2024 04:54
limits/limits.go Outdated Show resolved Hide resolved
api/dto/triggers.go Outdated Show resolved Hide resolved
api/dto/triggers.go Outdated Show resolved Hide resolved
limits/limits.go Outdated Show resolved Hide resolved
api/config.go Outdated Show resolved Hide resolved
almostinf
almostinf previously approved these changes Sep 10, 2024
limits := middleware.GetLimits(request)
if utf8.RuneCountInString(trigger.Name) > limits.Trigger.MaxNameSize {
return api.ErrInvalidRequestContent{
ValidationError: fmt.Errorf("trigger name too long, should not be greater than %d symbols", limits.Trigger.MaxNameSize),
Copy link
Member

Choose a reason for hiding this comment

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

а эту тогда ошибку почему не утащил наверх?)

Copy link
Member Author

Choose a reason for hiding this comment

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

А тут параметр есть, поэтому не стал...

@AleksandrMatsko
Copy link
Member Author

/build

Copy link

Build and push Docker images with tag: feat-trigger-name-limit.2024-09-27.7bcb0da

1 similar comment
Copy link

Build and push Docker images with tag: feat-trigger-name-limit.2024-09-27.7bcb0da

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.

4 participants