projectanalysis

package
v0.3.0-20261204225004-... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Project analysis

Project analysis consumes request IDs after terminal build analysis has retained all final build issues. A missing terminal-analysis completion is an invalid handoff, not a reason to poll.

The controller materializes both directions of each issue/project association and records attribution completion before resolving project statuses and recording their facts and lookup entries. Each step retains its own event after its writes. Once both steps finish, the controller records project_analysis_completed, updates the request-summary completion timestamp, publishes project.analysis.completed, and queues repository recording. Project-fact and attribution events do not set that timestamp; attribution queries still require the successful attribution event.

Only terminal build analysis that confirms complete validation runs the attribution and status providers. Incomplete or unknown coverage skips both providers and their result events, but still completes project analysis and queues repository recording.

Retries adopt immutable facts and repair missing lookup entries. A completed request skips provider calls, repairs its summary if needed, and retries hook publication followed by the recording handoff. Empty results still record completion. Cancelled requests bypass project analysis; superseded requests require no work.

Result metrics

Metrics under request_log_materializer.project_analysis use the processing context's queue tag:

Metric Type Value
project_results Counter Project observations, tagged status=green or status=broken
requests_with_broken_projects Counter Requests recording at least one broken project
project_results_per_request Histogram Number of recorded project results
broken_projects_per_request Histogram Number of recorded broken results
broken_project_fraction_per_request Histogram Broken results divided by total results; omitted for an empty result set

These describe each request's recorded results, not distinct currently broken projects or a guaranteed full changed-project inventory. Successful empty results contribute zero to the count histograms; skipped validation contributes no samples. Fraction buckets range from 0 to 1, with finer bands below 1% broken. Count buckets range from 0 to 50,000 with overflow.

Observations follow the first successful creation of the project-facts event. Retries and summary repairs do not repeat them. Metrics are best-effort: a crash or ambiguous storage response between persistence and emission can lose samples.

Completion hook

The project.analysis.completed payload contains only queue and request_id. Consumers resolve project counts from the request summary and project details from the retained facts and associations. Completion is published even when no projects are affected or incomplete validation skips project results. Cancelled, superseded, abandoned, and unfinished project analyses do not publish this hook.

Publication follows the durable completion log and its summary projection, and precedes the recording handoff. The event ID hashes the queue/request identity and the timestamp comes from the retained completion log. A failed publication is retried without calling providers again. Delivery is at least once; consumers performing external side effects must durably deduplicate by event ID.

Recovery

DLQ recovery leaves existing facts and association rows untouched. If project_analysis_completed was already recorded, it repairs the summary. Otherwise it records project_analysis_abandoned, without calling either provider or marking attribution complete. Recovery never publishes hooks or queues repository recording. If normal publication exhausts retries, the completion notification may be lost. History and summary repairs are safe to retry.

Normal redeliveries also recognize abandonment, repair its summary, and stop. An already-running delivery may still finish immutable writes; abandonment does not roll them back or make a partial association set complete.

Documentation

Overview

Package projectanalysis records project statuses and issue attribution after build analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(
	logger *zap.SugaredLogger,
	scope tally.Scope,
	stores storage.Factory,
	requestLogMaterializer requestlog.Materializer,
	resolvers projectstatus.ResolverFactory,
	attributers projectissues.AttributerFactory,
	registry consumer.TopicRegistry,
	topicKey consumer.TopicKey,
	consumerGroup string,
) *Controller

func (*Controller) ConsumerGroup

func (c *Controller) ConsumerGroup() string

func (*Controller) Name

func (c *Controller) Name() string

func (*Controller) Process

func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) (retErr error)

func (*Controller) TopicKey

func (c *Controller) TopicKey() consumer.TopicKey

type DLQController

type DLQController struct {
	// contains filtered or unexported fields
}

DLQController retains incomplete project analysis without repeating provider calls.

func NewDLQController

func NewDLQController(
	logger *zap.SugaredLogger,
	scope tally.Scope,
	stores storage.Factory,
	requestLogMaterializer requestlog.Materializer,
	topicKey consumer.TopicKey,
	consumerGroup string,
) *DLQController

func (*DLQController) ConsumerGroup

func (c *DLQController) ConsumerGroup() string

func (*DLQController) Name

func (c *DLQController) Name() string

func (*DLQController) Process

func (c *DLQController) Process(ctx context.Context, delivery consumer.Delivery) (retErr error)

Process acknowledges unusable messages and retries failures retaining history or repairing summaries.

func (*DLQController) TopicKey

func (c *DLQController) TopicKey() consumer.TopicKey

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL