Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run: yes | m stable && dirname $(readlink $(which mongod)) > .metapath

- name: Build
run: go build main/migration_verifier.go
run: ./build.sh

- name: Start clusters
run: |-
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ _This Repository is NOT an officially supported MongoDB product. This tool reduc


```
go build main/migration_verifier.go
./build.sh
```



# Operational UX Once Running

_Assumes no port set, default port for operation webserver is 27020_
Expand Down
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

commit=$(git show --no-patch --format='%H')

go build -ldflags="-X 'main.Revision=$commit'" main/migration_verifier.go
14 changes: 11 additions & 3 deletions main/migration_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ const (
pprofInterval = "pprofInterval"
)

// This gets set at build time.
var Revision = "Unknown; build with build.sh."

func main() {
zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack

Expand Down Expand Up @@ -154,9 +157,10 @@ func main() {
}

app := &cli.App{
Name: "migration-verifier",
Usage: "verify migration correctness",
Flags: flags,
Name: "migration-verifier",
Usage: "verify migration correctness",
Version: Revision,
Flags: flags,
Before: func(cCtx *cli.Context) error {
confFile := cCtx.String(configFileFlag)

Expand Down Expand Up @@ -203,6 +207,10 @@ func handleArgs(ctx context.Context, cCtx *cli.Context) (*verifier.Verifier, err

v := verifier.NewVerifier(verifierSettings, logPath)

v.GetLogger().Info().
Str("revision", Revision).
Msg("migration-verifier started.")
Comment on lines +210 to +212
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to enforce it's built with revision string?


err := v.SetSrcURI(ctx, cCtx.String(srcURI))
if err != nil {
return nil, err
Expand Down
Loading