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

Move go-ipfs-config back into go-ipfs #8756

Merged
merged 332 commits into from
Mar 9, 2022

Conversation

laurentsenta
Copy link
Contributor

@laurentsenta laurentsenta commented Mar 2, 2022

This PR moves the go-ipfs-config repo into go-ipfs/config.

Fixes go-ipfs-config#151.

Extra care was taken into preserving the history, steps to replicate are shared below:

Notes

This branch looks daunting, but it's actually one merge commit plus 3 commits to update packages.
maybe running a git diff go-ipfs/config go-ipfs-config (to confirm the code is actually the same),
and reviewing the last commits only would make reviewers life easier.

› diff -r go-ipfs/config go-ipfs-config
Only in go-ipfs-config-vanilla: .git
Only in go-ipfs-config-vanilla: .github
Only in go-ipfs-config-vanilla: .gitignore
Only in go-ipfs-config-vanilla: .gx
Only in go-ipfs-config-vanilla: LICENSE
Only in go-ipfs-config-vanilla: README.md
Only in go-ipfs-config-vanilla: go.mod
Only in go-ipfs-config-vanilla: go.sum
diff -r go-ipfs-laurent/config/serialize/serialize.go go-ipfs-config-vanilla/serialize/serialize.go
11c11
<       "github.com/ipfs/go-ipfs/config"
---
>       "github.com/ipfs/go-ipfs-config"
diff -r go-ipfs-laurent/config/serialize/serialize_test.go go-ipfs-config-vanilla/serialize/serialize_test.go
8c8
<       config "github.com/ipfs/go-ipfs/config"
---
>       config "github.com/ipfs/go-ipfs-config"
Only in go-ipfs-config-vanilla: version.json

How to replicate

(1) Rewrite the commit history with a go-ipfs-config prefix:

git filter-repo --commit-callback '
msg = commit.message.decode("utf-8")
newmsg = "go-ipfs-config: " + msg
commit.message = newmsg.encode("utf-8")
' --force

(2) Move the go-ipfs-config to a subfolder

cd go-ipfs-config
git filter-repo --to-subdirectory-filter config

(3) Remove non-go changes

git log --name-only ./config | grep '^config/' | grep -v 'go$' | sort | uniq > /tmp/remove

edited remove file:

config/.circleci/
config/.github/
config/.gitignore
config/.gx/
config/.travis.yml
config/LICENSE
config/README.md
config/go.mod
config/go.sum
config/package.json
config/version.json

Remove these files from the history

cat /tmp/remove | xargs -I{} git filter-repo --path "{}" --invert-path

(⚠️ I had to use --force, do it from a fresh repo, because as far as I know it filters the WHOLE repo)

Also remove the version file from history:

git filter-repo --path config/version.go --invert-path 

(4) then merge it into go-ipfs

cd ..
cd go-ipfs
git remote add config ../go-ipfs-config
git fetch config
git merge --allow-unrelated-histories config/master
git remote remove config

(now the go-ipfs/config folder contains the code AND its git history)

(5) Update go-ipfs code to use the new config package

  • Rewrite the imports with a simple search and replace
  • Run git mod tidy to clean up the module.
  • Tweak the go-ipfs-as-a-library test (we have to rewrite the module path during the tests)
  • removed the package-list.json line about go-ipfs-config
    • run npx package-table --data=package-list.json

Tasks

  • Pass CI
    • Temporary update to Circleci's test of go-ipfs-as-a-library
  • Clean up the test/dependencies/go.sum
    • We need a go-ipfs-config dependency here because github.com/ipfs/iptb-plugins depends on it.
  • Raise the question of other dependencies (in the issue)
  • Update documentation
  • filter out all non-go files. That will drop all the release, gx, etc. commits.

Follow-up tasks

  • When this becomes the new mainstream IPFS, remove the package rewrite in .circleci/main.yml

Kubuxu and others added 30 commits June 24, 2016 22:38
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
… null

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
…tore-bloom-config

config: add config option for bloom filter
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
…repo setConfig

License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
License: MIT
Signed-off-by: George Antoniadis <george@noodles.gr>
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
…ased

License: MIT
Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
update go-libp2p-kad-dht with getclosestpeers fix
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT
Signed-off-by: Zach Ramsay <zach.ramsay@gmail.com>
License: MIT
Signed-off-by: Zach Ramsay <zach.ramsay@gmail.com>
Implemented experimental ptp(corenet) interface
…#3929)

* Allow the use of the Range header in WebTorrent

License: MIT
Signed-off-by: Ivan386

* Allow the use of the Range header in WebTorrent

License: MIT
Signed-off-by: Ivan <ivan386@users.noreply.github.com>
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
@laurentsenta laurentsenta marked this pull request as draft March 2, 2022 14:13
@laurentsenta laurentsenta changed the title Move go-ipfs-config add back to go-ipfs Move go-ipfs-config back to go-ipfs Mar 2, 2022
@laurentsenta laurentsenta force-pushed the feat/add-back-ipfs-config branch 6 times, most recently from 7dfe371 to 9b5d7a4 Compare March 3, 2022 14:12
@laurentsenta laurentsenta marked this pull request as ready for review March 3, 2022 14:19
@Stebalien
Copy link
Member

I think we should be filtering out all non-go files. That will drop all the release, gx, etc. commits.

Otherwise, LGTM! filter-repo makes this so much easier...

@BigLep
Copy link
Contributor

BigLep commented Mar 3, 2022

2022-03-03 conversation: we'll merge when:

Any of the go-ipfs Stewards will then merge.

@laurentsenta laurentsenta changed the title Move go-ipfs-config back to go-ipfs Move go-ipfs-config back into go-ipfs Mar 3, 2022
@BigLep BigLep added this to the Best Effort Track milestone Mar 4, 2022
@laurentsenta
Copy link
Contributor Author

laurentsenta commented Mar 4, 2022

Thanks for the feedback and the fast review @Stebalien!
I removed the non-go code and the version.go file (see step 3 in the description),

Now waiting for everybody's approval I guess :)

(might be useful when we're ready to merge: git rebase --rebase-merges origin/master to rebase without dealing with the merge's internal conflicts).

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thank you for doing this, 🚢ing, so we can benefit from this asap ❤️

Comment on lines +124 to +126
# use the internal config package when we test the current version of go-ipfs
sed -i.bak 's;"github.com/ipfs/go-ipfs-config";"github.com/ipfs/go-ipfs/config";' ./main.go

Copy link
Member

Choose a reason for hiding this comment

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

This is a smart failsafe, good to keep this around to detect any future regressions 👍

@lidel lidel merged commit 83b3ec4 into ipfs:master Mar 9, 2022
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 27, 2023
…s-config

Move go-ipfs-config back into go-ipfs,
close ipfs/go-ipfs-config#151

This commit was moved from ipfs/kubo@83b3ec4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Move this repo back into go-ipfs