<commit_before>package api

import (
	"github.com/nais/naisd/api/naisrequest"
	"k8s.io/apimachinery/pkg/util/uuid"
	"strings"
	"time"

	"github.com/golang/protobuf/ptypes/timestamp"
	"github.com/nais/naisd/pkg/event"
	docker "github.com/novln/docker-parser"
)

// NewDeploymentEvent creates a new deployment event based on a naisd deployment request along with its manifest and cluster name.
func NewDeploymentEvent(request naisrequest.Deploy, manifest NaisManifest, clusterName string) deployment.Event {
	image := ContainerImage(manifest.Image)
	ts := convertTimestamp(time.Now())
	id := uuid.NewUUID()

	return deployment.Event{
		CorrelationID: string(id),
		Platform: &deployment.Platform{
			Type: deployment.PlatformType_nais,
		},
		Source: deployment.System_naisd,
		Deployer: &deployment.Actor{
			Ident: request.FasitUsername,
		},
		Team:            manifest.Team,
		RolloutStatus:   deployment.RolloutStatus_complete,
		Environment:     environment(request),
		SkyaEnvironment: request.FasitEnvironment,<commit_msg>we need to assemble the full image string as this is composed by both manifest and request param<commit_after>package api

import (
	"fmt"
	"github.com/nais/naisd/api/naisrequest"
	"k8s.io/apimachinery/pkg/util/uuid"
	"strings"
	"time"

	"github.com/golang/protobuf/ptypes/timestamp"
	"github.com/nais/naisd/pkg/event"
	docker "github.com/novln/docker-parser"
)

// NewDeploymentEvent creates a new deployment event based on a naisd deployment request along with its manifest and cluster name.
func NewDeploymentEvent(request naisrequest.Deploy, manifest NaisManifest, clusterName string) deployment.Event {
	image := ContainerImage(fmt.Sprintf("%s:%s", manifest.Image, request.Version))
	ts := convertTimestamp(time.Now())
	id := uuid.NewUUID()

	return deployment.Event{
		CorrelationID: string(id),
		Platform: &deployment.Platform{
			Type: deployment.PlatformType_nais,
		},
		Source: deployment.System_naisd,
		Deployer: &deployment.Actor{
			Ident: request.FasitUsername,
		},
		Team:            manifest.Team,
		RolloutStatus:   deployment.RolloutStatus_complete,
		Environment:     environment(request),
		SkyaEnvironment: request.FasitEnvironment,
{'fraction_non_alphanumeric': 0.10663615560640732, 'fraction_numerical': 0.0009153318077803204, 'mean_word_length': 4.908108108108108, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5965312', 'n_tokens_mistral': 735, 'n_tokens_neox': 694, 'n_words': 151}