sticky

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildUpdatedBody

func BuildUpdatedBody(oldBody, newBody string, cfg Config) string

BuildUpdatedBody collapses the old comment body into a flat list of <details> blocks and prepends the new body. Footer content (delimited by FooterMarker) is stripped before collapsing and re-appended after.

func FindMarkedComment

func FindMarkedComment(comments []forge.IssueComment, marker, botUser string) *forge.IssueComment

FindMarkedComment returns the first comment whose body contains the given marker string, or nil if none is found. When botUser is non-empty, only comments authored by that user are considered. This prevents untrusted users from spoofing the marker in their own comments.

func Post

func Post(ctx context.Context, client forge.Client, owner, repo string, number int, body string, cfg Config, printer *ui.Printer) (string, error)

Post implements the sticky comment lifecycle: find an existing comment bearing the marker, collapse old content into history, and create or update in-place. Returns the HTML URL of the comment (empty on dry run).

func TruncateBody

func TruncateBody(body string, maxSize int) string

TruncateBody trims body to fit within maxSize, keeping the current content at the top and trimming history from the end. The truncation point is aligned to a valid UTF-8 boundary.

Types

type Config

type Config struct {
	Marker       string // hidden HTML comment, e.g. "<!-- fullsend:review-agent -->"
	FooterMarker string // optional footer delimiter, stripped before collapsing history
	MaxSize      int    // max comment body size (default 65000)
	DryRun       bool
}

Config controls how a sticky comment is identified and managed.

Jump to

Keyboard shortcuts

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