Skip to content

Guide for OSD good first issue

Vicky Vergara edited this page Jun 29, 2021 · 4 revisions

PostgreSQL 9.5 is no longer supported

The end of life of PostgreSQL 9.5 was on February 11, 2021 (read here)(https://www.postgresql.org/support/versioning/] While PostgreSQL 9.5 (or under) was supported there was the need to add some directives to avoid some type problems. Those directives can now be removed

Basically the changes that need to be done are

#if PGSQL_VERSION > 95
        funcctx->max_calls = result_count;
#else
        funcctx->max_calls = (uint32_t)result_count;
#endif

These C directives can be deleted and changed to:

        funcctx->max_calls = result_count;

This change has to be done on the C files located on the following directories

  • src/allpairs
  • src/alpha_shape
  • src/astar
  • src/bdAstar
  • src/bdDijkstra
  • src/bellman_ford
  • src/breadthFirstSearch
  • src/chinese
  • src/coloring
  • src/components
  • src/contraction
  • src/dagShortestPath
  • src/dijkstra
  • src/dominator
  • src/driving_distance
  • src/ksp
  • src/lineGraph
  • src/max_flow
  • src/mincut
  • src/pickDeliver
  • src/planar
  • src/spanningTree
  • src/topologicalSort
  • src/transitiveClosure
  • src/traversal
  • src/trsp
  • src/tsp
  • src/withPoints

General working steps:

  • Choose the issue (from the list above) that you are planning to solve
  • State in the issue that is your plan to solve the issue
  • Work on the issue
    • Edit all the C files that are in the directory of the issue and make the change on all of them
  • Commit the changes with a commit message like: '[nameofdirectory] removing directive PGSQL_VERSION > 95'

Detailed process

This guideline is written using Unix commands.

Create a fork

To develop is better to do it in your own fork, so first you need to Create a fork of the repository: https://github.com/pgRouting/pgrouting/tree/develop/ We call fork to the "copy" of the repository For example this is Vicky's fork: https://github.com/cvvergara/pgrouting

Create a clone of your fork

A Clone resides on your computer, for example this is done by Vicky:

git clone https://github.com/cvvergara/pgrouting

The command will create a directory named pgrouting Go to the root of the repository:

cd pgrouting

Make sure the work is done on the current contents

First add as a remote the main repository

git remote add upstream https://github.com/pgRouting/pgrouting
git fetch upstream

choose the issue

Branch out from develop and name the working branch with the issue you are fixing

git checkout upstream/develop
git status

the last message will have the:

You are in 'detached HEAD' state ....

Create the working branch

Create the working branch, and push. making sure that the actions are executed:

git switch -c issue1903
git push --set-upstream=origin issue1903

Go to your fork and click the "Actions" button

Edit the file

Using the editor of your preference, edit the C files found, in this case: src/allpairs/floydWarshall.c src/allpairs/johnson.c

Change from:

#if PGSQL_VERSION > 95
        funcctx->max_calls = result_count;
#else
        funcctx->max_calls = (uint32_t)result_count;
#endif

by keeping only the second line above, change to:

        funcctx->max_calls = result_count;

Add the change and commit

git add src/allpairs/floydWarshall.c
git add src/allpairs/johnson.c

The compiler is your best friend

prepare for compilation as follows:

mkdir build
cd build
cmake ..

Now, let the compiler tell you if there was a mistake on your change:

make

Fix if needed and recompile

Compiles completely:

commit and push

# to verify that no other file was modified accidentally
git status  
git commit -a -m '[nameofdirectory] removing directive PGSQL_VERSION > 95'
git push

Create a Pull Request mentioning the solved issue.