Go tool for major version upgrades

GOMAJOR

$ gomajor help

GoMajor is a tool for major version upgrades

Usage:

    gomajor <command> [arguments]

The commands are:

    get     upgrade to a major version
    list    list available updates
    path    modify the module path
    help    show this help text

List Updates

$ gomajor list
github.com/go-redis/redis: v6.15.9+incompatible [latest v8.1.3]

Update and Rewrite Imports

$ gomajor get github.com/go-redis/redis@latest
go get github.com/go-redis/redis/[email protected]
foo.go:4:2 github.com/go-redis/redis/v8
bar.go:5:2 github.com/go-redis/redis/v8

Increment Module Path Version

$ gomajor path -next
module github.com/go-redis/redis/v9
bench_test.go:11:2 github.com/go-redis/redis/v9
cluster.go:15:2 github.com/go-redis/redis/v9/internal
cluster.go:16:2 github.com/go-redis/redis/v9/internal/hashtag
# etc ...

Change Module Path

$ gomajor path goredis.io
module goredis.io
bench_test.go:11:2 goredis.io
cluster.go:15:2 goredis.io/internal
cluster.go:16:2 goredis.io/internal/hashtag
# etc ...

Features:

  • Finds latest version.
  • Rewrites your import paths.
  • Lets you ignore SIV on the command line.
  • Update your module's major version.

Warning:

  • By default, only cached content will be fetched from the module proxy (See -cached flag).
  • If you have multiple major versions imported, ALL of them will be rewritten.
  • The latest version will not be found if there are gaps between major version numbers.
Comments
  • allow using

    allow using "get" on all updates shown by "list"

    If gomajor list shows me a few updates, either minor or major version bumps, it would be nice to be able to use gomajor get with those directly. Perhaps there's a way, but I haven't found one via the help docs, so I manually copy-paste the new module paths into gomajor get.

    Perhaps gomajor get all?

  • filter out major upgrades to incompatible versions by default

    filter out major upgrades to incompatible versions by default

    In a few projects, I see gomajor list -major make suggestions like:

    github.com/libp2p/go-libp2p: v0.21.0 [latest v6.0.23+incompatible]
    github.com/mattn/go-sqlite3: v1.14.16 [latest v2.0.3+incompatible]
    

    The suggestions are technically correct, because the upgrades are indeed newer major versions, and they aren't retracted via the modules system.

    However, they're wrong: they are older versions which were published either before switching to Go modules, or by mistake.

    I reckon that gomajor list -major should, by default, ignore major version upgrades which add the +incompatible component. An upgrade from v2.0.0+incompatible to v3.0.0+incompatible would be shown by default, because it's not making anything worse, but v1.0.0 to v3.0.0+incompatible would not be shown by default, with the understanding that often it will be a bad idea. Nowadays, if a module really does bump their major version, it's incredibly rare that they will publish as +incompatible.

    One could still get the old behavior via a flag, like -incompatible.

  • Add move command for moving packages

    Add move command for moving packages

    Add a move command for moving packages in a module.

    $ gomajor move pkg/foo internal/bar
    

    Behaviour:

    • Move the directory
    • Change the package declaration.
    • Rewrite import paths.
  • Add -alias flag to auto-add replace directive

    Add -alias flag to auto-add replace directive

    Nice tool.

    I was thinking .. as you’ve seen discussion at 44550, I need to try it, but a replace of a SIV to one without may help bandaid the experience I’m suggesting in that proposal. What if this tool had -alias which you could pass a package name without SIV and it would add replace to alias. Then could add -alias-all to alias every module without passing a specific one.. and maybe -alias-skip too for exclusion.

    I usually use Makefiles, so something like that could be used to manage an experience similar to what I’m describing in 44550. What do you think?

    Cc @zikaeroh

  • coreos/go-systemd: not finding latest version

    coreos/go-systemd: not finding latest version

    I've added a failing test for the go-systemd module. If I go to the proxy URL directly, it gives me a blank page:

    https://proxy.golang.org/github.com/coreos/go-systemd/@v/list

  • Feat: add apidiff subcommand

    Feat: add apidiff subcommand

    The apidiff subcommand will be a more ergonomic interface to the x/exp/apidiff package.

    Show the apidiff between two import paths

    gomajor apidiff github.com/deckarep/[email protected]  github.com/deckarep/golang-set@v2
    
    • ~~this works outside of a module.~~
    • if only one path is provided, the other is inferred from your go.mod.
  • Nested Modules

    Nested Modules

    Here's an example of a nested module: https://github.com/go-redis/redis/blob/master/extra/rediscmd/go.mod

    module github.com/go-redis/redis/extra/rediscmd
    
    go 1.15
    
    require (
    	github.com/go-redis/redis/v8 v8.4.4
    	github.com/onsi/ginkgo v1.15.0
    	github.com/onsi/gomega v1.10.5
    )
    

    If I run gomajor next -path at the root of the go-redis/redis it will rewrite imports to github.com/go-redis/redis/extra/rediscmd to github.com/go-redis/redis/v9/extra/rediscmd.

  • Support replaced modules

    Support replaced modules

    The kubernonsense go.mod uses replace to pin their dependencies. This bad technique has leaked into repositories which extend kubernetes. I think we can support this use-case with the following 2 behaviours.

    1. Don't skip replaced modules in gomajor list
    2. If a required module is replaced with the exact same version, gomajor get will update both the required and and replaced version.
  • russross/blackfriday: not finding latest version

    russross/blackfriday: not finding latest version

    $ gomajor get github.com/russross/blackfriday@latest
    go get github.com/russross/[email protected]+incompatible
    

    The latest version is: github.com/russross/blackfriday/[email protected]. Since the latest +incompatible version is v2 it checks for a github.com/russross/blackfriday/v3 import path which doesn't exist.

  • Add command for changing the current module path

    Add command for changing the current module path

    I've seen some people using the get sub-command to rewrite imports when incrementing their module's major version. There should be a dedicated command for that use-case. This command will update go.mod and rewrite all imports in the module.

    Examples:

    // increment the major version
    gomajor path -next
    
    // specify the version to use the path
    gomajor path -version v5
    
    // specify the whole path to use
    gomajor path "github.com/icholy/gomajor/v10"
    
  • gomajor get github.com/go-redis/redis/v8 gets wrong version

    gomajor get github.com/go-redis/redis/v8 gets wrong version

    I ran the following:

    gomajor get github.com/go-redis/redis/v8
    go get github.com/go-redis/redis
    go: github.com/go-redis/redis upgrade => v6.15.9+incompatible
    bridge/adapters/sources/redis.go: github.com/go-redis/redis/v8 -> github.com/go-redis/redis
    bridge/adapters/targets/redis.go: github.com/go-redis/redis/v8 -> github.com/go-redis/redis
    

    Instead of getting the latest version of v8, it downloaded v6.15.9+incompatible

  • Go Major does not work with private repos

    Go Major does not work with private repos

    I'm looking at gomajor to evaluate when I need to update versions and for public repo's it's fine. However for private repo's it does not list them.
    Is this something that is planned for the future.

    My envvar GOPRIVATE is already set correctly.

