Documentation
¶
Overview ¶
Package passcheck provides functionality for checking and displaying pass/fail results for distributions.
Package passcheck exposes the passcheck flow to the app layer.
Index ¶
- func NewConfigLoadError(distributionName string, cause error) error
- func NewCredentialsResolveError(targetName string, cause error) error
- func NewDistributionDetectionError(cause error) error
- func NewDistributionNotFoundError(distributionName string) error
- func NewEvaluationPipelineNotEnabledError(distributionName string) error
- func NewEvaluationPipelineValidationError(distributionName string, cause error) error
- func NewOptionsNilError() error
- func NewOutputPathError(path string, cause error) error
- func NewRemotesLoadError(distributionName string, cause error) error
- func NewReportGenerationError(cause error) error
- func NewTestResultsFetchError(repository string, cause error) error
- func NewTestResultsParseError(repository string, cause error) error
- func NewWorkingDirectoryError(cause error) error
- type CategoryStats
- type CommandHandler
- type CommandHandlerOptions
- type Config
- type Deps
- type Error
- type ErrorType
- type Handler
- type HandlerOptions
- type Request
- type Result
- type StudentTestResults
- type Summary
- type TestResult
- type TestStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfigLoadError ¶
NewConfigLoadError creates an error for config loading failures.
func NewCredentialsResolveError ¶
NewCredentialsResolveError creates an error for credential resolution failures.
func NewDistributionDetectionError ¶
NewDistributionDetectionError creates an error for distribution detection failures.
func NewDistributionNotFoundError ¶
NewDistributionNotFoundError creates an error for missing distribution.
func NewEvaluationPipelineNotEnabledError ¶
NewEvaluationPipelineNotEnabledError creates an error when the evaluation pipeline is not enabled.
func NewEvaluationPipelineValidationError ¶
NewEvaluationPipelineValidationError creates an error for evaluation pipeline validation failures.
func NewOptionsNilError ¶
func NewOptionsNilError() error
NewOptionsNilError creates an error for nil options.
func NewOutputPathError ¶
NewOutputPathError creates an error for invalid output path.
func NewRemotesLoadError ¶
NewRemotesLoadError creates an error for remotes loading failures.
func NewReportGenerationError ¶
NewReportGenerationError creates an error for report generation failures.
func NewTestResultsFetchError ¶
NewTestResultsFetchError creates an error for test results fetching failures.
func NewTestResultsParseError ¶
NewTestResultsParseError creates an error for test results parsing failures.
func NewWorkingDirectoryError ¶
NewWorkingDirectoryError creates an error for working directory failures.
Types ¶
type CategoryStats ¶
type CategoryStats struct {
CategoryName string
TotalTests int
PassedTests int
FailedTests int
StudentsWithCategory int
StudentsPassedCategory int
}
CategoryStats represents statistics for a specific test category
type CommandHandler ¶
type CommandHandler struct {
SecurityService security.Service
RepositoryService repositories.RepositoryService
// contains filtered or unexported fields
}
CommandHandler manages the passcheck command
func NewCommandHandler ¶
func NewCommandHandler(options *CommandHandlerOptions, deps ...*Deps) (*CommandHandler, error)
NewCommandHandler creates a new passcheck handler. Tests can inject mocked dependencies via the optional deps parameter. In production, call with only options (no deps) to use real implementations.
func (*CommandHandler) Cleanup ¶
func (h *CommandHandler) Cleanup() error
Cleanup performs cleanup tasks
type CommandHandlerOptions ¶
type CommandHandlerOptions struct {
DistributionName string
Args []string
DetailMode bool
GenerateReport bool
OutputPath string
Token string
BaseURL string
ReportFormats []string // e.g., ["excel","csv","html","md"]; empty => all
ForceProgress bool
}
CommandHandlerOptions contains the parameters for the passcheck command
type Config ¶
type Config struct {
TestsToIgnore []string `json:"tests_to_ignore"`
CategoriesToIgnore []string `json:"categories_to_ignore"`
OutputPath string `json:"output_path"`
}
Config represents the configuration for pass checking
type Deps ¶
type Deps struct {
GetProjectRoot func() (string, error)
GetDivekitHome func() (string, error)
SelectDistribution func(ctx context.Context, workingDir string, distributionName string) (string, error)
ResolveTargetCredentials func(originCfg *config.OriginConfig, token string, baseURL string, divekitHome string, targetName string) (string, string, error)
ResolveMembersPath func(path string, divekitHome string) (string, error)
NewGitLabProvider func(baseURL, token string) (dataprovider.ContentManager, error)
// Utilities
SleepWithContext func(ctx context.Context, d time.Duration) error
Now func() time.Time
// Filesystem helpers
ReadFile func(path string) ([]byte, error)
ReadDir func(path string) ([]os.DirEntry, error)
MkdirAll func(path string, perm os.FileMode) error
Create func(path string) (io.WriteCloser, error)
GetTerminalWidth func() int
}
Deps bundles injectable dependencies for testability
type Error ¶
type Error = apperror.CommandError[ErrorType]
Error is a type alias for the generic CommandError.
type ErrorType ¶
type ErrorType int
ErrorType defines domain-based error categories for the passcheck package.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler orchestrates passcheck execution.
func NewHandler ¶
func NewHandler(opts *HandlerOptions) *Handler
NewHandler constructs a passcheck handler with default dependencies.
type HandlerOptions ¶
type HandlerOptions struct {
NewInternalHandler newInternalHandlerFunc
}
HandlerOptions configures how the passcheck handler creates its internal command handler.
type Request ¶
type Request struct {
DistributionName string
Args []string
DetailMode bool
GenerateReport bool
ReportFormats []string
OutputPath string
Token string
BaseURL string
ForceProgress bool
}
Request contains the input for a passcheck run.
type StudentTestResults ¶
type StudentTestResults struct {
UUID string
Students []string
TestRepository string
Results []TestResult
PassedCount int
FailedCount int
TotalCount int
HasStarted bool
HasPassed bool
}
StudentTestResults represents test results for a single student
type Summary ¶
type Summary struct {
TotalStudents int
PassedStudents int
FailedStudents int
StartedStudents int
NotStartedStudents int
StudentResults []StudentTestResults
CategorySummary map[string]*CategoryStats
TestSummary map[string]*TestStats
}
Summary represents the overall summary