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

devp2p monorepo transition #971

Merged
merged 220 commits into from
Dec 1, 2020
Merged

devp2p monorepo transition #971

merged 220 commits into from
Dec 1, 2020

Conversation

holgerd77
Copy link
Member

This PR transitions the ethereumjs-devp2p library to the monorepo, partly addresses #892

Ok, this should hopefully do it, transition is inspired by the monorepify script from Everton, I used a simple version though and extracted the commands useful for this transition and for the main part followed the instructions from this post linked in the script.

Git history is preserved, I tested a merge on my own fork here https://github.com/holgerd77/ethereumjs-vm. Commit history looks like things are put into proper order, see also e.g. here for an example commit diff. This should be the main thing, if there are smaller caveats - some CI, dependency, link stuff to fix - we can also do post-merge.

Also updated the following:

  • Moved CI config to root, adjusted to monorepo structure
  • Adjusted dependency versions in package.json for hoisting
  • Updated local README links
  • Updated monorepo README sections

Please nevertheless do not merge directly, I would do tomorrow (CET) in case of successful reviews. I would wait for 2+ reviews on this before merge.

@holgerd77
Copy link
Member Author

Ok, CI is passing. 😄

Ready for review, I would ask you to not demand further rebases on this since this is delicate with these merged Git histories, not worth for consolidating on a few extra commits.

@jochem-brouwer
Copy link
Member

I checked the commits which you built upon the current master branch of the package, which look good to me. However, git history does not seem to be viewed correctly. Maybe this has to do with it?

@ryanio
Copy link
Contributor

ryanio commented Nov 30, 2020

@jochem-brouwer github has some issues showing history across renames, see isaacs/github#900

@jochem-brouwer
Copy link
Member

Wow it seems like GitHub should add a high priority to this feature. I don't understand how this is not a thing yet! I recall that I ran into this problem as well to track the prioritizedTaskExecutor changes in MPT.

@ryanio
Copy link
Contributor

ryanio commented Nov 30, 2020

yeah it's a bummer 😕 i'm also surprised they haven't allocated more resources toward it, i would find it useful multiple times per week, especially with the monorepo and also all our js=>ts file renamings. gitlab shows it properly...ev imported the monorepo in gitlab once to test that his script modified the git history correctly and it looked nice.

@holgerd77
Copy link
Member Author

Any chance that this still gets an approval tonight, or do you guys have further reservations? Then I could directly tackle the client transition tomorrow as some follow-up.

Copy link
Contributor

@ryanio ryanio left a comment

Choose a reason for hiding this comment

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

yes LGTM!

@holgerd77
Copy link
Member Author

@ryanio thanks 😄 , @jochem-brouwer (or @cgewecke) please give this an additional approval when you are confident here as well.

@jochem-brouwer
Copy link
Member

jochem-brouwer commented Nov 30, 2020

Ah yes sorry I wanted to check this, this afternoon.

git fetch
git checkout origin/monorepo-add-devp2p
cd packages/devp2p/src
git log --follow eth

Output

commit 37597e7ca13884e06fc32679e709d935300609a6 (HEAD, origin/monorepo-add-devp2p)
Author: holgerd77 <Holger.Drewes@gmail.com>
Date:   Mon Nov 30 14:19:58 2020 +0100

    devp2p -> monorepo transition: fixed linting

commit d435b055a3f694fb40bd5957278d167eff23dc40
Author: holgerd77 <Holger.Drewes@gmail.com>
Date:   Mon Nov 30 12:02:57 2020 +0100

    monorepo preparation: moved all files to packages/devp2p

This should show the commit history, right?

EDIT: this was called on a non-existent directory in the original repo so the results make sense, if you call this on any file it works just fine.

@cgewecke
Copy link
Contributor

cgewecke commented Dec 1, 2020

@jochem-brouwer

If I checkout this branch and use simple git log, I can see early devp2p commits interleaved in the history.

For example, somewhere below the ORIGIN/HEAD master commit, I find this, (part of this PR).

Local

commit 77625aadf11d27522c8e9209092b8cf4590f08ac
Author: holgerd77 <Holger.Drewes@gmail.com>
Date:   Fri Nov 20 09:40:01 2020 +0100

    eth64: minor fixes

PR screenshot
Screen Shot 2020-11-30 at 10 47 15 PM

Are you expecting (or seeing) something else?

Copy link
Contributor

@cgewecke cgewecke left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@evertonfraga
Copy link
Contributor

Great job, @holgerd77!

@jochem-brouwer yes, the --follow should do the trick. Or for specific/annoying cases, you can push the repo to gitlab, and you'll have a history that actually makes sense 🙈

I didn't check, but please make sure the tests for devp2p are present on the newly added node-versions CI file.

@evertonfraga
Copy link
Contributor

Also, if you want to update the diagram, you can click on the URL at line 35 of the README.md (Mermaid chart).

Then, add the package reference to devp2p, copy the SVG code and the new bug URL into the README.

@holgerd77 holgerd77 merged commit 997678b into master Dec 1, 2020
@holgerd77 holgerd77 deleted the monorepo-add-devp2p branch December 1, 2020 08:19
@holgerd77
Copy link
Member Author

One note here: when I wanted to pull this into my local master branch, git wanted to do a merge commit, which I found a bit spooky. I then did a backup copy of my current working repo and did a fresh clone, everything seems to be working fine though.

@jochem-brouwer
Copy link
Member

@cgewecke yes the commits are in the commit log, but if I try to track where these devp2p files originated from by git log --follow <file> then these commits somehow do not show up 🤔

@holgerd77
Copy link
Member Author

For me locally they actually do 🤔, e.g. git log --follow ../devp2p/tsconfig.json:

Bildschirmfoto 2020-12-01 um 12 33 47

@jochem-brouwer
Copy link
Member

Yes you are right @holgerd77, I called this on a directory which did not exist in the original devp2p repo, so it makes sense it doesn't show old commits there. I just checked and indeed if you call it on a file, it follows it just fine! 😅 Will also approve.

Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

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

Approved ✅

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

Successfully merging this pull request may close these issues.