task

package
v0.0.0-...-b37bb4a Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StdDateFormat         = "2006-01-02"
	RedirectsFile         = "data/redirects.yaml"
	ExtensionPeriodMonths = 9
	GitLabDocsPrefix      = "https://docs.gitlab.com"
	GitLabDocsLocalPrefix = "http://localhost:1313"
	DefaultRepoURL        = "git@gitlab.com:gitlab-org/technical-writing/docs-gitlab-com.git"
	ProductMRLabels       = "Technical Writing,documentation,maintenance::refactor,type::maintenance"
	DocsMRLabels          = "redirects,Technical Writing,Category:Docs Site,maintenance::refactor,type::maintenance"
)
View Source
const ARCHIVES_PROJECT_ID = "39455850"

ID of https://gitlab.com/gitlab-org/gitlab-docs-archives

Variables

View Source
var DateRegex = regexp.MustCompile(`start_remove.*?remove_date:\s*['"](\d{4}-\d{2}-\d{2})['"]`)
View Source
var EnvVars = map[string]string{"LEFTHOOK": "0"}

Environment variables for the git commands that stage, commit, and push remote changes "LEFTHOOK": "0" - disables LEFTHOOK jobs

View Source
var ErrCreationCancelled = errors.New("operation cancelled by user")
View Source
var ErrNoBranchName = errors.New("no branch name could be determined")
View Source
var TargetLanguages = []string{"fr-fr", "ja-jp", "ko-kr"}

TargetLanguages The list of languages to iterate through. Important: Keep this sorted

Functions

func CleanupRedirects

func CleanupRedirects(issueNumber string)

Cleans up expired redirect URLs from redirects.yaml and creates MR with the updated file. Additonally, removes expired files and creates MRs in their respective repositories.

func CreateMermaidTestPage

func CreateMermaidTestPage()

func CreateReleaseMergeRequest

func CreateReleaseMergeRequest(version string)

func CreateReleaseStableBranch

func CreateReleaseStableBranch(branch string)

func FindExpiredContent

func FindExpiredContent()

func FindUnusedImages

func FindUnusedImages(cmd *cobra.Command) (int, error)

FindUnusedImages implements the find-unused-images command

func LintMarkdownEOLSpaces

func LintMarkdownEOLSpaces(issueNumber string)

func PrintSearchResults

func PrintSearchResults(results []SearchResult)

func SelectReviewLanguages

func SelectReviewLanguages() error

SelectReviewLanguages picks which target language(s) to build for the upstream review app pipeline by updating config/translation/hugo.yaml

func UpdateArchives

func UpdateArchives(branch string)

Types

type ExpiredContent

type ExpiredContent struct {
	Filename   string
	LineNum    int
	ProductID  string
	RemoveDate string
	LineText   string
}

ExpiredContent represents content that should be removed based on the date

type FileData

type FileData struct {
	Filename   string
	RemoveDate string
	RedirectTo string
}

type FrontmatterData

type FrontmatterData struct {
	RemoveDate string `yaml:"remove_date"`
	RedirectTo string `yaml:"redirect_to"`
}

type ImageInfo

type ImageInfo struct {
	FilePath     string
	RelativePath string
	Filename     string
	Used         bool
	Directory    string
}

ImageInfo holds information about an image file

type Redirect

type Redirect struct {
	From       string `yaml:"from"`
	To         string `yaml:"to"`
	RemoveDate string `yaml:"remove_date"`
}

type Redirects

type Redirects struct {
	Redirects []Redirect `yaml:"redirects"`
}

type SearchResult

type SearchResult struct {
	Filename  string
	LineNum   int
	LineText  string
	ProductID string
}

SearchResult represents a search match

func SearchMarkdownFiles

func SearchMarkdownFiles(searchPattern string) ([]SearchResult, error)

SearchMarkdownFiles searches for a given pattern in markdown files across all product repos

type URL

type URL struct {
	Loc string `xml:"loc"`
}

URL represents each url element

type URLSet

type URLSet struct {
	XMLName xml.Name `xml:"urlset"`
	URLs    []URL    `xml:"url"`
}

URL represents each URL entry in the sitemap with xhtml:link support URLSet represents the root urlset element

type Version

type Version struct {
	Next      string   `json:"next"`
	Current   string   `json:"current"`
	LastMinor []string `json:"last_minor"`
	LastMajor []string `json:"last_major"`
}

Jump to

Keyboard shortcuts

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