Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples no longer need go mod replace #8516

Merged
merged 5 commits into from
Oct 26, 2021
Merged

Conversation

aschmahmann
Copy link
Contributor

@aschmahmann aschmahmann commented Oct 15, 2021

Prior approach Run examples with -mod=flag so we do not have to tidy the go mod files in the example every time we change them in the repo.

fixes #8514

Proposal is:

  1. Keep the modules, but drop the replace directive
  2. In CI before running the tests run go get ipfs@the-branch-we're testing

…he go mod files in the example every time we change them in the repo
@aschmahmann aschmahmann requested review from guseggert and removed request for guseggert October 15, 2021 14:18
@aschmahmann aschmahmann marked this pull request as draft October 15, 2021 14:28
@marten-seemann
Copy link
Member

We have the same problem in libp2p. Unfortunately, running examples with -mod=mod is not an option, as the go-check workflow checks that all go.mod files are tidied.

What I did was create a Git pre-commit hook that runs go mod tidy for all Go modules in the repository. It's not a perfect solution, as git hooks have to be installed on every remote, but it's better than having CI fail all the time.

@aschmahmann
Copy link
Contributor Author

@marten-seemann WDYT about the current PRs approach? I switched away from the -mod=mod to just testing the examples with upgrades dependencies.

@aschmahmann aschmahmann changed the title ci: run examples tests with -mod=mod flag Examples no longer need go mod replace Oct 18, 2021
@aschmahmann aschmahmann marked this pull request as ready for review October 25, 2021 16:15
.circleci/main.yml Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix dependabot: product PRs that can be merged
2 participants