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

fix(tools): fix and accelerate automated gitpod dev setup #36720

Merged
merged 4 commits into from Aug 30, 2019

Conversation

@jankeromnes
Copy link
Contributor

commented Aug 30, 2019

Hello! 👋

I ❤️ freeCodeCamp, but I noticed that your Gitpod dev setup recently stopped working, so I wanted to fix it. MongoDB is currently printing this error:

/home/gitpod/mongodb/bin/mongod: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory

The fix was to switch freeCodeCamp to Gitpod's official MongoDB image.

I also noticed that initializing a freeCodeCamp workspace takes a long time, so I made efforts to optimize the setup, in order to save contributors and maintainers a lot of time:

  1. I configured Gitpod to continuously prebuild all freeCodeCamp branches and Pull Requests in the background, saving ~85 seconds every time you start a workspace.
    Please note that for this config to work, an admin needs to install the Gitpod hook for this repository -- I'm happy to help with that, but can't do it myself obviously.

  2. I also made Gitpod pre-run npm run prebuild and npm run build:workers in client/, saving another 7 seconds of waiting.

The setup can probably be accelerated even further, but this is what I could reasonably achieve with my limited knowledge of the bootstrap process. 🙂 You can try my optimizations by opening my fork in Gitpod:

https://gitpod.io/#https://github.com/jankeromnes/freeCodeCamp

Then I've also added a new README badge, with a URL that can open any freeCodeCamp fork or branch in Gitpod:

Setup Automated

(It's referrer-based, so if you click on it here, it will open my Pull Request in Gitpod. That's another way to try my changes.)

Please let me know what you think. 🙂

  • I have read freeCodeCamp's contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the master branch of freeCodeCamp.
  • None of my changes are plagiarized from another source without proper attribution.
  • All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
  • My changes do not use shortened URLs or affiliate links.
@jankeromnes jankeromnes requested a review from freeCodeCamp/dev-team as a code owner Aug 30, 2019
@raisedadead raisedadead merged commit e9d753f into freeCodeCamp:master Aug 30, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@raisedadead

This comment has been minimized.

Copy link
Member

commented Aug 30, 2019

Thanks a lot for the update @jankeromnes ! 🎉

I have gone ahead and installed the hook, there is a badge also on the CONTRIBUTING.md, do you think that needs any update?

@jankeromnes

This comment has been minimized.

Copy link
Contributor Author

commented Aug 30, 2019

Thanks a lot for the update @jankeromnes ! 🎉

Wow, thanks for merging my PR so fast! 🚀

I have gone ahead and installed the hook

Cool! I confirm that prebuilds are now enabled and working on the main freeCodeCamp repository. I hope this will make a lot of developers happy. 🙂

there is a badge also on the CONTRIBUTING.md, do you think that needs any update?

@raisedadead Good point. That link there currently points to:

https://gitpod.io/#https://github.com/freeCodeCamp/freeCodeCamp

which will always open the central repository in Gitpod, regardless of where it is clicked. If we change it to:

https://gitpod.io/from-referrer/

it will always open whichever repository CONTRIBUTING.md was consulted on. But maybe developers will always read CONTRIBUTING.md in the main freeCodeCamp repository, i.e. not in their fork?

TL;DR - I'm not sure which option is preferable for CONTRIBUTING.md specifically, but I don't think we need to change it now. If you have a preference, please let me know. 🙂

@raisedadead

This comment has been minimized.

Copy link
Member

commented Aug 30, 2019

Thanks, yes.. this sure will help a lot of the contributors. We are looking forward for the feedback from the community.

If you have a preference, please let me know.

Our only concern is sometimes our moderators (with write access to the repo) may accidentally push to the main repository. I am not sure if there is a clean way to handle that? We would always want everyone to push to their forks and not the upstream.

@jankeromnes

This comment has been minimized.

Copy link
Contributor Author

commented Aug 30, 2019

Our only concern is sometimes our moderators (with write access to the repo) may accidentally push to the main repository. I am not sure if there is a clean way to handle that?

Ah, yes, that's a valid concern. I've trained myself to compulsively check git remote -v all the time, just to be sure the remotes are what I expect them to be.

I see that the master branch in freeCodeCamp/freeCodeCamp has a lock icon next to it. Does that mean that it is "protected"? I know that GitHub allows declaring some branches as "protected", in order to block inadvertant pushes to them, even by moderators (in that case, the only way to get into master is to merge a PR on GitHub, and thay may be blocked if tests don't pass or missing review).

@raisedadead

This comment has been minimized.

Copy link
Member

commented Aug 30, 2019

Yes, while you are correct that GitHub allows for some protection. We do make fast forward merges to our release branches. Nonetheless, I am of the opinion that its not an issue that GitPod needs to solve.

I am pretty sure we can work with GitHub's settings to achieve what we need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.