My Hive Posts

    Fixing Forked Project Bug in Utopian-io

    A few days back I have reported the issue about the forked project was not included when we search for Github Project. I thought of working on it.

    image.png

    Setting Local Server

    The very first thing I have to do it to fork the original project and run it on my local server. Next, I pulled the master branch from my forked repository using command git pull repository_name master where repository_name is my forked repository full path.

    After pulling, I need to install all the node_modules which are used in the Utopian project for that I have ran npm install in the same repository where my code resides.

    It will take some time if you are doing it for the first time. Once done, its time to run the code. For that you need to run npm run dev-server. If it runs successfully you will get a message as shown below.

    image.png

    When you navigate to the http://localhost:3000/ you can see the utopian running on your local server.

    Analysing the Bug

    After searching in the Github search API, I came to know that the search should include +fork:true while calling the GET API of the repository.

    image.png

    Fixing the Bug

    It was a simple fix where while sending the search term we need to append +fork:true as well. One thing to note here is that if we encode + and : it will not work. So first we need to encode the q parameter and then append the +fork:true.

    endpoint: https://api.github.com/search/repositories?${querystring.encode(q)}+fork:true&sort=stars&order=desc,

    Commits : 1 - https://github.com/utopian-io/utopian.io/commit/8c09b26183d4839eb0eb78cfad0840c0e1196766 2 - https://github.com/utopian-io/utopian.io/pull/70/commits/51517afa86ecd1d0f2cb039b321a421867d8545a

    Pull Request: https://github.com/utopian-io/utopian.io/pull/70



    Open Source Contribution posted via Utopian.io