Documentation
¶
Overview ¶
Package source acquires and materializes Git review sources without invoking external Git or GitHub command-line programs.
Index ¶
- Constants
- Variables
- func FinishPublicationCheck(acquisition PublicationCheckAcquisition, prepared change.PreparedPublication) (*change.CheckedPublication, error)
- func FinishPublicationCheckCancellable(cancelled func() error, acquisition PublicationCheckAcquisition, ...) (*change.CheckedPublication, error)
- func PendingPublicationExecutionConstructionBytes(ctx context.Context, checked *change.CheckedPublication) (int64, error)
- type CPUAdmission
- type Cleanup
- type FailureError
- type FailureKind
- type FailureOperation
- type FilterPattern
- type GitConfigPath
- type GitHubAuthor
- type GitHubOwner
- type GitHubRepository
- type GitHubState
- type GitHubToken
- type GitHubURL
- type GitReference
- type IgnoreFile
- type LimitError
- type LimitResource
- type LocalDetails
- type OpenOptions
- type OpenRequest
- type Opened
- func (opened Opened) Kind() SourceKind
- func (opened Opened) Local() (LocalDetails, bool)
- func (opened Opened) Options() OpenOptions
- func (opened Opened) PublicationTarget() (PublicationTarget, bool)
- func (opened Opened) PullRequest() (PullRequestDetails, bool)
- func (opened Opened) Snapshot() change.Snapshot
- type OwnerRepository
- type PatchAcquisition
- type PendingPublicationExecution
- type PendingPublicationReconciliationAcquisition
- func (acquisition *PendingPublicationReconciliationAcquisition) Close()
- func (acquisition *PendingPublicationReconciliationAcquisition) ConstructionBytes() int64
- func (acquisition *PendingPublicationReconciliationAcquisition) Finish(ctx context.Context) change.ReconciliationResult
- func (acquisition *PendingPublicationReconciliationAcquisition) TakePendingCapture() (change.PendingReview, bool)
- type PendingPublicationStep
- func (step *PendingPublicationStep) Advance() error
- func (step *PendingPublicationStep) Close()
- func (step *PendingPublicationStep) ConstructionBytes() int64
- func (step *PendingPublicationStep) Finish(ctx context.Context) PendingPublicationStep
- func (step *PendingPublicationStep) Kind() PendingPublicationStepKind
- func (step *PendingPublicationStep) TakeCommit() (PublicationCommit, error)
- type PendingPublicationStepKind
- type PublicationCheckAcquisition
- type PublicationCheckMode
- type PublicationCommit
- type PublicationReconciliationAcquisition
- type PublicationTarget
- type PullRequestDetails
- type PullRequestNumber
- type PullRequestSelector
- type RepositoryPath
- type Revision
- type RevisionRef
- type Service
- func (service *Service) AcquirePatch(ctx context.Context, opened Opened, revision *Revision, ...) (PatchAcquisition, error)
- func (service *Service) AcquirePendingPublication(ctx context.Context, execution PendingPublicationExecution, ...) PendingPublicationStep
- func (service *Service) AcquirePendingPublicationReconciliation(ctx context.Context, request change.ReconciliationRequest, runCPU CPUAdmission) (*PendingPublicationReconciliationAcquisition, error)
- func (service *Service) AcquirePublicationCheck(ctx context.Context, target PublicationTarget, ...) (PublicationCheckAcquisition, error)
- func (service *Service) AcquirePublicationReconciliation(ctx context.Context, request change.ReconciliationRequest) (*PublicationReconciliationAcquisition, error)
- func (service *Service) CheckPublication(ctx context.Context, target PublicationTarget, ...) (*change.CheckedPublication, error)
- func (service *Service) Close(context.Context) error
- func (service *Service) LoadPatch(ctx context.Context, opened Opened, revision *Revision, ...) (change.PatchResult, error)
- func (service *Service) LoadSyntax(ctx context.Context, opened Opened, revision *Revision, ...) (change.SyntaxResult, error)
- func (service *Service) LoadSyntaxWithCPUAdmission(ctx context.Context, opened Opened, revision *Revision, ...) (change.SyntaxResult, error)
- func (service *Service) Open(ctx context.Context, request OpenRequest) (Opened, *Revision, error)
- func (service *Service) Publish(ctx context.Context, checked *change.CheckedPublication) PublicationCommit
- func (service *Service) ReconcilePublication(ctx context.Context, request change.ReconciliationRequest) change.ReconciliationResult
- func (service *Service) Reload(ctx context.Context, opened Opened, revision *Revision, options OpenOptions, ...) (Opened, *Revision, error)
- func (service *Service) RepositoryRoot(ctx context.Context) (RepositoryPath, error)
- type ServiceOptions
- type SourceKind
- type SyntaxAcquisition
- type Target
- type TargetKind
- type Title
- type WorkingDirectory
Constants ¶
const ( // MaxSourceErrorConstructionBytes bounds one retained boundary error. MaxSourceErrorConstructionBytes int64 = 64 << 10 // MaxPatchResultConstructionBytes bounds a native prepared patch result. MaxPatchResultConstructionBytes int64 = max( change.MaxPreparedPatchConstructionBytes, change.MaxPreparedPatchRetainedBytes, ) )
Variables ¶
var ( ErrSourceLimited = errors.New("source operation exceeded its limit") ErrSourceStale = errors.New("source revision became stale") )
ErrSourceLimited identifies an source limited failure.
var ErrInvalidTarget = errors.New("invalid review target")
ErrInvalidTarget identifies an invalid target failure.
Functions ¶
func FinishPublicationCheck ¶
func FinishPublicationCheck( acquisition PublicationCheckAcquisition, prepared change.PreparedPublication, ) (*change.CheckedPublication, error)
FinishPublicationCheck binds CPU-reconciled preparation to the acquired target.
func FinishPublicationCheckCancellable ¶
func FinishPublicationCheckCancellable( cancelled func() error, acquisition PublicationCheckAcquisition, prepared change.PreparedPublication, ) (*change.CheckedPublication, error)
FinishPublicationCheckCancellable binds CPU-reconciled preparation to the acquired target while keeping payload encoding cancellable.
func PendingPublicationExecutionConstructionBytes ¶
func PendingPublicationExecutionConstructionBytes( ctx context.Context, checked *change.CheckedPublication, ) (int64, error)
PendingPublicationExecutionConstructionBytes returns a conservative bound for prepared wire ownership and the largest one-batch encoding scratch.
Types ¶
type CPUAdmission ¶
CPUAdmission synchronously admits one CPU-only closure. Implementations must invoke work at most once, must not retain it, and must return only after work has completed or admission has failed.
type Cleanup ¶
type Cleanup struct {
// contains filtered or unexported fields
}
Cleanup owns the lightweight filesystem cleanup detached from a source document.
type FailureError ¶
type FailureError struct {
Operation FailureOperation
Kind FailureKind
// contains filtered or unexported fields
}
FailureError describes failure error.
func (*FailureError) Error ¶
func (failure *FailureError) Error() string
Error returns the receiver's error value.
func (*FailureError) Unwrap ¶
func (failure *FailureError) Unwrap() error
Unwrap returns the receiver's unwrap value.
type FailureKind ¶
type FailureKind uint8
FailureKind describes failure kind.
const ( FailureStale FailureCancelled FailureLimited FailureFailed )
FailureUnavailable identifies a supported failure unavailable value.
type FailureOperation ¶
type FailureOperation string
FailureOperation represents failure operation.
const ( OperationDiscoverRepository FailureOperation = "discover-repository" OperationOpenSource FailureOperation = "open-source" OperationCheckPublication FailureOperation = "check-publication" )
OperationDiscoverRepository identifies a supported operation discover repository value.
type FilterPattern ¶
type FilterPattern string
FilterPattern represents filter pattern.
func NewFilterPattern ¶
func NewFilterPattern(value string) (FilterPattern, error)
NewFilterPattern constructs and validates filter pattern.
func (FilterPattern) String ¶
func (pattern FilterPattern) String() string
String returns the receiver's string value.
type GitConfigPath ¶
type GitConfigPath struct {
// contains filtered or unexported fields
}
GitConfigPath is an owned absolute path used by Git configuration loading.
func NewGitConfigPath ¶
func NewGitConfigPath(value string) (GitConfigPath, error)
NewGitConfigPath validates and copies an absolute Git configuration path.
type GitHubAuthor ¶
type GitHubAuthor string
GitHubAuthor represents git hub author.
func (GitHubAuthor) String ¶
func (author GitHubAuthor) String() string
String returns the receiver's string value.
type GitHubOwner ¶
type GitHubOwner string
GitHubOwner represents git hub owner.
func (GitHubOwner) String ¶
func (owner GitHubOwner) String() string
String returns the receiver's string value.
type GitHubRepository ¶
type GitHubRepository string
GitHubRepository represents git hub repository.
func (GitHubRepository) String ¶
func (repository GitHubRepository) String() string
String returns the receiver's string value.
type GitHubState ¶
type GitHubState string
GitHubState describes git hub state.
const ( GitHubOpen GitHubState = "OPEN" GitHubClosed GitHubState = "CLOSED" GitHubMerged GitHubState = "MERGED" )
GitHubOpen identifies a supported git hub open value.
type GitHubToken ¶
type GitHubToken struct {
// contains filtered or unexported fields
}
GitHubToken is an owned GitHub credential. It intentionally has no string conversion so it cannot be included accidentally in diagnostics.
func NewGitHubToken ¶
func NewGitHubToken(value string) (GitHubToken, error)
NewGitHubToken validates and copies a GitHub credential.
type GitReference ¶
type GitReference string
GitReference represents git reference.
func NewGitReference ¶
func NewGitReference(value string) (GitReference, error)
NewGitReference constructs and validates git reference.
func (GitReference) String ¶
func (ref GitReference) String() string
String returns the receiver's string value.
type IgnoreFile ¶
type IgnoreFile string
IgnoreFile represents ignore file.
func NewIgnoreFile ¶
func NewIgnoreFile(value string) (IgnoreFile, error)
NewIgnoreFile constructs and validates ignore file.
func (IgnoreFile) String ¶
func (file IgnoreFile) String() string
String returns the receiver's string value.
type LimitError ¶
type LimitError struct {
Resource LimitResource
Limit uint64
}
LimitError describes limit error.
func (*LimitError) Error ¶
func (failure *LimitError) Error() string
Error returns the receiver's error value.
func (*LimitError) Unwrap ¶
func (failure *LimitError) Unwrap() error
Unwrap returns the receiver's unwrap value.
type LimitResource ¶
type LimitResource string
LimitResource represents limit resource.
const ( LimitRenameCandidates LimitResource = "rename-candidates" LimitChangedFiles LimitResource = "changed-files" LimitPullRequestDepth LimitResource = "pull-request-fetch-depth" LimitRemoteThreads LimitResource = "remote-review-thread-identities" LimitPendingReview LimitResource = "pending-review-identities" LimitIndexEncoding LimitResource = "index-encoded-bytes" LimitIndexPaths LimitResource = "index-path-bytes" LimitIndexExtensions LimitResource = "index-extension-bytes" LimitWorktreeEntries LimitResource = "worktree-visited-entries" LimitWorktreePaths LimitResource = "worktree-visited-path-bytes" LimitWorktreeDepth LimitResource = "worktree-depth" LimitWorktreeDirectories LimitResource = "worktree-open-directories" LimitWorktreeSymlink LimitResource = "worktree-symlink-target-bytes" LimitEmbeddedRepositories LimitResource = "embedded-repositories" LimitConfigFiles LimitResource = "git-config-files" LimitConfigBytes LimitResource = "git-config-bytes" LimitConfigEntries LimitResource = "git-config-entries" LimitConfigIncludeDepth LimitResource = "git-config-include-depth" LimitIgnoreFiles LimitResource = "ignore-files" LimitIgnoreBytes LimitResource = "ignore-bytes" LimitIgnoreRules LimitResource = "ignore-rules" LimitAttributeFiles LimitResource = "attribute-files" LimitAttributeBytes LimitResource = "attribute-bytes" LimitAttributeRules LimitResource = "attribute-rules" LimitPolicyNFAStates LimitResource = "policy-nfa-states" LimitPolicyDFAStates LimitResource = "policy-dfa-states" LimitPolicyEdges LimitResource = "policy-edges" LimitPolicyCompileWork LimitResource = "policy-compile-transitions" LimitPolicyMatchWork LimitResource = "policy-match-transitions" LimitFilterAutomaton LimitResource = "filter-automaton-work" LimitPullRequestRawRecords LimitResource = "pull-request-raw-records" LimitPullRequestRecords LimitResource = "pull-request-retained-records" LimitPackWireBytes LimitResource = "pack-wire-bytes" LimitPackExpandedBytes LimitResource = "pack-expanded-bytes" LimitPullRequestWorkspace LimitResource = "pull-request-workspace-bytes" LimitDiffInputBytes LimitResource = "diff-input-bytes" LimitDiffProcessedBytes LimitResource = "diff-processed-bytes" LimitDiffLineTokens LimitResource = "diff-line-tokens" //nolint:gosec // This names a line-count resource, not a credential. LimitDiffHistogramProbes LimitResource = "diff-histogram-probes" LimitDiffSignatureSpans LimitResource = "diff-signature-spans" LimitDiffSignaturePairs LimitResource = "diff-signature-pairs" LimitDiffSignatureMergeWork LimitResource = "diff-signature-merge-work" LimitDiffScratchBytes LimitResource = "diff-scratch-bytes" LimitDiffWorkspaceBytes LimitResource = "diff-workspace-bytes" )
LimitRenameCandidates identifies a supported limit rename candidates value.
type LocalDetails ¶
type LocalDetails struct {
Repo *RepositoryPath
Base *RevisionRef
Head *RevisionRef
Kind SourceKind
}
LocalDetails represents local details.
type OpenOptions ¶
type OpenOptions struct {
IgnoreFile IgnoreFile
Include []FilterPattern
Exclude []FilterPattern
IncludeUntracked bool
FetchThreads bool
FetchPending bool
BuiltinDefaults bool
Gitignore bool
RVWIgnore bool
}
OpenOptions describes open options.
func (OpenOptions) RetainedBytes ¶
func (options OpenOptions) RetainedBytes() int64
RetainedBytes returns conservative immutable option ownership.
type OpenRequest ¶
type OpenRequest struct {
Target Target
Options OpenOptions
}
OpenRequest identifies one source and its bounded acquisition options.
type Opened ¶
type Opened struct {
// contains filtered or unexported fields
}
Opened is the immutable result of opening one source revision. Its facts remain valid after the corresponding Revision is retired and cleaned up.
func (Opened) Local ¶
func (opened Opened) Local() (LocalDetails, bool)
Local returns the receiver's local value.
func (Opened) Options ¶
func (opened Opened) Options() OpenOptions
Options returns the receiver's options value.
func (Opened) PublicationTarget ¶
func (opened Opened) PublicationTarget() (PublicationTarget, bool)
PublicationTarget returns the source-bound open pull-request publication target.
func (Opened) PullRequest ¶
func (opened Opened) PullRequest() (PullRequestDetails, bool)
PullRequest returns the receiver's pull request value.
type OwnerRepository ¶
type OwnerRepository struct {
// contains filtered or unexported fields
}
OwnerRepository represents owner repository.
func NewOwnerRepository ¶
func NewOwnerRepository(value string) (OwnerRepository, error)
NewOwnerRepository constructs and validates owner repository.
func (OwnerRepository) Owner ¶
func (repository OwnerRepository) Owner() GitHubOwner
Owner returns the receiver's owner value.
func (OwnerRepository) Repository ¶
func (repository OwnerRepository) Repository() GitHubRepository
Repository returns the receiver's repository value.
func (OwnerRepository) String ¶
func (repository OwnerRepository) String() string
String returns the receiver's string value.
type PatchAcquisition ¶
type PatchAcquisition struct {
// contains filtered or unexported fields
}
PatchAcquisition owns patch bytes acquired from Git until CPU preparation.
func (*PatchAcquisition) Close ¶
func (acquisition *PatchAcquisition) Close()
Close releases unprepared patch bytes.
func (*PatchAcquisition) Finish ¶
func (acquisition *PatchAcquisition) Finish( ctx context.Context, runCPU CPUAdmission, ) (change.PatchResult, error)
Finish consumes an acquisition and performs only cancellable CPU preparation.
func (*PatchAcquisition) RequiresPreparation ¶
func (acquisition *PatchAcquisition) RequiresPreparation() bool
RequiresPreparation reports whether Finish must run under CPU admission.
type PendingPublicationExecution ¶
type PendingPublicationExecution struct {
// contains filtered or unexported fields
}
PendingPublicationExecution is an opaque handle to one prepared, bounded pending-review commit protocol. Copies share the same execution state and must drive it serially.
func PreparePendingPublicationExecution ¶
func PreparePendingPublicationExecution( ctx context.Context, checked *change.CheckedPublication, ) (PendingPublicationExecution, error)
PreparePendingPublicationExecution constructs every first-attempt payload once. The caller must reserve PendingPublicationExecutionConstructionBytes and hold a CPU permit while this runs.
func (PendingPublicationExecution) Close ¶
func (execution PendingPublicationExecution) Close()
Close releases all operation-local ownership. Because copied handles share state, closing any copy invalidates every copy and any outstanding step.
func (PendingPublicationExecution) RetainedBytes ¶
func (execution PendingPublicationExecution) RetainedBytes() int64
RetainedBytes returns the complete prepared execution ownership.
type PendingPublicationReconciliationAcquisition ¶
type PendingPublicationReconciliationAcquisition struct {
// contains filtered or unexported fields
}
PendingPublicationReconciliationAcquisition owns bounded remote state until CPU-only continuation classification completes.
func (*PendingPublicationReconciliationAcquisition) Close ¶
func (acquisition *PendingPublicationReconciliationAcquisition) Close()
Close releases acquired state that was not finished.
func (*PendingPublicationReconciliationAcquisition) ConstructionBytes ¶
func (acquisition *PendingPublicationReconciliationAcquisition) ConstructionBytes() int64
ConstructionBytes returns the conservative CPU classification peak.
func (*PendingPublicationReconciliationAcquisition) Finish ¶
func (acquisition *PendingPublicationReconciliationAcquisition) Finish( ctx context.Context, ) change.ReconciliationResult
Finish performs continuation effect construction and classification without network I/O.
func (*PendingPublicationReconciliationAcquisition) TakePendingCapture ¶
func (acquisition *PendingPublicationReconciliationAcquisition) TakePendingCapture() ( change.PendingReview, bool, )
TakePendingCapture transfers a synchronizing acquisition to the review domain for one-pass classification, validation, and rebase preparation.
type PendingPublicationStep ¶
type PendingPublicationStep struct {
// contains filtered or unexported fields
}
PendingPublicationStep is one consuming result from the pending-publication protocol. Copied steps share the same cell and must be used serially; only the first valid consumer can finish, advance, take, or close it.
func (*PendingPublicationStep) Advance ¶
func (step *PendingPublicationStep) Advance() error
Advance consumes a continuation result so its execution can acquire the next network step.
func (*PendingPublicationStep) Close ¶
func (step *PendingPublicationStep) Close()
Close consumes an unfinished step. Closing acquired remote state preserves the uncertainty fence and forces the next acquisition through a safe read; it never makes a direct GitHub write eligible for retry.
func (*PendingPublicationStep) ConstructionBytes ¶
func (step *PendingPublicationStep) ConstructionBytes() int64
ConstructionBytes returns the conservative simultaneous acquisition, classification, and retry-encoding peak.
func (*PendingPublicationStep) Finish ¶
func (step *PendingPublicationStep) Finish(ctx context.Context) PendingPublicationStep
Finish consumes acquired remote state and returns either an explicit continuation or terminal commit. It performs no network I/O.
func (*PendingPublicationStep) Kind ¶
func (step *PendingPublicationStep) Kind() PendingPublicationStepKind
Kind returns the step's current closed outcome. A zero result is invalid or was already consumed through another copy.
func (*PendingPublicationStep) TakeCommit ¶
func (step *PendingPublicationStep) TakeCommit() (PublicationCommit, error)
TakeCommit consumes a terminal result and invalidates its execution before transferring the commit to the caller.
type PendingPublicationStepKind ¶
type PendingPublicationStepKind uint8
PendingPublicationStepKind identifies the only valid outcomes of acquiring or finishing one pending-publication protocol step.
const ( // PendingPublicationStepAcquired requires bounded CPU-only classification. PendingPublicationStepAcquired PendingPublicationStepKind = iota + 1 // PendingPublicationStepContinue permits acquisition of the next protocol step. PendingPublicationStepContinue // PendingPublicationStepTerminal owns the final publication commit. PendingPublicationStepTerminal )
type PublicationCheckAcquisition ¶
type PublicationCheckAcquisition struct {
// contains filtered or unexported fields
}
PublicationCheckAcquisition is the validated network phase of preflight.
func (PublicationCheckAcquisition) FreshPending ¶
func (acquisition PublicationCheckAcquisition) FreshPending() (change.PendingReview, bool)
FreshPending returns the immutable pending capture requiring CPU reconciliation.
type PublicationCheckMode ¶
type PublicationCheckMode uint8
PublicationCheckMode states whether preflight must reacquire an existing pending review before local preparation can be finalized.
const ( // PublicationCheckNew checks a publication with no captured pending change. PublicationCheckNew PublicationCheckMode = iota + 1 // PublicationCheckPendingContinuation reacquires the captured pending change. PublicationCheckPendingContinuation )
type PublicationCommit ¶
type PublicationCommit struct {
Pending *change.PendingReview
Detail change.OperationDetail
RemoteReview uint64
Disposition change.PublicationDisposition
PendingPhase change.PendingPublicationPhase
PendingRefresh change.PendingRefreshAcquisition
}
PublicationCommit represents publication commit.
type PublicationReconciliationAcquisition ¶
type PublicationReconciliationAcquisition struct {
// contains filtered or unexported fields
}
PublicationReconciliationAcquisition owns one bounded GitHub history spool awaiting cancellable CPU validation.
func (*PublicationReconciliationAcquisition) Close ¶
func (acquisition *PublicationReconciliationAcquisition) Close() error
Close releases an unfinished reconciliation acquisition.
func (*PublicationReconciliationAcquisition) Finish ¶
func (acquisition *PublicationReconciliationAcquisition) Finish( ctx context.Context, runCPU CPUAdmission, ) change.ReconciliationResult
Finish validates and classifies acquired history without network I/O.
type PublicationTarget ¶
type PublicationTarget struct {
// contains filtered or unexported fields
}
PublicationTarget is the narrow immutable GitHub target needed by publication preflight. It cannot reach snapshot or repository resources.
func (PublicationTarget) RetainedBytes ¶
func (target PublicationTarget) RetainedBytes() int64
RetainedBytes returns target-owned immutable string bytes and metadata.
func (PublicationTarget) SourceID ¶
func (target PublicationTarget) SourceID() change.SourceID
SourceID returns the target source identity.
type PullRequestDetails ¶
type PullRequestDetails struct {
Author *GitHubAuthor
Repository OwnerRepository
Title Title
BaseOID change.ObjectID
HeadOID change.ObjectID
BaseRef GitReference
HeadRef GitReference
URL GitHubURL
State GitHubState
Number PullRequestNumber
Draft bool
}
PullRequestDetails represents pull request details.
type PullRequestNumber ¶
type PullRequestNumber uint64
PullRequestNumber represents pull request number.
func (PullRequestNumber) Uint64 ¶
func (number PullRequestNumber) Uint64() uint64
Uint64 returns the receiver's uint64 value.
type PullRequestSelector ¶
type PullRequestSelector struct {
// contains filtered or unexported fields
}
PullRequestSelector represents pull request selector.
func NewPullRequestSelector ¶
func NewPullRequestSelector(selector string, repository *OwnerRepository) (PullRequestSelector, error)
NewPullRequestSelector constructs and validates pull request selector.
func (PullRequestSelector) Number ¶
func (selector PullRequestSelector) Number() PullRequestNumber
Number returns the receiver's number value.
func (PullRequestSelector) Repository ¶
func (selector PullRequestSelector) Repository() (OwnerRepository, bool)
Repository returns the receiver's repository value.
type RepositoryPath ¶
type RepositoryPath string
RepositoryPath represents repository path.
func NewRepositoryPath ¶
func NewRepositoryPath(value string) (RepositoryPath, error)
NewRepositoryPath constructs and validates repository path.
func (RepositoryPath) String ¶
func (path RepositoryPath) String() string
String returns the receiver's string value.
type Revision ¶
type Revision struct {
// contains filtered or unexported fields
}
Revision exclusively owns the resources used to lazily materialize an opened source revision.
type RevisionRef ¶
type RevisionRef string
RevisionRef represents revision ref.
func (RevisionRef) String ¶
func (ref RevisionRef) String() string
String returns the receiver's string value.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns local repository discovery and the GitHub client.
func NewService ¶
func NewService(cwd WorkingDirectory, options ServiceOptions) (*Service, error)
NewService constructs and validates service.
func (*Service) AcquirePatch ¶
func (service *Service) AcquirePatch( ctx context.Context, opened Opened, revision *Revision, request change.PatchRequest, ) (PatchAcquisition, error)
AcquirePatch performs validation, filesystem inspection, and Git acquisition only.
func (*Service) AcquirePendingPublication ¶
func (service *Service) AcquirePendingPublication( ctx context.Context, execution PendingPublicationExecution, runCPU CPUAdmission, ) PendingPublicationStep
AcquirePendingPublication performs the next network-only step of a prepared pending-review publication. It returns either acquired CPU work or a terminal commit; a caller must consume that result before acquiring again.
func (*Service) AcquirePendingPublicationReconciliation ¶
func (service *Service) AcquirePendingPublicationReconciliation( ctx context.Context, request change.ReconciliationRequest, runCPU CPUAdmission, ) (*PendingPublicationReconciliationAcquisition, error)
AcquirePendingPublicationReconciliation performs only remote acquisition.
func (*Service) AcquirePublicationCheck ¶
func (service *Service) AcquirePublicationCheck( ctx context.Context, target PublicationTarget, options change.PublicationOptions, mode PublicationCheckMode, runCPU CPUAdmission, ) (PublicationCheckAcquisition, error)
AcquirePublicationCheck performs only network acquisition and validation.
func (*Service) AcquirePublicationReconciliation ¶
func (service *Service) AcquirePublicationReconciliation( ctx context.Context, request change.ReconciliationRequest, ) (*PublicationReconciliationAcquisition, error)
AcquirePublicationReconciliation performs only the non-pending network acquisition phase.
func (*Service) CheckPublication ¶
func (service *Service) CheckPublication( ctx context.Context, target PublicationTarget, prepared change.PreparedPublication, ) (*change.CheckedPublication, error)
CheckPublication performs the compatibility preflight path synchronously.
func (*Service) LoadPatch ¶
func (service *Service) LoadPatch( ctx context.Context, opened Opened, revision *Revision, request change.PatchRequest, ) (change.PatchResult, error)
LoadPatch loads and prepares a patch without scheduler integration.
func (*Service) LoadSyntax ¶
func (service *Service) LoadSyntax( ctx context.Context, opened Opened, revision *Revision, request change.SyntaxRequest, ) (change.SyntaxResult, error)
LoadSyntax loads syntax without scheduler integration.
func (*Service) LoadSyntaxWithCPUAdmission ¶
func (service *Service) LoadSyntaxWithCPUAdmission( ctx context.Context, opened Opened, revision *Revision, request change.SyntaxRequest, runCPU CPUAdmission, ) (change.SyntaxResult, error)
LoadSyntaxWithCPUAdmission acquires Git blobs outside CPU admission and prepares each acquired blob synchronously under admission.
func (*Service) Open ¶
func (service *Service) Open( ctx context.Context, request OpenRequest, ) (Opened, *Revision, error)
Open performs the open operation.
func (*Service) Publish ¶
func (service *Service) Publish( ctx context.Context, checked *change.CheckedPublication, ) PublicationCommit
Publish performs the publish operation.
func (*Service) ReconcilePublication ¶
func (service *Service) ReconcilePublication( ctx context.Context, request change.ReconciliationRequest, ) change.ReconciliationResult
ReconcilePublication performs the reconcile publication operation.
func (*Service) Reload ¶
func (service *Service) Reload( ctx context.Context, opened Opened, revision *Revision, options OpenOptions, runCPU CPUAdmission, ) (Opened, *Revision, error)
Reload performs the reload operation.
func (*Service) RepositoryRoot ¶
func (service *Service) RepositoryRoot(ctx context.Context) (RepositoryPath, error)
RepositoryRoot returns the descriptor-discovered repository root.
type ServiceOptions ¶
type ServiceOptions struct {
GitHubToken *GitHubToken
GitConfigHome *GitConfigPath
GlobalGitConfigs []GitConfigPath
}
ServiceOptions contains the complete process-derived configuration admitted into source. The service never reads ambient credentials or environment.
type SourceKind ¶
type SourceKind string
SourceKind describes source kind.
const ( SourceLocalWorktree SourceKind = "local-worktree" SourceLocalStaged SourceKind = "local-staged" SourceLocalRange SourceKind = "local-range" SourceGitHubPR SourceKind = "github-pr" )
SourceLocalWorktree identifies a supported source local worktree value.
type SyntaxAcquisition ¶
type SyntaxAcquisition struct {
// contains filtered or unexported fields
}
SyntaxAcquisition owns one Git blob until CPU preparation completes.
func (*SyntaxAcquisition) Close ¶
func (acquisition *SyntaxAcquisition) Close()
Close releases an unprepared blob.
func (*SyntaxAcquisition) Finish ¶
func (acquisition *SyntaxAcquisition) Finish( ctx context.Context, runCPU CPUAdmission, ) (*change.PreparedSyntax, error)
Finish consumes a blob and performs only cancellable CPU preparation.
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
Target represents target.
func NewPullRequestTarget ¶
func NewPullRequestTarget(selector PullRequestSelector) (Target, error)
NewPullRequestTarget constructs and validates pull request target.
func NewRangeTarget ¶
NewRangeTarget constructs and validates range target.
func WorktreeTarget ¶
func WorktreeTarget() Target
WorktreeTarget performs the worktree target operation.
func (Target) PullRequest ¶
func (target Target) PullRequest() (PullRequestSelector, bool)
PullRequest returns the receiver's pull request value.
func (Target) Range ¶
func (target Target) Range() (base, head RevisionRef, ok bool)
Range returns the receiver's range value.
type TargetKind ¶
type TargetKind uint8
TargetKind describes target kind.
const ( TargetWorktree TargetKind = iota + 1 TargetStaged TargetRange TargetPullRequest )
TargetWorktree identifies a supported target worktree value.
type WorkingDirectory ¶
type WorkingDirectory string
WorkingDirectory represents working directory.
func NewWorkingDirectory ¶
func NewWorkingDirectory(value string) (WorkingDirectory, error)
NewWorkingDirectory constructs and validates working directory.
func (WorkingDirectory) String ¶
func (directory WorkingDirectory) String() string
String returns the receiver's string value.
Source Files
¶
- cpu.go
- diff.go
- document.go
- failure.go
- filter.go
- filter_matcher.go
- github_client.go
- github_http.go
- github_remote.go
- github_spool.go
- index_stream.go
- json_builder.go
- json_comments.go
- json_decode.go
- json_framer.go
- json_path.go
- json_pending_comments.go
- json_pending_review.go
- json_pr.go
- json_stream.go
- json_threads.go
- ledger.go
- materialize.go
- native_alternates.go
- native_attributes.go
- native_config.go
- native_content.go
- native_conversion_stream.go
- native_diff_disk.go
- native_diff_kernel.go
- native_local.go
- native_object.go
- native_patch.go
- native_policy.go
- native_pr.go
- native_similarity.go
- native_tracked_paths.go
- native_worktree_capture.go
- native_worktree_walk.go
- pending.go
- pending_execution.go
- pending_publication.go
- pending_reconciliation.go
- pending_wire.go
- pr.go
- publication.go
- publication_history.go
- publication_history_radix.go
- read_only_billy.go
- repository_discovery.go
- repository_realpath_linux.go
- repository_root.go
- service.go
- service_options.go
- smart_git.go
- target.go
- threads.go