profile
viewpoint

VictoriaMetrics/VictoriaMetrics 3269

VictoriaMetrics: fast, cost-effective monitoring solution and time series database

GolangUA/gopher-logos 81

adorable gopher logos

VictoriaMetrics/helm-charts 40

Helm charts for VictoriaMetrics

region23/gobyexample.ru 37

Go в примерах

VictoriaMetrics/vmctl 30

Victoria Metrics command line tool

patsevanton/victoriametrics-rpm 5

RPM for VictoriaMetrics - the best long-term remote storage for Prometheus

tenmozes/workshops 1

The set of materials for workshops

tenmozes/action-builder 0

A collection of GitHub Actions that can be used to automate the testing, building, and deployment of custom GitHub Actions using workflows

tenmozes/docs 0

Prometheus documentation: content and static site generator

Pull request review commentpercona/pmm

PMM-5364 SSL support for Mongo.

 message AddMongoDBExporterRequest {   bool tls = 5;   // Skip TLS certificate and hostname validation.   bool tls_skip_verify = 6;+  // Certificate file.+  string tls_certificate_key_file = 10;+  // Certificate password.+  string tls_certificate_key_file_password = 11;

It will require including mongodb lib into pmm-admin and as far as I remember we are trying to keep pmm-admin as simple as possible. and it's simpler to just use tlsCertificateKeyFile and tlsCertificateKeyFilePassword in DSN

JiriCtvrtka

comment created time in 12 minutes

Pull request review commentpercona/pmm-managed

PMM-6968 Notification channels API

 package ia  import (+	"context"+ 	iav1beta1 "github.com/percona/pmm/api/managementpb/ia"+	"github.com/pkg/errors"+	"google.golang.org/grpc/codes"+	"google.golang.org/grpc/status"++	"github.com/percona/pmm-managed/models"+	"github.com/percona/pmm-managed/services/ia" ) +// ChannelsService represents integrated alerting channels API. type ChannelsService struct {-	iav1beta1.UnimplementedChannelsServer // TODO remove+	ia aletringService+}++// NewChannelsService creates new channels API service.+func NewChannelsService(ia *ia.Service) *ChannelsService {+	return &ChannelsService{+		ia: ia,+	}+}++// ListChannels returns list of available channels.+func (s *ChannelsService) ListChannels(ctx context.Context, request *iav1beta1.ListChannelsRequest) (*iav1beta1.ListChannelsResponse, error) {+	channels, err := s.ia.ListChannels()+	if err != nil {+		return nil, errors.Wrap(err, "failed to get notification channels")+	}++	res := make([]*iav1beta1.Channel, len(channels))+	for i, channel := range channels {+		c := &iav1beta1.Channel{+			ChannelId: channel.ID,+			Disabled:  channel.Disabled,+		}++		switch channel.Type {+		case models.Email:+			config := channel.EmailConfig+			c.Channel = &iav1beta1.Channel_EmailConfig{+				EmailConfig: &iav1beta1.EmailConfig{+					SendResolved: config.SendResolved,+					To:           config.To,+				},+			}+		case models.PagerDuty:+			config := channel.PagerDutyConfig+			c.Channel = &iav1beta1.Channel_PagerdutyConfig{+				PagerdutyConfig: &iav1beta1.PagerDutyConfig{+					SendResolved: config.SendResolved,+					RoutingKey:   config.RoutingKey,+					ServiceKey:   config.ServiceKey,+				},+			}+		case models.Slack:+			config := channel.SlackConfig+			c.Channel = &iav1beta1.Channel_SlackConfig{+				SlackConfig: &iav1beta1.SlackConfig{+					SendResolved: config.SendResolved,+					Channel:      config.Channel,+				},+			}+		case models.WebHook:+			config := channel.WebHookConfig+			c.Channel = &iav1beta1.Channel_WebhookConfig{+				WebhookConfig: &iav1beta1.WebhookConfig{+					SendResolved: config.SendResolved,+					Url:          config.URL,+					HttpConfig:   convertModelToHTTPConfig(config.HTTPConfig),+					MaxAlerts:    config.MaxAlerts,+				},+			}+		default:+			return nil, errors.Wrapf(err, "unknown notification channel type %s", channel.Type)+		}++		res[i] = c+	}++	return &iav1beta1.ListChannelsResponse{Channels: res}, nil+}++// AddChannel adds new notification channel.+func (s *ChannelsService) AddChannel(ctx context.Context, req *iav1beta1.AddChannelRequest) (*iav1beta1.AddChannelResponse, error) {+	channel := &models.Channel{+		ID:       req.GetChannelId(),+		Disabled: req.GetDisabled(),+	}++	if emailConf := req.GetEmailConfig(); emailConf != nil {+		channel.Type = models.Email+		channel.EmailConfig = &models.EmailConfig{+			SendResolved: emailConf.SendResolved,+			To:           emailConf.To,+		}+	}+	if pagerDutyConf := req.GetPagerdutyConfig(); pagerDutyConf != nil {+		if channel.Type != "" {+			return nil, status.Error(codes.InvalidArgument, "Request should contain only one type of channel configuration")+		}+		channel.Type = models.PagerDuty+		channel.PagerDutyConfig = &models.PagerDutyConfig{+			SendResolved: pagerDutyConf.SendResolved,+			RoutingKey:   pagerDutyConf.RoutingKey,+			ServiceKey:   pagerDutyConf.ServiceKey,+		}+	}+	if slackConf := req.GetSlackConfig(); slackConf != nil {+		if channel.Type != "" {+			return nil, status.Error(codes.InvalidArgument, "Request should contain only one type of channel configuration")+		}+		channel.Type = models.Slack+		channel.SlackConfig = &models.SlackConfig{+			SendResolved: slackConf.SendResolved,+			Channel:      slackConf.Channel,+		}+	}+	if webhookConf := req.GetWebhookConfig(); webhookConf != nil {+		if channel.Type != "" {+			return nil, status.Error(codes.InvalidArgument, "Request should contain only one type of channel configuration")+		}+		channel.Type = models.WebHook+		channel.WebHookConfig = &models.WebHookConfig{+			SendResolved: webhookConf.SendResolved,+			URL:          webhookConf.Url,+			MaxAlerts:    webhookConf.MaxAlerts,+			HTTPConfig:   convertHTTPConfigToModel(webhookConf.HttpConfig),+		}+	}++	err := s.ia.AddChannel(channel)+	if err != nil {+		return nil, err+	}++	return &iav1beta1.AddChannelResponse{}, nil } -func NewChannelsService() *ChannelsService {-	return &ChannelsService{}+// ChangeChannel changes existing notification channel.+func (s *ChannelsService) ChangeChannel(ctx context.Context, req *iav1beta1.ChangeChannelRequest) (*iav1beta1.ChangeChannelResponse, error) {+	channel := &models.Channel{+		ID:       req.GetChannelId(),+		Disabled: req.GetDisabled(),+	}++	if emailConf := req.GetEmailConfig(); emailConf != nil {

maybe it's better to use switch here and other places?

artemgavrilov

comment created time in 32 minutes

Pull request review commentpercona/pmm-managed

PMM-6968 Notification channels API

+// pmm-managed+// Copyright (C) 2017 Percona LLC+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Affero General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Affero General Public License for more details.+//+// You should have received a copy of the GNU Affero General Public License+// along with this program. If not, see <https://www.gnu.org/licenses/>.++package models++import (+	"encoding/json"+	"fmt"++	"github.com/pkg/errors"+	"google.golang.org/grpc/codes"+	"google.golang.org/grpc/status"+	"gopkg.in/reform.v1"+)++// SaveChannel persists notification channel.+func SaveChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return err+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Insert(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// UpdateChannel updates existing notifications channel.+func UpdateChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return errors.Wrap(err, "channel validation failed")+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Update(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// RemoveChannel removes notification channel with specified id.+func RemoveChannel(q *reform.Querier, id string) error {+	err := q.Delete(&notificationChannel{ID: id})+	if err != nil {+		return errors.Wrap(err, "failed to delete notifications channel")+	}+	return nil+}++// GetChannels returns saved notification channels configuration.+func GetChannels(q *reform.Querier) ([]Channel, error) {+	structs, err := q.SelectAllFrom(notificationChannelTable, "")+	if err != nil {+		return nil, errors.Wrap(err, "failed to select notification channels")++	}++	channels := make([]Channel, len(structs))+	for i, s := range structs {+		c, err := notificationChannelToChannel(s.(*notificationChannel))+		if err != nil {+			return nil, err+		}+		channels[i] = *c+	}++	return channels, nil+}++// ValidateChannel validates notification channel.+func ValidateChannel(ch *Channel) error {

should we make this function public only for tests? looks like we can use SaveChannel in those tests

artemgavrilov

comment created time in 35 minutes

Pull request review commentpercona/pmm-managed

PMM-6968 Notification channels API

+// pmm-managed+// Copyright (C) 2017 Percona LLC+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Affero General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Affero General Public License for more details.+//+// You should have received a copy of the GNU Affero General Public License+// along with this program. If not, see <https://www.gnu.org/licenses/>.++package models++import (+	"encoding/json"+	"fmt"++	"github.com/pkg/errors"+	"google.golang.org/grpc/codes"+	"google.golang.org/grpc/status"+	"gopkg.in/reform.v1"+)++// SaveChannel persists notification channel.+func SaveChannel(q *reform.Querier, c *Channel) error {

CreateChannel for consistency

artemgavrilov

comment created time in 35 minutes

Pull request review commentpercona/pmm-managed

PMM-6968 Notification channels API

+// pmm-managed+// Copyright (C) 2017 Percona LLC+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Affero General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Affero General Public License for more details.+//+// You should have received a copy of the GNU Affero General Public License+// along with this program. If not, see <https://www.gnu.org/licenses/>.++package models++import (+	"encoding/json"+	"fmt"++	"github.com/pkg/errors"+	"google.golang.org/grpc/codes"+	"google.golang.org/grpc/status"+	"gopkg.in/reform.v1"+)++// SaveChannel persists notification channel.+func SaveChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return err+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Insert(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// UpdateChannel updates existing notifications channel.+func UpdateChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return errors.Wrap(err, "channel validation failed")+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Update(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// RemoveChannel removes notification channel with specified id.+func RemoveChannel(q *reform.Querier, id string) error {+	err := q.Delete(&notificationChannel{ID: id})+	if err != nil {+		return errors.Wrap(err, "failed to delete notifications channel")+	}+	return nil+}++// GetChannels returns saved notification channels configuration.+func GetChannels(q *reform.Querier) ([]Channel, error) {

maybe FindChannels for consistency?

artemgavrilov

comment created time in 38 minutes

delete branch percona/pmm-managed

delete branch : PMM-6969-rules-api

delete time in an hour

Pull request review commentpercona/pmm

PMM-6982 IA settings API

 message MetricsResolutions {   google.protobuf.Duration lr = 3; } +// EmailAlertingSettings represents email (SMTP) configuration for Integrated Alerting.+message EmailAlertingSettings {+  // SMTP From header field.+  string from = 1 [+    (validator.field) = {+      string_not_empty: true+    }+  ];+  // SMTP host and port.+  string smarthost = 2 [+    (validator.field) = {+      string_not_empty: true+    }+  ];+  // Hostname to identify to the SMTP server.+  string hello = 3;

maybe helo?

AlekSi

comment created time in an hour

Pull request review commentpercona/pmm

PMM-6982 IA settings API

 message MetricsResolutions {   google.protobuf.Duration lr = 3; } +// EmailAlertingSettings represents email (SMTP) configuration for Integrated Alerting.+message EmailAlertingSettings {+  // SMTP From header field.+  string from = 1 [+    (validator.field) = {+      string_not_empty: true+    }+  ];+  // SMTP host and port.+  string smarthost = 2 [+    (validator.field) = {+      string_not_empty: true+    }+  ];+  // Hostname to identify to the SMTP server.+  string hello = 3;

hello?

AlekSi

comment created time in an hour

Pull request review commentpercona/pmm

PMM-6827 DB cluster monitoring.

 message ChangeSettingsRequest {   bool enable_stt = 11;   // Disable Security Threat Tool   bool disable_stt = 12;+  // PMM Server public address.+  string pmm_public_address = 13;

What about pmm external address? :)

BupycHuk

comment created time in an hour

PR opened percona/pmm

Reviewers
PMM-6827 DB cluster monitoring.
+242 -152

0 comment

6 changed files

pr created time in an hour

pull request commentPercona-Lab/pmm-submodules

PMM-7003 Advanced Data Exploration broken after upgrade to 2.11.2

server docker - perconalab/pmm-server-fb:PR-1252-34df876 client docker - perconalab/pmm-client-fb:PR-1252-34df876 client - https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1252-34df876.tar.gz Create Staging Instance: https://pmm.cd.percona.com/job/aws-staging-start/parambuild/?DOCKER_VERSION=perconalab/pmm-server-fb:PR-1252-34df876&CLIENT_VERSION=https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1252-34df876.tar.gz

adivinho

comment created time in 3 hours

create barnchpercona/pmm-managed

branch : PMM-6969-rules-api

created branch time in 3 hours

pull request commentPercona-Lab/pmm-submodules

PMM-6968 notifications api

Some Tests have Failed Please check: API: https://pmm.cd.percona.com/job/pmm2-api-tests/5019/ BATS: https://pmm.cd.percona.com/job/pmm2-testsuite/4401/ & UI: https://pmm.cd.percona.com/job/pmm2-ui-tests/5709/

artemgavrilov

comment created time in 3 hours

pull request commentPercona-Lab/pmm-submodules

PMM-6968 notifications api

Some Tests have Failed Please check: API: https://pmm.cd.percona.com/job/pmm2-api-tests/5018/ BATS: https://pmm.cd.percona.com/job/pmm2-testsuite/4400/ & UI: https://pmm.cd.percona.com/job/pmm2-ui-tests/5708/

artemgavrilov

comment created time in 3 hours

Pull request review commentpercona/grafana-dashboards

PMM-6985 add cluster deletion force mode

 export const KubernetesInventory: FC<KubernetesProps> = ({         isVisible={deleteModalVisible}         onClose={() => setDeleteModalVisible(false)}       >-        <h4 className={styles.deleteModalContent}>-          {Messages.kubernetes.deleteModal.confirmMessage}-        </h4>-        <HorizontalGroup justify="space-between" spacing="md">-          <Button-            variant="secondary"-            size="md"-            onClick={() => setDeleteModalVisible(false)}-            data-qa="cancel-delete-kubernetes-button"-          >-            {Messages.kubernetes.deleteModal.cancel}-          </Button>-          <Button-            variant="destructive"-            size="md"-            onClick={() => {-              deleteKubernetes(kubernetesToDelete);-              setDeleteModalVisible(false);-            }}-            data-qa="delete-kubernetes-button"-          >-            {Messages.kubernetes.deleteModal.confirm}-          </Button>-        </HorizontalGroup>+        <Form+          onSubmit={() => {}}+          render={({ form, handleSubmit }) => (+            <form onSubmit={handleSubmit}>+              <>+                <h4 className={styles.deleteModalContent}>+                  {Messages.kubernetes.deleteModal.confirmMessage}+                </h4>+                <FormElement+                  dataQa="form-field-force"+                  label="Force mode"

Move to Messages file.

lunaticusgreen

comment created time in 3 hours

Pull request review commentpercona/grafana-dashboards

PMM-6985 add cluster deletion force mode

 export const useKubernetes = (): [Kubernetes[], DeleteKubernetesAction, AddKuber     }   }; -  const deleteKubernetes = async (kubernetesToDelete: Kubernetes) => {+  const deleteKubernetes = async (kubernetesToDelete: Kubernetes, force) => {
  const deleteKubernetes = async (kubernetesToDelete: Kubernetes, force: boolean) => {
lunaticusgreen

comment created time in 3 hours

Pull request review commentpercona/grafana-dashboards

PMM-6985 add cluster deletion force mode

 export const useKubernetes = (): [Kubernetes[], DeleteKubernetesAction, AddKuber     }   }; -  const deleteKubernetes = async (kubernetesToDelete: Kubernetes) => {+  const deleteKubernetes = async (kubernetesToDelete: Kubernetes, force) => {
  const deleteKubernetes = async (kubernetesToDelete: Kubernetes, force: boolean) => {
lunaticusgreen

comment created time in 3 hours

Pull request review commentpercona/grafana-dashboards

PMM-6985 add cluster deletion force mode

 export const KubernetesService = {   getKubernetes() {     return apiRequestManagement.post<KubernetesListAPI, any>('/DBaaS/Kubernetes/List', {});   },-  deleteKubernetes(kubernetes: Kubernetes) {-    return apiRequestManagement.post<any, any>('/DBaaS/Kubernetes/Unregister', toAPI(kubernetes));+  deleteKubernetes(kubernetes: Kubernetes, force) {
  deleteKubernetes(kubernetes: Kubernetes, force: boolean) {
lunaticusgreen

comment created time in 3 hours

Pull request review commentpercona/grafana-dashboards

PMM-6985 add cluster deletion force mode

 export const KubernetesService = {   }, }; -const toAPI = (kubernetes: Kubernetes) => ({+const toAPI = (kubernetes: Kubernetes, force) => ({
const toAPI = (kubernetes: Kubernetes, force: boolean) => ({
lunaticusgreen

comment created time in 3 hours

push eventPercona-Lab/pmm-submodules

PMM Jenkins

commit sha 34df8764dd884d37d55bf813eb8fa9f4c8370766

rewind submodules

view details

push time in 3 hours

pull request commentPercona-Lab/pmm-submodules

PMM-6968 notifications api

server docker - perconalab/pmm-server-fb:PR-1253-f2672d9 client docker - perconalab/pmm-client-fb:PR-1253-f2672d9 client - https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1253-f2672d9.tar.gz Create Staging Instance: https://pmm.cd.percona.com/job/aws-staging-start/parambuild/?DOCKER_VERSION=perconalab/pmm-server-fb:PR-1253-f2672d9&CLIENT_VERSION=https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1253-f2672d9.tar.gz

artemgavrilov

comment created time in 4 hours

pull request commentPercona-Lab/pmm-submodules

PMM-6968 notifications api

server docker - perconalab/pmm-server-fb:PR-1253-f2672d9 client docker - perconalab/pmm-client-fb:PR-1253-f2672d9 client - https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1253-f2672d9.tar.gz Create Staging Instance: https://pmm.cd.percona.com/job/aws-staging-start/parambuild/?DOCKER_VERSION=perconalab/pmm-server-fb:PR-1253-f2672d9&CLIENT_VERSION=https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1253-f2672d9.tar.gz

artemgavrilov

comment created time in 4 hours

pull request commentPercona-Lab/pmm-submodules

PMM-6968 notifications api

server docker - perconalab/pmm-server-fb:PR-1253-f2672d9 client docker - perconalab/pmm-client-fb:PR-1253-f2672d9 client - https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1253-f2672d9.tar.gz Create Staging Instance: https://pmm.cd.percona.com/job/aws-staging-start/parambuild/?DOCKER_VERSION=perconalab/pmm-server-fb:PR-1253-f2672d9&CLIENT_VERSION=https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1253-f2672d9.tar.gz

artemgavrilov

comment created time in 4 hours

Pull request review commentpercona/pmm-managed

PMM-6968 Notification channels API

+// pmm-managed+// Copyright (C) 2017 Percona LLC+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Affero General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Affero General Public License for more details.+//+// You should have received a copy of the GNU Affero General Public License+// along with this program. If not, see <https://www.gnu.org/licenses/>.++package models++// ValidationError represents model validation error.+type ValidationError struct {+	msg string+}

Done

artemgavrilov

comment created time in 4 hours

push eventPercona-Lab/pmm-submodules

PMM Jenkins

commit sha 0f0a9a75a5a2c604ef190e4e8377de7f49bfc57b

rewind submodules

view details

Nurlan Moldomurov

commit sha a920edcdd56558c77fd7fa7ea0155d341ff493de

Update VERSION (#1255)

view details

PMM Jenkins

commit sha ca676438350e3b172602f9a53c75703ba317bd0c

rewind submodules

view details

PMM Jenkins

commit sha e5beb75fcc8a8e97c0bf1a1f8d1298262d45fd97

rewind submodules

view details

PMM Jenkins

commit sha 176307bc57cdb17147add0bcab7e71000ee649ab

rewind submodules

view details

Artem Gavrilov

commit sha f2672d9cc47e061d25793c5de0588ed297517a57

PMM-6968 Feature build

view details

push time in 4 hours

push eventpercona/pmm-managed

Artem Gavrilov

commit sha e2c2a996e459d44527bafc32b449ad4dfc47c33f

PMM-6869 Remove debug code, reformat

view details

push time in 4 hours

pull request commentPercona-Lab/pmm-submodules

PMM-6827 DB cluster monitoring.

server docker - perconalab/pmm-server-fb:PR-1239-e7a24af client docker - perconalab/pmm-client-fb:PR-1239-e7a24af client - https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1239-e7a24af.tar.gz Create Staging Instance: https://pmm.cd.percona.com/job/aws-staging-start/parambuild/?DOCKER_VERSION=perconalab/pmm-server-fb:PR-1239-e7a24af&CLIENT_VERSION=https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1239-e7a24af.tar.gz

JiriCtvrtka

comment created time in 4 hours

Pull request review commentpercona/pmm-managed

PMM-6968 Notification channels API

+// pmm-managed+// Copyright (C) 2017 Percona LLC+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Affero General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Affero General Public License for more details.+//+// You should have received a copy of the GNU Affero General Public License+// along with this program. If not, see <https://www.gnu.org/licenses/>.++package models++import (+	"encoding/json"+	"fmt"++	"github.com/davecgh/go-spew/spew"+	"github.com/pkg/errors"+	"google.golang.org/grpc/codes"+	"google.golang.org/grpc/status"+	"gopkg.in/reform.v1"+)++// SaveChannel persists notification channel.+func SaveChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return err+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Insert(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// UpdateChannel updates existing notifications channel.+func UpdateChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return errors.Wrap(err, "channel validation failed")+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Update(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// RemoveChannel removes notification channel with specified id.+func RemoveChannel(q *reform.Querier, id string) error {+	err := q.Delete(&notificationChannel{ID: id})+	if err != nil {+		return errors.Wrap(err, "failed to delete notifications channel")+	}+	return nil+}++// GetChannels returns saved notification channels configuration.+func GetChannels(q *reform.Querier) ([]Channel, error) {

🚫 [golangci-lint] <sub>reported by reviewdog :dog:</sub><br>unnecessary leading newline (whitespace)

artemgavrilov

comment created time in 5 hours

Pull request review commentpercona/pmm-managed

PMM-6968 Notification channels API

+// pmm-managed+// Copyright (C) 2017 Percona LLC+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Affero General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Affero General Public License for more details.+//+// You should have received a copy of the GNU Affero General Public License+// along with this program. If not, see <https://www.gnu.org/licenses/>.++package models++import (+	"encoding/json"+	"fmt"++	"github.com/davecgh/go-spew/spew"+	"github.com/pkg/errors"+	"google.golang.org/grpc/codes"+	"google.golang.org/grpc/status"+	"gopkg.in/reform.v1"+)++// SaveChannel persists notification channel.+func SaveChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return err+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Insert(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// UpdateChannel updates existing notifications channel.+func UpdateChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return errors.Wrap(err, "channel validation failed")+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Update(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// RemoveChannel removes notification channel with specified id.+func RemoveChannel(q *reform.Querier, id string) error {+	err := q.Delete(&notificationChannel{ID: id})+	if err != nil {+		return errors.Wrap(err, "failed to delete notifications channel")+	}+	return nil+}++// GetChannels returns saved notification channels configuration.+func GetChannels(q *reform.Querier) ([]Channel, error) {++	structs, err := q.SelectAllFrom(notificationChannelTable, "")+	if err != nil {+		return nil, errors.Wrap(err, "failed to select notification channels")+

🚫 [golangci-lint] <sub>reported by reviewdog :dog:</sub><br>File is not gofumpt-ed (gofumpt)

artemgavrilov

comment created time in 5 hours

Pull request review commentpercona/pmm-managed

PMM-6968 Notification channels API

+// pmm-managed+// Copyright (C) 2017 Percona LLC+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Affero General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Affero General Public License for more details.+//+// You should have received a copy of the GNU Affero General Public License+// along with this program. If not, see <https://www.gnu.org/licenses/>.++package models++import (+	"encoding/json"+	"fmt"++	"github.com/davecgh/go-spew/spew"+	"github.com/pkg/errors"+	"google.golang.org/grpc/codes"+	"google.golang.org/grpc/status"+	"gopkg.in/reform.v1"+)++// SaveChannel persists notification channel.+func SaveChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return err+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Insert(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// UpdateChannel updates existing notifications channel.+func UpdateChannel(q *reform.Querier, c *Channel) error {+	if err := ValidateChannel(c); err != nil {+		return errors.Wrap(err, "channel validation failed")+	}++	nc, err := channelToNotificationChannel(c)+	if err != nil {+		return err+	}++	err = q.Update(nc)+	if err != nil {+		return errors.Wrap(err, "failed to create notifications channel")+	}++	return nil+}++// RemoveChannel removes notification channel with specified id.+func RemoveChannel(q *reform.Querier, id string) error {+	err := q.Delete(&notificationChannel{ID: id})+	if err != nil {+		return errors.Wrap(err, "failed to delete notifications channel")+	}+	return nil+}++// GetChannels returns saved notification channels configuration.+func GetChannels(q *reform.Querier) ([]Channel, error) {+

🚫 [golangci-lint] <sub>reported by reviewdog :dog:</sub><br>File is not gofumpt-ed (gofumpt)

artemgavrilov

comment created time in 5 hours

more