smoke

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package smoke: 只读巡检 probe 注册表(spec 3期 §3.2)。

Index

Constants

This section is empty.

Variables

View Source
var Probes = map[string]ProbeFunc{
	"repo":       probeRepo,
	"cr":         probeCR,
	"webhook":    probeWebhook,
	"pagination": probePagination,
	"errors":     probeErrors,
	"connection": probeConnection,
}

Probes 是六家族注册表——家族名即 workflow families input 的取值域。 只读红线(spec §2):每个实现体内零写方法调用;新增家族必须同步 smoke/probes_test.go 的 TestProbesRegistry_SixFamiliesReadOnly(长度 断言会红,强制有意识地登记)。

Functions

func ParseFamilies

func ParseFamilies(s string) []string

ParseFamilies 解析 GIT_PLATFORM_SMOKE_FAMILIES:空→["repo"](现状), "all"→全六,逗号分隔按序去空白。

Types

type Options

type Options struct {
	Owner, Repo, URL string
	Token            string
	Logf             func(format string, args ...any)
}

Options 沿用现有 smoke 入口的 owner/repo/target 参数;Token 与 Logf 是 3 期新增:errors 家族用 Token 构造「坏凭据」只读复核(401/403 分类哨兵, 真平台面),Logf 承接原入口的 t.Logf 观测行(nil = 静默,probe 对 testing 零依赖)。Platform 一律取 p.Platform(),不进 Options。

type ProbeFunc

type ProbeFunc func(ctx context.Context, p provider.Provider, opts Options) error

ProbeFunc 是一个只读探针家族;实现内禁止调用任何写方法 (创建/更新/删除/标记)——lint 与评审共同把守(spec §2 红线)。

Jump to

Keyboard shortcuts

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