fix(controlplane): report watch outages and align live/restart kind labels
This commit is contained in:
1 parent
9b30e671dd
commit
2851b4352a
8 files changed
+567
-287
No files matched your search
@@ -252,8 +252,16 @@ func (b *boot) startLiveSettings(ctx context.Context) error {
|
||||
// requiring a restart. ChannelSettingsKind is on the list for this process's
|
||||
// own re-layer; the Messaging Service, which owns the channel transports,
|
||||
// reconciles them separately and restarts only the channel whose settings
|
||||
// changed. Each kind is watched in its own goroutine, exactly the shape the
|
||||
// workflow-execution-settings watch established.
|
||||
// changed, and the Gateway's chat surfaces stay boot-built, so the kind is
|
||||
// labelled restart-required. AgentProfilesKind is on it because a task's
|
||||
// profile is resolved per task from the published config (daemon.pinTaskProfile,
|
||||
// like the container pool's per-acquire read), so a stored change reaches the
|
||||
// next task without a restart. PluginSettingsKind stays on the list to keep
|
||||
// its one field, skills_dir, out of the republished config while the running
|
||||
// directory consumers hold the boot value: the watch refuses such a change
|
||||
// rather than layering it (refuseSkillsDirChange), so the kind is labelled
|
||||
// restart-required. Each kind is watched in its own goroutine, exactly the
|
||||
// shape the workflow-execution-settings watch established.
|
||||
var runtimeResourceKinds = []string{
|
||||
controlplane.ProviderSettingsKind,
|
||||
controlplane.ModelRoleAssignmentsKind,
|
||||
@@ -266,6 +274,7 @@ var runtimeResourceKinds = []string{
|
||||
controlplane.ContainerRuntimePoliciesKind,
|
||||
controlplane.CredentialBindingsKind,
|
||||
controlplane.IdentityGrantsKind,
|
||||
controlplane.AgentProfileKind,
|
||||
}
|
||||
|
||||
// startRuntimeResourceWatches keeps a watch per live kind established for the
|
||||
@@ -280,13 +289,51 @@ func (b *boot) startRuntimeResourceWatches(ctx context.Context, versions map[str
|
||||
if err != nil {
|
||||
return fmt.Errorf("watch %s: %w", kind, err)
|
||||
}
|
||||
var lastApplyErr, streamErr error
|
||||
open := func(ctx context.Context, afterVersion int64) (<-chan controlplane.AppliedResource, error) {
|
||||
next, err := b.controlPlane.WatchResource(ctx, kind, afterVersion)
|
||||
if err == nil {
|
||||
// A live watch is re-established: the outage clears, and an
|
||||
// outstanding refusal stays the record's error.
|
||||
b.applyStatus.Report(ctx, kind, afterVersion, lastApplyErr)
|
||||
}
|
||||
return next, err
|
||||
}
|
||||
go servicekit.KeepWatch(ctx, b.log, kind, versions[kind], updates,
|
||||
func(ctx context.Context, afterVersion int64) (<-chan controlplane.AppliedResource, error) {
|
||||
return b.controlPlane.WatchResource(ctx, kind, afterVersion)
|
||||
},
|
||||
open,
|
||||
servicekit.WaitFor,
|
||||
func(update controlplane.AppliedResource) int64 { return update.Version },
|
||||
func(update controlplane.AppliedResource) { b.applyRuntimeResourceUpdate(ctx, kind, update) })
|
||||
func(update controlplane.AppliedResource) {
|
||||
if update.Err != nil {
|
||||
// A stream failure carries no version at all, and a process
|
||||
// must never report an unreachable store as its own
|
||||
// refusal: the outage is what the end callback records.
|
||||
if update.Version > 0 {
|
||||
lastApplyErr = update.Err
|
||||
b.applyStatus.Report(ctx, kind, update.Version, update.Err)
|
||||
} else {
|
||||
streamErr = update.Err
|
||||
}
|
||||
b.log.Error("runtime settings watch failed", "kind", kind, "err", update.Err)
|
||||
return
|
||||
}
|
||||
lastApplyErr = b.applyRuntimeResourceUpdate(ctx, kind, update)
|
||||
},
|
||||
func() {
|
||||
// A refusal already on the record outranks the outage; it is the
|
||||
// state the running settings are actually in. Otherwise the gap is
|
||||
// reported so the record stops reading the last-applied version as
|
||||
// current while no live updates can arrive.
|
||||
if lastApplyErr != nil {
|
||||
return
|
||||
}
|
||||
if streamErr == nil {
|
||||
streamErr = fmt.Errorf("control-plane watch stream ended")
|
||||
}
|
||||
b.applyStatus.Report(ctx, kind, 0,
|
||||
fmt.Errorf("runtime settings watch unavailable: %w", streamErr))
|
||||
streamErr = nil
|
||||
})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -305,23 +352,17 @@ func (b *boot) startRuntimeResourceWatches(ctx context.Context, versions map[str
|
||||
// the previous settings keep running (last-known-good), and the failure is
|
||||
// reported through apply status, which keeps the version still live on the
|
||||
// record. A refused update therefore reaches the settings page the way a
|
||||
// refused workflow-execution-settings update does
|
||||
func (b *boot) applyRuntimeResourceUpdate(ctx context.Context, kind string, update controlplane.AppliedResource) {
|
||||
if update.Err != nil {
|
||||
// A stream failure carries no version at all (versions start at 1,
|
||||
// store.PutResource), and a process must never report an unreachable
|
||||
// store as its own refusal; the reconnect is servicekit.KeepWatch's business.
|
||||
if update.Version > 0 {
|
||||
b.applyStatus.Report(ctx, kind, update.Version, update.Err)
|
||||
}
|
||||
b.log.Error("runtime settings watch failed", "kind", kind, "err", update.Err)
|
||||
return
|
||||
}
|
||||
// refused workflow-execution-settings update does.
|
||||
//
|
||||
// The returned error is the refusal or rejection, for the watch to keep as
|
||||
// lastApplyErr: it is what keeps the outage callback from overwriting a
|
||||
// refusal the record already shows with a transport gap.
|
||||
func (b *boot) applyRuntimeResourceUpdate(ctx context.Context, kind string, update controlplane.AppliedResource) error {
|
||||
if kind == controlplane.PluginSettingsKind {
|
||||
if err := b.refuseSkillsDirChange(ctx); err != nil {
|
||||
b.applyStatus.Report(ctx, kind, update.Version, err)
|
||||
b.log.Error("plugin settings refused; the running settings stay", "version", update.Version, "err", err)
|
||||
return
|
||||
return err
|
||||
}
|
||||
}
|
||||
base := b.cfgHolder.Get()
|
||||
@@ -336,7 +377,7 @@ func (b *boot) applyRuntimeResourceUpdate(ctx context.Context, kind string, upda
|
||||
// runtimeConfig reported the refusal through apply status for every
|
||||
// kind it layers, keeping the version each of them last applied.
|
||||
b.log.Error("runtime settings update rejected; the running settings stay", "kind", kind, "version", update.Version, "err", err)
|
||||
return
|
||||
return err
|
||||
}
|
||||
b.publishConfig(ctx, cfg)
|
||||
b.log.Info("runtime settings applied", "kind", kind, "version", update.Version)
|
||||
@@ -346,6 +387,7 @@ func (b *boot) applyRuntimeResourceUpdate(ctx context.Context, kind string, upda
|
||||
// lower must be honoured as running tasks finish.
|
||||
b.resizeTaskDispatcher(cfg.Containers.MaxConcurrency)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// resizeTaskDispatcher applies a new containers.max_concurrency to the
|
||||
|
||||
@@ -3,6 +3,7 @@ package archiegateway
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/agentexec/modelloop"
|
||||
"github.com/samcharles93/archie-core/internal/app/chattask"
|
||||
@@ -46,6 +47,7 @@ func (b *server) setupChatRuntime(ctx context.Context, cfg config.Config, actor
|
||||
}
|
||||
b.personas = gateway.NewPersonaRegistry(nil)
|
||||
b.applyPersonas(personas, version)
|
||||
b.applyStatus.Report(ctx, controlplane.PersonasKind, version, nil)
|
||||
if err := b.watchPersonas(ctx, version); err != nil {
|
||||
return fmt.Errorf("watch personas: %w", err)
|
||||
}
|
||||
@@ -59,6 +61,7 @@ func (b *server) setupChatRuntime(ctx context.Context, cfg config.Config, actor
|
||||
}
|
||||
b.soul = newSoulSource(b.cfgPath, b.log)
|
||||
b.applySoul(soul, version)
|
||||
b.applyStatus.Report(ctx, controlplane.SoulKind, version, nil)
|
||||
if err := b.watchSoul(ctx, version); err != nil {
|
||||
return fmt.Errorf("watch soul: %w", err)
|
||||
}
|
||||
@@ -87,11 +90,6 @@ func (b *server) setupChatRuntime(ctx context.Context, cfg config.Config, actor
|
||||
return nil
|
||||
}
|
||||
|
||||
// watchPersonas keeps the persona stream established for the life of the
|
||||
// process. The first stream is opened synchronously, so a control plane that
|
||||
// cannot be watched at all fails the boot that asked for it rather than
|
||||
// leaving the process running personas it can no longer update; after that the
|
||||
// watch reconnects instead of ending (see servicekit.KeepWatch).
|
||||
// setupChatTasks wires the task creator chat commands and scheduled workflows
|
||||
// enqueue through.
|
||||
func (b *server) setupChatTasks(cfg config.Config) {
|
||||
@@ -105,21 +103,77 @@ func (b *server) setupChatTasks(cfg config.Config) {
|
||||
b.defaultChatIdentity = defaultChatIdentity
|
||||
}
|
||||
|
||||
// watchStatus is KeepWatch carrying the outage bookkeeping: an applied
|
||||
// refusal becomes the record's error, a stream failure and a stream end
|
||||
// report the gap, and a re-established watch clears it, so a record never
|
||||
// reads the boot version as current while no live updates can arrive.
|
||||
func watchStatus[T any](
|
||||
ctx context.Context,
|
||||
report func(ctx context.Context, kind string, version int64, err error),
|
||||
log *slog.Logger,
|
||||
kind, label string, version int64, updates <-chan T,
|
||||
open func(ctx context.Context, after int64) (<-chan T, error),
|
||||
versionOf func(T) int64,
|
||||
errOf func(T) error,
|
||||
deliver func(T),
|
||||
) {
|
||||
var lastApplyErr, streamErr error
|
||||
watchOpen := func(ctx context.Context, after int64) (<-chan T, error) {
|
||||
next, err := open(ctx, after)
|
||||
if err == nil {
|
||||
report(ctx, kind, after, lastApplyErr)
|
||||
}
|
||||
return next, err
|
||||
}
|
||||
go servicekit.KeepWatch(ctx, log, kind, version, updates,
|
||||
watchOpen,
|
||||
servicekit.WaitFor,
|
||||
versionOf,
|
||||
func(update T) {
|
||||
if err := errOf(update); err != nil {
|
||||
if v := versionOf(update); v > 0 {
|
||||
lastApplyErr = err
|
||||
report(ctx, kind, v, err)
|
||||
} else {
|
||||
streamErr = err
|
||||
}
|
||||
log.Error("control-plane watch failed", "kind", kind, "err", err)
|
||||
return
|
||||
}
|
||||
deliver(update)
|
||||
},
|
||||
func() {
|
||||
// A refusal already on the record outranks the outage; it is the
|
||||
// state the settings are actually in.
|
||||
if lastApplyErr != nil {
|
||||
return
|
||||
}
|
||||
if streamErr == nil {
|
||||
streamErr = fmt.Errorf("control-plane watch stream ended")
|
||||
}
|
||||
report(ctx, kind, 0, fmt.Errorf("%s watch unavailable: %w", label, streamErr))
|
||||
streamErr = nil
|
||||
})
|
||||
}
|
||||
|
||||
// watchPersonas keeps the persona stream established for the life of the
|
||||
// process. The first stream is opened synchronously, so a control plane that
|
||||
// cannot be watched at all fails the boot that asked for it rather than
|
||||
// leaving the process running personas it can no longer update; after that the
|
||||
// watch reconnects instead of ending (see servicekit.KeepWatch).
|
||||
func (b *server) watchPersonas(ctx context.Context, version int64) error {
|
||||
updates, err := b.controlPlane.WatchPersonas(ctx, version)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
go servicekit.KeepWatch(ctx, b.log, controlplane.PersonasKind, version, updates,
|
||||
watchStatus(ctx, b.applyStatus.Report, b.log,
|
||||
controlplane.PersonasKind, "personas", version, updates,
|
||||
b.controlPlane.WatchPersonas,
|
||||
servicekit.WaitFor,
|
||||
func(update controlplane.AppliedPersonas) int64 { return update.Version },
|
||||
func(update controlplane.AppliedPersonas) error { return update.Err },
|
||||
func(update controlplane.AppliedPersonas) {
|
||||
if update.Err != nil {
|
||||
b.log.Error("persona watch failed", "err", update.Err)
|
||||
return
|
||||
}
|
||||
b.applyPersonas(update.Collection, update.Version)
|
||||
b.applyStatus.Report(ctx, controlplane.PersonasKind, update.Version, nil)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
@@ -134,22 +188,21 @@ func (b *server) applyPersonas(collection agent.PersonaCollection, version int64
|
||||
}
|
||||
|
||||
// watchSoul keeps the soul stream established for the life of the process, so
|
||||
// a dashboard edit reaches the next turn without a restart.
|
||||
// a dashboard edit reaches the next turn without a restart. The stream rides
|
||||
// the same outage bookkeeping as personas (watchStatus).
|
||||
func (b *server) watchSoul(ctx context.Context, version int64) error {
|
||||
updates, err := b.controlPlane.WatchSoul(ctx, version)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
go servicekit.KeepWatch(ctx, b.log, controlplane.SoulKind, version, updates,
|
||||
watchStatus(ctx, b.applyStatus.Report, b.log,
|
||||
controlplane.SoulKind, "soul", version, updates,
|
||||
b.controlPlane.WatchSoul,
|
||||
servicekit.WaitFor,
|
||||
func(update controlplane.AppliedSoul) int64 { return update.Version },
|
||||
func(update controlplane.AppliedSoul) error { return update.Err },
|
||||
func(update controlplane.AppliedSoul) {
|
||||
if update.Err != nil {
|
||||
b.log.Error("soul watch failed", "err", update.Err)
|
||||
return
|
||||
}
|
||||
b.applySoul(update.Soul, update.Version)
|
||||
b.applyStatus.Report(ctx, controlplane.SoulKind, update.Version, nil)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package archiegateway
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net"
|
||||
@@ -270,7 +271,9 @@ func (b *server) startModelCatalogRefresh(ctx context.Context) {
|
||||
base := b.cfgHolder.Get().Clone()
|
||||
models := modelcatalog.Apply(&base, snapshot)
|
||||
b.catalog.Set(snapshot, models)
|
||||
b.relayer(ctx, base, "")
|
||||
if err := b.relayer(ctx, base, ""); err != nil {
|
||||
b.log.Warn("model catalog refresh rejected with the settings; the running settings stay", "err", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -288,21 +291,53 @@ func (b *server) startRuntimeWatches(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("watch %s: %w", kind, err)
|
||||
}
|
||||
var lastApplyErr, streamErr error
|
||||
open := func(ctx context.Context, afterVersion int64) (<-chan controlplane.AppliedResource, error) {
|
||||
next, err := b.controlPlane.WatchResource(ctx, kind, afterVersion)
|
||||
if err == nil {
|
||||
// A live watch is re-established: the outage clears, and an
|
||||
// outstanding refusal stays the record's error.
|
||||
b.applyStatus.Report(ctx, kind, afterVersion, lastApplyErr)
|
||||
}
|
||||
return next, err
|
||||
}
|
||||
go servicekit.KeepWatch(ctx, b.log, kind, b.runtimeVersions[kind], updates,
|
||||
func(ctx context.Context, afterVersion int64) (<-chan controlplane.AppliedResource, error) {
|
||||
return b.controlPlane.WatchResource(ctx, kind, afterVersion)
|
||||
},
|
||||
open,
|
||||
servicekit.WaitFor,
|
||||
func(update controlplane.AppliedResource) int64 { return update.Version },
|
||||
func(update controlplane.AppliedResource) {
|
||||
if update.Err != nil {
|
||||
// A stream failure carries no version: the outage is what the
|
||||
// end callback records. A refused document carries its version
|
||||
// and becomes the record's error.
|
||||
if update.Version > 0 {
|
||||
lastApplyErr = update.Err
|
||||
b.applyStatus.Report(ctx, kind, update.Version, update.Err)
|
||||
} else {
|
||||
streamErr = update.Err
|
||||
}
|
||||
b.log.Error("runtime settings watch failed", "kind", kind, "err", update.Err)
|
||||
return
|
||||
}
|
||||
base := b.cfgHolder.Get()
|
||||
catalog, _ := b.catalogState()
|
||||
modelcatalog.Apply(&base, catalog)
|
||||
b.relayer(ctx, base, kind)
|
||||
lastApplyErr = b.relayer(ctx, base, kind)
|
||||
},
|
||||
func() {
|
||||
// A refusal already on the record outranks the outage; it is the
|
||||
// state the running settings are actually in. Otherwise the gap is
|
||||
// reported so the record stops reading the last-applied version as
|
||||
// current while no live updates can arrive.
|
||||
if lastApplyErr != nil {
|
||||
return
|
||||
}
|
||||
if streamErr == nil {
|
||||
streamErr = fmt.Errorf("control-plane watch stream ended")
|
||||
}
|
||||
b.applyStatus.Report(ctx, kind, 0,
|
||||
fmt.Errorf("runtime settings watch unavailable: %w", streamErr))
|
||||
streamErr = nil
|
||||
})
|
||||
}
|
||||
return nil
|
||||
@@ -310,19 +345,23 @@ func (b *server) startRuntimeWatches(ctx context.Context) error {
|
||||
|
||||
// relayer re-runs the runtime layering over base and applies the result to the
|
||||
// chat runtime and, for tool settings, the tool providers. A refused document
|
||||
// leaves the running settings in place.
|
||||
func (b *server) relayer(ctx context.Context, base config.Config, kind string) {
|
||||
// leaves the running settings in place and its error returned, so the watch
|
||||
// keeps it as lastApplyErr rather than recording an outage over it.
|
||||
func (b *server) relayer(ctx context.Context, base config.Config, kind string) error {
|
||||
cfg, versions, err := b.runtimeConfig(ctx, base)
|
||||
if err != nil {
|
||||
b.log.Error("runtime settings update rejected; the running settings stay", "kind", kind, "err", err)
|
||||
return
|
||||
return err
|
||||
}
|
||||
b.cfgHolder.Set(cfg)
|
||||
b.rebuildChatModelRuntime(cfg)
|
||||
var problems []error
|
||||
if kind == controlplane.ToolSettingsKind {
|
||||
if err := b.reconcileToolSettings(ctx, cfg); err != nil {
|
||||
b.applyStatus.Report(ctx, kind, versions[kind], err)
|
||||
b.log.Error("tool settings reconciled with errors; the running servers stay", "err", err)
|
||||
problems = append(problems, err)
|
||||
}
|
||||
}
|
||||
return errors.Join(problems...)
|
||||
}
|
||||
@@ -35,16 +35,23 @@ type pluginSettings struct {
|
||||
func operationalDefinitions() []Definition {
|
||||
return []Definition{
|
||||
{Kind: RepositoryPoliciesKind, Title: "Repository policies", ApplyMode: "live", Document: []config.Repo{}, Seed: func(cfg config.Config) any { return cfg.Repos }, Validate: validateRepositories},
|
||||
{Kind: ChannelSettingsKind, Title: "Channel settings", ApplyMode: "live", Document: channelSettings{}, Seed: seedChannels, Validate: validateChannels, Normalize: normalizeChannels},
|
||||
// Restart-required: the Messaging Service, which owns the channel
|
||||
// transports, reconciles them live and archied re-layers each update, but
|
||||
// the Gateway's chat surfaces (workspace tools, rate limit, model
|
||||
// catalogs) are boot-built, so a change cannot promise live apply
|
||||
// everywhere the record reports it.
|
||||
{Kind: ChannelSettingsKind, Title: "Channel settings", ApplyMode: "restart-required", Document: channelSettings{}, Seed: seedChannels, Validate: validateChannels, Normalize: normalizeChannels},
|
||||
{Kind: SchedulingPolicyKind, Title: "Scheduling policy", ApplyMode: "live", Document: schedulingPolicy{}, Seed: func(cfg config.Config) any {
|
||||
return schedulingPolicy{PollInterval: cfg.PollInterval.Std().String(), MaxRetries: cfg.MaxRetries, Label: &cfg.Label, Dispatch: cfg.Dispatch}
|
||||
}, Validate: validateScheduling},
|
||||
// Live: changed MCP servers are reconnected, rolling back to the old engine
|
||||
// if the new one fails to start.
|
||||
{Kind: ToolSettingsKind, Title: "Tool and MCP settings", ApplyMode: "live", Document: toolSettings{}, Seed: seedTools, Validate: validateTools},
|
||||
// The one field, skills_dir, is read at boot: a stored value that differs
|
||||
// from the running one is refused until restart (refuseSkillsDirChange).
|
||||
{Kind: PluginSettingsKind, Title: "Plugin settings", ApplyMode: "live", Document: pluginSettings{}, Seed: func(cfg config.Config) any {
|
||||
// Restart-required: the one field, skills_dir, is read at boot, and the
|
||||
// watch refuses a change rather than layering it into the running config
|
||||
// while the boot-built consumers hold the old value
|
||||
// (refuseSkillsDirChange).
|
||||
{Kind: PluginSettingsKind, Title: "Plugin settings", ApplyMode: "restart-required", Document: pluginSettings{}, Seed: func(cfg config.Config) any {
|
||||
return pluginSettings{cfg.SkillsDir}
|
||||
}, Validate: validatePluginSettings},
|
||||
// Live: each process that supervises extensions re-reads this on its sync
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -29,6 +29,7 @@ const (
|
||||
ForgeService_CreatePR_FullMethodName = "/forge.v1.ForgeService/CreatePR"
|
||||
ForgeService_PRState_FullMethodName = "/forge.v1.ForgeService/PRState"
|
||||
ForgeService_ClosePR_FullMethodName = "/forge.v1.ForgeService/ClosePR"
|
||||
ForgeService_MergePR_FullMethodName = "/forge.v1.ForgeService/MergePR"
|
||||
ForgeService_GetPullRequest_FullMethodName = "/forge.v1.ForgeService/GetPullRequest"
|
||||
ForgeService_GetPullRequestDiff_FullMethodName = "/forge.v1.ForgeService/GetPullRequestDiff"
|
||||
ForgeService_ListReviews_FullMethodName = "/forge.v1.ForgeService/ListReviews"
|
||||
@@ -65,6 +66,7 @@ type ForgeServiceClient interface {
|
||||
CreatePR(ctx context.Context, in *CreatePRRequest, opts ...grpc.CallOption) (*CreatePRResponse, error)
|
||||
PRState(ctx context.Context, in *PRStateRequest, opts ...grpc.CallOption) (*PRStateResponse, error)
|
||||
ClosePR(ctx context.Context, in *ClosePRRequest, opts ...grpc.CallOption) (*ClosePRResponse, error)
|
||||
MergePR(ctx context.Context, in *MergePRRequest, opts ...grpc.CallOption) (*MergePRResponse, error)
|
||||
GetPullRequest(ctx context.Context, in *GetPullRequestRequest, opts ...grpc.CallOption) (*GetPullRequestResponse, error)
|
||||
GetPullRequestDiff(ctx context.Context, in *GetPullRequestDiffRequest, opts ...grpc.CallOption) (*GetPullRequestDiffResponse, error)
|
||||
ListReviews(ctx context.Context, in *ListReviewsRequest, opts ...grpc.CallOption) (*ListReviewsResponse, error)
|
||||
@@ -190,6 +192,16 @@ func (c *forgeServiceClient) ClosePR(ctx context.Context, in *ClosePRRequest, op
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *forgeServiceClient) MergePR(ctx context.Context, in *MergePRRequest, opts ...grpc.CallOption) (*MergePRResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(MergePRResponse)
|
||||
err := c.cc.Invoke(ctx, ForgeService_MergePR_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *forgeServiceClient) GetPullRequest(ctx context.Context, in *GetPullRequestRequest, opts ...grpc.CallOption) (*GetPullRequestResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPullRequestResponse)
|
||||
@@ -332,6 +344,7 @@ type ForgeServiceServer interface {
|
||||
CreatePR(context.Context, *CreatePRRequest) (*CreatePRResponse, error)
|
||||
PRState(context.Context, *PRStateRequest) (*PRStateResponse, error)
|
||||
ClosePR(context.Context, *ClosePRRequest) (*ClosePRResponse, error)
|
||||
MergePR(context.Context, *MergePRRequest) (*MergePRResponse, error)
|
||||
GetPullRequest(context.Context, *GetPullRequestRequest) (*GetPullRequestResponse, error)
|
||||
GetPullRequestDiff(context.Context, *GetPullRequestDiffRequest) (*GetPullRequestDiffResponse, error)
|
||||
ListReviews(context.Context, *ListReviewsRequest) (*ListReviewsResponse, error)
|
||||
@@ -387,6 +400,9 @@ func (UnimplementedForgeServiceServer) PRState(context.Context, *PRStateRequest)
|
||||
func (UnimplementedForgeServiceServer) ClosePR(context.Context, *ClosePRRequest) (*ClosePRResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ClosePR not implemented")
|
||||
}
|
||||
func (UnimplementedForgeServiceServer) MergePR(context.Context, *MergePRRequest) (*MergePRResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method MergePR not implemented")
|
||||
}
|
||||
func (UnimplementedForgeServiceServer) GetPullRequest(context.Context, *GetPullRequestRequest) (*GetPullRequestResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPullRequest not implemented")
|
||||
}
|
||||
@@ -621,6 +637,24 @@ func _ForgeService_ClosePR_Handler(srv interface{}, ctx context.Context, dec fun
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ForgeService_MergePR_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MergePRRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ForgeServiceServer).MergePR(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ForgeService_MergePR_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ForgeServiceServer).MergePR(ctx, req.(*MergePRRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ForgeService_GetPullRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPullRequestRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -859,6 +893,10 @@ var ForgeService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "ClosePR",
|
||||
Handler: _ForgeService_ClosePR_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "MergePR",
|
||||
Handler: _ForgeService_MergePR_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPullRequest",
|
||||
Handler: _ForgeService_GetPullRequest_Handler,
|
||||
|
||||
@@ -34,14 +34,15 @@ const error = computed(() => store.stateFor(KIND).error);
|
||||
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">{{ catalogError || error }}</p>
|
||||
|
||||
<template v-if="dirs">
|
||||
<SettingRow label="Skills directory" for="pl-skills" hint="Empty: work directory.">
|
||||
<SettingRow label="Skills directory" for="pl-skills" hint="Empty: work directory. Applies on restart.">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<Input id="pl-skills" v-model="dirs.skills_dir" class="max-w-md font-mono" />
|
||||
<DraftHint :kind="KIND" path="skills_dir" />
|
||||
</div>
|
||||
</SettingRow>
|
||||
<!-- A live-apply kind earns no restart banner, so its per-process
|
||||
versions are where a process still on an older one shows. -->
|
||||
<!-- A restart-required kind can only be applied by a restart, so its
|
||||
per-process versions live below: a process on an older one is the
|
||||
restart owed. -->
|
||||
<ApplyStatusRows :kind="KIND" class="border-t border-border py-4" />
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -7,9 +7,10 @@ import { restartPendingTitles } from "./apply-status";
|
||||
const store = useControlPlaneStore();
|
||||
|
||||
// Read from what each process reports it is running, never from this page's
|
||||
// own saves: a restart that already happened clears it. Only a process-binding
|
||||
// change earns this banner; a live-apply kind reports its lag in its own
|
||||
// applied-version rows rather than here.
|
||||
// own saves: a restart that already happened clears it. A restart-required
|
||||
// kind earns this banner while some process still runs the version it had at
|
||||
// boot; a live-apply kind reports its lag in its own applied-version rows
|
||||
// rather than here.
|
||||
const pending = computed(() =>
|
||||
restartPendingTitles(store.genericResources, (kind) => store.applyStatusFor(kind)),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user