Carry module identity through candidate results

This commit is contained in:
2026-10-10 02:15:13 +00:00
parent f99fb59cd4
commit 3e516d0ac1
13 changed files with 229 additions and 58 deletions

View File

@@ -40,6 +40,10 @@ const (
// PublicationResult describes the publication state reached by this call.
type PublicationResult struct {
RepositoryDir string // absolute source repository path.
ModuleDir string // absolute selected module directory.
ModulePath string // selected module's declared Go path.
Tag string // complete selected Git tag.
Version string // selected stable version
CandidateCommit string // captured main commit
Endpoint string // captured effective push URL
@@ -75,6 +79,7 @@ func Publish(ctx context.Context, request ReleaseRequest) (PublicationResult, er
candidateInput := candidateRequest(request)
result, err := publish.Publish(ctx, publish.Request{
RepositoryDir: candidateInput.RepositoryDir,
ModuleDir: candidateInput.ModuleDir,
Product: candidateInput.Product,
Version: candidateInput.Version,
Remote: request.Remote,
@@ -85,6 +90,10 @@ func Publish(ctx context.Context, request ReleaseRequest) (PublicationResult, er
Output: candidateInput.Output,
})
return PublicationResult{
RepositoryDir: result.RepositoryDir,
ModuleDir: result.ModuleDir,
ModulePath: result.ModulePath,
Tag: result.Tag,
Version: result.Version,
CandidateCommit: result.CandidateCommit,
Endpoint: result.Endpoint,