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(api): add emergency contacts database functions #1081

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

Conversation

almostinf
Copy link
Member

@almostinf almostinf commented Sep 10, 2024

Add emergency contacts database functions

Added database functions for emergency contacts - these are the contacts to which notifications will go to users in case of emergency types of problems in Moira

@almostinf almostinf marked this pull request as ready for review September 10, 2024 11:07
@almostinf almostinf requested a review from a team as a code owner September 10, 2024 11:08
@@ -222,6 +222,33 @@ func (contact *ContactData) ToTemplateContact() *templating.Contact {
}
}

// EmergencyContactType are Moira's special internal types of problems.
Copy link
Member

Choose a reason for hiding this comment

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

есть предложение, прекратить это дело плодить, завести папку
обозвать дататайп (выберете лучшее название)

в этом пр все, что касается эмергенси контанкта унести туда
отдельно раздербанить этот жирный файл на кучу файлов в папке

}

// EmergencyContacts converts redis DB reply to moira.EmergencyContact object.
func EmergencyContact(rep *redis.StringCmd) (moira.EmergencyContact, 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

Choose a reason for hiding this comment

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

нужна как публичная?

}

// EmergencyContacts converts redis DB reply to moira.EmergencyContact objects array.
func EmergencyContacts(rep []*redis.StringCmd) ([]*moira.EmergencyContact, error) {
Copy link
Member

Choose a reason for hiding this comment

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

тут тоже потерян глагол

нужна как публичная?

// EmergencyContactType are Moira's special internal types of problems.
type EmergencyContactType string

const (
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

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.

Кажется, в диздоке мы сошлись на том, что типов проблем может быть много, на текущий момент их 5: не работает база, нет метрик, не работает чекер, не работает локальный чекер, не работает нотифаер. Пользователь будет видеть только разрешенный для выбора тип проблем (например, только отключение нотифаера, как оно будет называться в UI другой вопрос). Админы могут выбрать любой тип проблем. Это будет в другом PR

Copy link
Member

Choose a reason for hiding this comment

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

я не вижу этого текста в ДД, ткнешь меня в ММ этим? :(

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.

3 participants