Adopt ReleaseKit runtime version and tool
This commit is contained in:
@@ -3,8 +3,8 @@ package app
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/buildinfo"
|
||||
"go.maximumdirect.net/commandkit"
|
||||
"go.maximumdirect.net/releasekit/buildinfo"
|
||||
)
|
||||
|
||||
// NewApplication constructs the native command boundary without acquiring configuration
|
||||
@@ -15,7 +15,7 @@ func NewApplication() (*commandkit.App, error) {
|
||||
|
||||
func newApplication(deps commandDependencies, executor pipelineExecutor) (*commandkit.App, error) {
|
||||
return commandkit.New(
|
||||
commandkit.Identity{Name: "narratio", Version: buildinfo.Version},
|
||||
commandkit.Identity{Name: "narratio", Version: buildinfo.Version()},
|
||||
commandkit.Completion("narratio"),
|
||||
commandkit.WithInvocationFeature(configurationCommand(deps), bootstrapFeature()),
|
||||
executionCommand("run", "Execute a session pipeline.", false, deps, executor),
|
||||
|
||||
@@ -7,14 +7,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/buildinfo"
|
||||
"go.maximumdirect.net/releasekit/buildinfo"
|
||||
)
|
||||
|
||||
func TestExecuteVersionReportsEmbeddedBuildVersion(t *testing.T) {
|
||||
original := buildinfo.Version
|
||||
buildinfo.Version = "v1.5.0-test"
|
||||
t.Cleanup(func() { buildinfo.Version = original })
|
||||
|
||||
func TestExecuteVersionReportsBuildVersion(t *testing.T) {
|
||||
var stdout bytes.Buffer
|
||||
var stderr bytes.Buffer
|
||||
if code := executeForTest([]string{"version", "--format", "json"}, &stdout, &stderr); code != 0 {
|
||||
@@ -27,7 +23,7 @@ func TestExecuteVersionReportsEmbeddedBuildVersion(t *testing.T) {
|
||||
if err := json.Unmarshal(stdout.Bytes(), &identity); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if identity.Name != "narratio" || identity.Version != buildinfo.Version {
|
||||
if identity.Name != "narratio" || identity.Version != buildinfo.Version() {
|
||||
t.Fatalf("version identity = %+v", identity)
|
||||
}
|
||||
if stderr.Len() != 0 {
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
// Package buildinfo exposes metadata supplied by the release build.
|
||||
package buildinfo
|
||||
|
||||
// Version is the Narratio release identifier. Source builds report "dev";
|
||||
// release automation replaces it with the exact Git tag through -ldflags -X.
|
||||
var Version = "dev"
|
||||
Reference in New Issue
Block a user