cilog

package
v1.117.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LockPath added in v1.117.0

func LockPath(baseDir string) string

LockPath is the sidecar advisory-lock file guarding the Load -> Append -> Save sequence against concurrent "glab df run" invocations in one job. It is kept separate from the log file so the lock never conflicts with Save's whole-file atomic rename, which replaces the log's inode.

func Path

func Path(baseDir string) string

func Save

func Save(baseDir string, l *Log) error

Save writes the CI log atomically with owner-only (0o600) permissions. The log records which packages a shared CI runner requested and how the firewall ruled on each; ci-summary reads it back to set the job's exit code. A co-tenant who can rewrite the log could flip that gate, so the file must not be left group/world-writable even when an earlier run (or a pre-planted file) created it with a looser mode. WriteOwnerOnly enforces 0o600 on every rewrite; WriteJSONFile cannot, because renameio.WriteFile preserves a pre-existing target's mode.

Types

type Log

type Log struct {
	SchemaVersion int             `json:"schemaVersion"`
	Session       Session         `json:"session"`
	Entries       []verdict.Entry `json:"entries"`
	// contains filtered or unexported fields
}

func Load

func Load(baseDir string) (*Log, error)

func New

func New(command string) *Log

func (*Log) Append

func (l *Log) Append(e verdict.Entry)

type Session

type Session struct {
	StartedAt string `json:"startedAt"`
	Command   string `json:"command"`
}

Jump to

Keyboard shortcuts

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