refactor(commands): inline embedded .md help text and forbid the pattern
What does this MR do and why?
Four commands were sourcing cobra Long/Example help from sidecar .md files via //go:embed:
internal/cmdutils/pipeline_inputs.md(shared byglab ci runandglab ci run-trig)internal/commands/cluster/graph/long.mdinternal/commands/project/members/add/long.mdinternal/commands/project/members/add/example.md
Every other command in the repo (hundreds of them) inlines help text via heredoc.Doc(...). The two files that started using the sidecar pattern landed independently and never turned into a convention.
The sidecar pattern also fell outside CI's markdown-lint glob (docs/**/*.md + repo-root *.md), so files like these silently accumulated MD041 (missing-first-line-heading) and other violations that only surface intermittently in local lefthook run pre-push when the file happens to appear in {push_files}. That's how !3725 (merged) got blocked by a lint failure on a file it didn't touch.
Changes
- Inline all four sidecars into their respective command Go sources via
heredoc.Doc— the same pattern used everywhere else. Delete the.mdfiles and drop_ "embed"imports. - Add
make check-embed— agrepguard that fails if any.gofile underinternal/re-introduces//go:embed <name>.md. Wired intomake checkand lefthook'spre-push. - Document the rule as item 27 in the
Command documentationblock of.gitlab/duo/mr-review-instructions.yamlunder a newHelp text sources:subheading, so GitLab Duo Code Review also flags future occurrences.
Test plan
-
make checkpasses (4474 tests, 0 lint issues,check-embedclean). - Regex boundary check: matches
//go:embed foo.mdbut not//go:embed foo.md.txt,//go:embed all:assets, or//go:embed registry.yaml. - Regenerated
docs/source/repo/members/add.md(single trailing blank line inExampleblock — natural output ofheredoc.Docwithout the removedstrings.Trim). - Post-merge: !3725 (merged) merges main to pick up the deletions, then its
long.md‑blocked pre-push clears cleanly.
Follow-up
Once this lands, !3725 (Snap keyring hint) re-merges main to inherit the deleted sidecar files, which unblocks its pre-push pipeline.