Make mdtogo an independent Go module#4587
Conversation
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Introduces a dedicated Go submodule for the mdtogo tool and updates build/install wiring to install it from its own module context.
Changes:
- Added
mdtogo/go.modandmdtogo/go.sumto definemdtogoas an independent Go module. - Updated the root
Makefileinstall target to rungo installfrom withinmdtogo/. - Refreshed root module dependency bookkeeping (
go.mod/go.sum) as part of the change.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| mdtogo/go.mod | Defines the new mdtogo submodule and its direct/indirect dependencies. |
| mdtogo/go.sum | Adds checksum entries for the new mdtogo submodule dependencies. |
| go.mod | Adjusts dependency classification/order (notably golang.org/x/text as indirect). |
| go.sum | Removes now-unneeded checksum entries after dependency tidy/update. |
| Makefile | Installs mdtogo by changing into the submodule directory before go install. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This is not just a problem with mdtogo, we have to remove the replace in order to make it "go install"-able |
Do we merge this anyway so? |
|
@efiacor |
Not sure, but I think the krm-fn builds/ci are broken given the api change. |
@efiacor / @mozesl-nokia krm-functions-catalog ci/local build is broken with the api change. Also this is a temporary fix only and can be removed once we phase out mdtogo. |
Description
After the
apimodule extraction, the rootgo.modcontains areplacedirective (github.com/kptdev/kpt/api => ./api).This breaks external installation of mdtogo package in the repository via
go install ...@mainbecause Go does not allowreplacedirectives in modules installed with a version query.This affects
krm-functions-catalog, which usesgo install github.com/kptdev/kpt/mdtogo@mainto generate function documentation.Since the
apisplit, that command fails with:mdtogohas no dependency on any other kpt package. it only usesgolang.org/x/textandtestify. Making it its own module allows externalgo installto resolve it independently of the rootgo.modand itsreplacedirectives.Changes
mdtogo/go.modandmdtogo/go.sum(new independent module)Makefileinstall target:go install ./mdtogo→cd mdtogo && go install .AI Disclosure