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(notifier): add validation notifier config #1099

Merged
merged 6 commits into from
Oct 7, 2024

Conversation

almostinf
Copy link
Member

@almostinf almostinf commented Sep 26, 2024

Add validation notifier config

Added validation of the notifier's senders config, required fields are now checked with validator

@almostinf almostinf requested a review from a team as a code owner September 26, 2024 09:00
senders/msteams/msteams.go Outdated Show resolved Hide resolved
@almostinf
Copy link
Member Author

/build

AleksandrMatsko
AleksandrMatsko previously approved these changes Oct 1, 2024
helpers.go Outdated
@@ -250,3 +252,9 @@ func MergeToSorted[T Comparable](arr1, arr2 []T) ([]T, error) {

return merged, nil
}

// ValidateConfig is a generic function needed to validate the config structure using validator.
func ValidateConfig(cfg any) error {
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.

Куда лучше его тогда засунуть? У нас в хелперах живут функции, которые обобщенные и могут переиспользоваться в разных модулях

Copy link
Member

Choose a reason for hiding this comment

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

мэйба в район cmd
или нэйминг поправить

я бы парней еще послушала

Copy link
Member Author

@almostinf almostinf Oct 7, 2024

Choose a reason for hiding this comment

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

а зачем в cmd? Он же вообще никак с cmd не связан и используется в сендерах. А касательно нейминга даже хз, как лучше, может ValidateConfigStruct, тк мы именно структуру валидируем?

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 @Tetrergeru давайте ваше мнение тоже узнаем

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

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.

то есть сделать helpers/util внутри с папками сендеров?

Copy link
Member

Choose a reason for hiding this comment

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

Да, примерно такое имел в виду

@almostinf almostinf requested a review from kissken October 7, 2024 08:07
Tetrergeru
Tetrergeru previously approved these changes Oct 7, 2024
@almostinf almostinf merged commit 8255890 into master Oct 7, 2024
6 checks passed
@almostinf almostinf deleted the feat/validate-notifier-config branch October 7, 2024 10:24
Copy link

github-actions bot commented Oct 7, 2024

Build and push Docker images with tag: 2024-10-07.8255890

1 similar comment
Copy link

github-actions bot commented Oct 7, 2024

Build and push Docker images with tag: 2024-10-07.8255890

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