Skip to content

Makefile release target and README refresh for the one-way dependency #12

Description

@TopherGopher

Part of the easymongo refactor (see PLAN.md on the refactor branch).

Working context (read this first)

Scope

  • Makefile: the release target currently edits ../mongotest/go.mod, commits and tags the sibling repo in lock-step. mongotest no longer depends on easymongo, so remove that half. New behaviour: given TAG=vX.Y.Z, optionally MONGOTEST=vA.B.C to bump the github.com/tophergopher/mongotest/v2 requirement first, then go mod tidy, commit, tag, push tags. Use a portable sed invocation (the current sed -i '' is macOS-only).
  • README: replace every mongotest.NewTestConnection example with easymongotest.Run(t) / easymongotest.NewTestConnection, update the import path shown to github.com/tophergopher/easymongo/easymongotest, mention bson.ObjectID instead of primitive.ObjectID in the struct examples, add the TLS connection snippet, and note the driver v2 requirement (Go 1.27).
  • mongo.code-workspace is gitignored by pattern but committed; either remove it from the repo or drop the ignore rule. Recommend removing the file from git.
  • Add a CHANGELOG.md entry for the minor release describing the bson.ObjectID API change and the new subpackage.

Implementation details

Portable in-place sed: use sed -i.bak ... && rm go.mod.bak (works on GNU and BSD sed). Release target sketch:

release:
ifndef TAG
	$(error TAG is required, e.g. make release TAG=v0.2.0)
endif
ifdef MONGOTEST
	go get github.com/tophergopher/mongotest/v2@$(MONGOTEST) && go mod tidy
	git add go.mod go.sum && git commit -m "Bump mongotest/v2 to $(MONGOTEST)"
endif
	git tag $(TAG) && git push origin master --tags

With DRY_RUN=1, prefix every command with echo.

Acceptance

  • make release TAG=v0.2.0 dry-runs correctly on Linux and macOS (document a DRY_RUN=1 flag that echoes instead of executing).
  • README examples compile when pasted into a test file.

Depends on: #11.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions