Step 10 - Riverside-Software/pugchallenge2019 GitHub Wiki

Pull requests (part 1)

Git is a distributed repository, and this means that it's possible to synchronize your local repository with multiple remote repositories. In order to do some code review, you will work in pairs, one person being the developer and the other being the code reviewer. Just talk to your colleague to assign the roles.

Only for the developer

  • Declare the central repository with git remote add upstream https://github.com/Riverside-Software/pugchallenge2019.git, and verify it has been set correctly with git remote -v:

img/Step10Img01.png

  • Fetch the remote commits with git fetch upstream:

img/Step10Img02.png

  • Checkout the developXX branch that match your attendee number from the masterXX with git checkout -b developXX upstream/masterXX:

img/Step10Img03.png

We now want to modify the procedure 'getFields' in the DataDigger library to include an additional comment field in the output temp-table, assign it a default value of "Generated by DataDigger", and make sure the code is unit tested.

  • Modify DataDigger.i (at line 86) to add a new field in the temp-table ttFields, last field of the list:

img/Step10Img04.png

  • Modify DataDiggerLib.p (at line 1693) to feed the field with the default value.

img/Step10Img05.png

  • Add a unit test in test/DDTest.p, for the getFields procedure, with those checks:

    • Retrieves field list from Item table
    • Checks that dataset has two buffers
    • Checks that first buffer has 32 fields
    • Checks that 32nd field in first buffer is cComment
    • Checks that first buffer has at least one record
    • Checks that Comment field in first record has value "Generated by DataDigger"
  • If stuck, solution can be found here

  • Unit tests can be executed locally with %DLC%\ant\bin\ant -lib %DLC%\pct\PCT.jar -DDLC=%DLC% build test:

img/Step10Img06.png

  • Once completed, push the code to the central repository with git push -u upstream develop01:

img/Step10Img07.png

img/Step10Img08.png

  • Change the base branch to match masterXX , then select the code reviewer ID in the "Reviewers" section, and click on the green "Create pull request" button:

img/Step10Img09.png

  • Build will be automatically triggered by Jenkins

🚀🚀🚀 Jump to Step 11 !!! 🚀🚀🚀