Go dependency management tool experiment (deprecated)
Go dependency management tool experiment (deprecated)

Dep dep is a dependency management tool for Go. It requires Go 1.9 or newer to compile. NOTE: Dep was an official experiment to implement a package ma

Dec 23, 2022
dependency tool for go

Godep - Archived Please use dep or another tool instead. The rest of this readme is preserved for those that may still need its contents. godep helps

Dec 14, 2022
Go Package Manager (gopm) is a package manager and build tool for Go.

?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? In favor of Go Modules Proxy since Go 1.11, this pr

Dec 14, 2022
Spaghetti: a dependency analysis tool for Go packages
Spaghetti: a dependency analysis tool for Go packages

Spaghetti is an interactive web-based tool to help you understand the dependencies of a Go program, and to explore and evaluate various possible efforts to eliminate dependencies.

Dec 15, 2022
A major platform Remote Access Terminal Tool based by Blockchain/P2P.
A major platform Remote Access Terminal Tool based by Blockchain/P2P.

NGLite A major platform Remote Access Terminal Tool based by Blockchain/P2P. No public IP address required.More anonymity Example Detection Warning!!!

Jan 2, 2023
Bump-version - Bump a given semantic version, following a given version fragment

bump-version Bump a given semantic version, following a given version fragment.

Feb 7, 2022
Hackathon project with intent to help based on heuristics for aks cluster upgrades.
Hackathon project with intent to help based on heuristics for aks cluster upgrades.

AKS-Upgrade-Doctor AKS Upgrade Doctor is a client side, self-help diagnostic tool designed to identify and detect possible issues that cause upgrade o

Sep 20, 2022
API that upgrades connection to use websocket. Contains server and client and testing how they communicate

Websocket Test API How to execute First run server using: make run-server. Then run many client instances with: make run-client. Then start typing in

Dec 25, 2021
Set of scripts & tools for converting between numbers and major system encoded words.
Set of scripts & tools for converting between numbers and major system encoded words.

major-system-converter Set of scripts & tools for converting between numbers and major system encoded words. Uses phonetics instead of letters to conv

Aug 9, 2022
A tool to determine the highest version number that's smaller than a target version number

semver-highest A tool to determine the highest version number that's smaller than a target version number. Installation go install github.com/marten-s

Oct 13, 2021
Go version manager. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.

gobrew Go version manager Install or update With curl $ curl -sLk https://git.io/gobrew | sh - or with go $ go get -u github.com/kevincobain2000/gobre

Jan 5, 2023
A tool to restart a Docker container with a newer version of the image

repull A tool to restart a Docker container with a newer version of an image used by the container Often you may need to pull a newer version of an im

Nov 28, 2022
🎉 An awesome version control tool for protoc and its related plugins.
🎉 An awesome version control tool for protoc and its related plugins.

❤️ PowerProto is actively maintained! Any questions in use can be directly raised issue, I will respond to you as fast as possible. If you think the p

Dec 29, 2022
dots is CLI tool to build, version and publish config file bundles.

dots-cli dots is CLI tool to build, version and publish config file bundles. TODO (shared): Writing comprehensive documentation Designing landing page

Aug 24, 2022
A little database tool for version control

A little database tool for version control It's very like sqitch, because I imitate it. If it's not allowed, give me a message, I'll destroy this proj

Aug 18, 2022
A dead simple CLI tool that prints the next semantic version based on the last tag of your git repository

nextver A dead simple CLI tool that prints the next semantic version based on the last tag of your git repository. Install go install github.com/junk1

Sep 29, 2022
Web-based, zero-config, dependency-free database schema change and version control tool for teams
Web-based, zero-config, dependency-free database schema change and version control tool for teams

Live Demo • Install • Help • Development • Design Doc Bytebase is a web-based, zero-config, dependency-free database schema change and version control

Jan 1, 2023
TheOtherRolesInstaller - A simple tool to install the latest version of TheOtherRoles Mod

TheOtherRoles Installer This is a simple tool to install TheOtherRoles Mod for A

Sep 30, 2022
Kdmq - Tool to query KDM data for a given Rancher version

kdmq (kdm query) Tool to query KDM data for a given Rancher version, think of: W

Feb 1, 2022