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 withgit remote -v
:
- Fetch the remote commits with
git fetch upstream
:
- Checkout the
developXX
branch that match your attendee number from themasterXX
withgit checkout -b developXX upstream/masterXX
:
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:
- Modify
DataDiggerLib.p
(at line 1693) to feed the field with the default value.
-
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
:
- Once completed, push the code to the central repository with
git push -u upstream develop01
:
- Go to the central repository website, and click on the "Open Pull Request" for your team's branch:
- 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:
- Build will be automatically triggered by Jenkins
🚀🚀🚀 Jump to Step 11 !!! 🚀🚀🚀