func EventFromRawRelease(data string) (chronologist.ReleaseEvent, error) {
	rel, err := DecodeRelease(data)
	if err != nil {
		return chronologist.ReleaseEvent{}, errors.Wrap(err, "decode raw release data")
	}
	r, err := EventFromRelease(rel)
	return r, errors.Wrap(err, "create chronologist release event from helm release")
}
EventFromRawRelease assembles a chronologist release event from the raw helm
release data. This function always returns the same event for the
same release.
package helm
import (
	"strconv"
	"strings"
	"time"
	"github.com/golang/protobuf/ptypes"
	"github.com/pkg/errors"
	"k8s.io/helm/pkg/proto/hapi/release"
	"github.com/hypnoglow/chronologist/internal/chronologist"
)
func EventFromRelease(rel *release.Release) (chronologist.ReleaseEvent, error) {
	t, err := ptypes.Timestamp(rel.Info.LastDeployed)
	if err != nil {
		return chronologist.ReleaseEvent{}, errors.Wrap(err, "unserialize timestamp from proto")
	}
	t = t.Truncate(time.Second).UTC()
	rt := chronologist.ReleaseTypeRollout
	if strings.Contains(strings.ToLower(rel.Info.Description), "rollback") {
		rt = chronologist.ReleaseTypeRollback
	}
	return chronologist.ReleaseEvent{
		Time:      t,
		Type:      rt,
		Status:    rel.Info.Status.Code.String(),
		Name:      rel.Name,
		Revision:  strconv.Itoa(int(rel.Version)),
		Namespace: rel.Namespace,
	}, nil
}