Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Add API compatibity check to travis. #40

Merged
merged 1 commit into from
Jul 25, 2019
Merged

Add API compatibity check to travis. #40

merged 1 commit into from
Jul 25, 2019

Conversation

Kubuxu
Copy link
Member

@Kubuxu Kubuxu commented Jul 15, 2019

Resolves #39

@yusefnapora
Copy link
Contributor

As the author of #37, this seems awesome to me 😄 There are plenty of reasons to break API compatibility, but it's always nice to at least know that you're doing it

package core

import (
_ "github.com/smola/gocompat"
Copy link
Member

Choose a reason for hiding this comment

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

I read the usage instructions on the gocompat repo, but I'm not sure I follow why we need an import for side-effects here. Isn't the CLI tool self-contained?

Copy link
Member

Choose a reason for hiding this comment

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

It's how one tricks go mod into tracking it. That way, one can run go run github.com/smola/gocompat/cmd/gocompat and always get the right version.

Copy link
Member Author

@Kubuxu Kubuxu Jul 15, 2019

Choose a reason for hiding this comment

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

The build tag is made such that it isn't used for the build and as @Stebalien said. This is how one tricks gomod into tracing tooling. We use the same technique in go-ipfs and go-filecoin is doing the same.

Copy link
Member

Choose a reason for hiding this comment

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

What a hack... sigh scope=test in Maven, devDependencies in npm.

.travis.yml Outdated
include:
- stage: "Test"
script: "./compat-check"
name: "Compatibility Test"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
name: "Compatibility Test"
name: "API compatibility test"

Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

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

LGTM (modulo the example breakage, of course). In practice we want to preserve the public API of any other libp2p module too. Is this worth rolling out everywhere?

License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
@Kubuxu Kubuxu force-pushed the feat/compat-check branch from 4bc67d7 to 04ad8ae Compare July 15, 2019 20:34
@Kubuxu
Copy link
Member Author

Kubuxu commented Jul 15, 2019

I've removed the breaking change and changed the line.

@raulk raulk merged commit f9ca60b into master Jul 25, 2019
@raulk raulk deleted the feat/compat-check branch July 25, 2019 14:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate using tooling to prevent compatibility breakages
4 participants