Week 3 [Mon, Aug 26th] - Project

iP:

  1. Do any leftover iP tasks from the previous week
  2. Create a PR to the upstream repo
  3. Add Increments as branches: Level-7, Level-8
  4. Add Increments: A-MoreOOP, A-Packages, A-Gradle, A-JUnit, A-Jar
  5. Add Increments as parallel branches: A-JavaDoc, A-CodingStandard, Level-9
  6. [Optional] Get a head start on JavaFX

tP:

  1. Individual Task: Explore AB3 features Sat, Aug 31st 23:59
  2. Team Task: Set up a project meeting time by the end of the tutorial
  3. Team Task: Check up on team's collective iP status Tue, Sep 3rd

iP

You are required to follow the Git standard from this week, as specified in this page.
Only future commits need to follow the Git standard. Editing past commit messages (to make them comply with the Git standard) is discouraged as it changes the commit timestamp, which can alter your iP progress timeline (as seen by progress tracking scripts).

Reminder about the deadline for the weekly project tasks:

1 Do any leftover iP tasks from the previous week

  • Remember to do any leftover increments from the past weeks before starting on the current week's increments. This guideline applies to future weeks too.

2 Create a PR to the upstream repo

  • Create a pull request (PR) from your fork to the upstream repo. Note the following:
    • Create the PR from the master branch of your fork to the master branch of the upstream repo (https://github.com/nus-cs2103-AY2425S1/ip)
    • Set the PR name as [{Your full/partial name or your GitHub username}] iP
      e.g., [Richard Mathews Chee] iP or [Rich ... hee] iP or [TheRichMat] iP
      Note that the PR name will be publicly visible.
      You may leave the description as empty.
    • If you created the PR correctly, it should appear in the list of PRs here.
    • Steps for creating a PR is given in this textbook topic (steps 5 onwards):

The PR will update automatically to reflect your latest code every time you push code to your fork. As a result, it provides a convenient way for us to access the current state of all your iP code from one location.

3 Add Increments as branches: Level-7, Level-8

%%{init: { 'theme': 'default', 'gitGraph': {'mainBranchName': 'master'}} }%% gitGraph commit id: "m1" commit id: "m2" branch branch-Level-7 checkout branch-Level-7 commit id: "b1c1" commit id: "b1c2" checkout master merge branch-Level-7 id: "Merge branch ..." tag: "Level-7" branch branch-Level-8 checkout branch-Level-8 commit id: "b2c1" checkout master merge branch-Level-8 id: "Merge branch-Level-8 ..." tag: "Level-8" commit id: "m4"

If you are new to Git branching, before attempting this iP increment, first learn Git branching from this week's textbook topics. In particular, learn how to merge a branch without fast forwarding.

  • Do Level 7 in a branch named branch-Level-7. Here are the steps:
    1. Start a branch branch-Level-7.
    2. Implement Level 7 while committing to that branch at appropriate points,
    3. Merge the branch back to the master branch (remember to create a merge commit i.e., no fast-forward).
    4. Git tag the merge commit in the master branch as usual (i.e., add the tag Level-7).
    5. Push the following three things to your fork:
      (a) the master branch,
      (b) the branch-Level-7 branch,
      (c) the Level-7 tag.
      Advanced git users: do not delete the branch after merging.
      Only merged branches are detected by the script. After merging a branch b1 to the master branch, you need to push both the master and the b1 branches to the fork. Pushing the master branch does not automatically take the b1 branch along with it just because it is already merged to the master branch.
Duke Level-7: Save

FAQ Can I use other data formats (e.g., serialized objects) to save tasks?


FAQ Oops, I messed up my branching! Will I be penalized?


FAQ What if I did the increment in the master branch, not in branch-___ as required?


  • Do Level 8 similar to the above, using a branch branch-Level-8.

Guidance for the item(s) below:

As you know, one main goal of the iP is to prepare for you for the tP. The task below is heavy on the 'training for tP' aspect.

In previous iP increments, you learned:

  • How to merge branches locally and push to your fork
  • How to create PRs from the master branch to an upstream repo

In the following iP task you will learn how to do the following new things, which are relevant to the tP:

  • How to merge branches remotely, and pull to your local repo
  • How to create PRs from branches other than master
  • How to manage PRs that your repo receive
  • How to work with parallel PRs

Due to the above learning goals, this iP task is a bit complicated. Pay attention and try to achieve all learning goals along the way.


  • Note how to merge PRs:

  • Practice using parallel git branches and PRs, as explained below:
  1. First, do each increment as a parallel branch (follow the branch naming convention you followed earlier branch-Level-8 etc.), but do not merge any.

    %%{init: { 'theme': 'default', 'gitGraph': {'mainBranchName': 'master'}} }%% gitGraph commit id: "m1" commit id: "m2" branch branch-A-Assertions checkout branch-A-Assertions commit id: "b1c1" checkout master branch branch-A-CodeQuality checkout branch-A-CodeQuality commit id: "b2c1" checkout master branch branch-A-Streams checkout branch-A-Streams commit id: "b3c1" commit id: "b3c2" checkout master
  2. Then, push each branch to your fork, and create a PR within your fork (i.e., from the increment branch to the master branch). Be careful not to create a PR to the upstream repo. If you did create such a PR by mistake, no worries, just close it yourself.

When you are doing the next step, you can run into merge conflicts. In some cases, GitHub will give you a way to resolve those conflicts using the Web interface. While this approach may be good enough for simple merge conflicts, de-conflicting locally in the standard way is safer (e.g., you can run tests to confirm the updated code is correct) and more standard (it's a standard Git feature that you can use even when you are not using GitHub for your project).

  1. Now, merge one of the PRs and update the remaining PRs accordingly, as given below:
    • Merge one of the PRs on GitHub. Remember to choose the Create merge commit option when merging.
    • The above step will cause the master branch of your local repo to fall behind that of your fork (). Therefore, you need to sync the local master with the remote master branch. One way to do that is to switch to the local master branch and then pull the updated master branch from your fork e.g.,
      $ git checkout master
      $ git pull origin master
      
    Tag the merge commit as usual, and push to the fork.
    The diagram below shows the current situation, assuming you merged the A-Assertions PR first.
    %%{init: { 'theme': 'default', 'gitGraph': {'mainBranchName': 'master'}} }%% gitGraph commit id: "m1" commit id: "m2" branch branch-A-Assertions checkout branch-A-Assertions commit id: "b1c1" checkout master branch branch-A-CodeQuality checkout branch-A-CodeQuality commit id: "b2c1" checkout master branch branch-A-Streams checkout branch-A-Streams commit id: "b3c1" commit id: "b3c2" checkout master merge branch-A-Assertions tag: "A-Assertions"
    • Note how the remaining are no longer in sync with the latest master. To rectify, merge the master branch on to each of them. Resolve merge conflicts, if any. The outcome will be something like the below:
    %%{init: { 'theme': 'default', 'gitGraph': {'mainBranchName': 'master'}} }%% gitGraph commit id: "m1" commit id: "m2" branch branch-A-Assertions checkout branch-A-Assertions commit id: "b1c1" checkout master branch branch-A-CodeQuality checkout branch-A-CodeQuality commit id: "b2c1" checkout master branch branch-A-Streams checkout branch-A-Streams commit id: "b3c1" commit id: "b3c2" checkout master merge branch-A-Assertions tag: "A-Assertions" checkout branch-A-CodeQuality merge master id: "merge master to ..." checkout branch-A-Streams merge master
    • Push the updated branches to your fork. The PRs will update automatically to reflect the updated branch.
    • As before, tag the merge commit in the master branch and push the tag to your fork.
  2. Merge the remaining PRs using a procedure similar to the above. The diagram below shows the situation after merging the A-CodeQuality PR and syncing the local branch-A-Streams with the updated master branch.
    %%{init: { 'theme': 'default', 'gitGraph': {'mainBranchName': 'master'}} }%% gitGraph commit id: "m1" commit id: "m2" branch branch-A-Assertions checkout branch-A-Assertions commit id: "b1c1" checkout master branch branch-A-CodeQuality checkout branch-A-CodeQuality commit id: "b2c1" checkout master branch branch-A-Streams checkout branch-A-Streams commit id: "b3c1" commit id: "b3c2" checkout master merge branch-A-Assertions tag: "A-Assertions" checkout branch-A-CodeQuality merge master id: "merge master to ..." checkout branch-A-Streams merge master checkout master merge branch-A-CodeQuality tag: "A-CodeQuality" checkout branch-A-Streams merge master

FAQ Oops, I messed up my branching! Will I be penalized?


Duke Level-8: Dates and Times

4 Add Increments: A-MoreOOP, A-Packages, A-Gradle, A-JUnit, A-Jar

  • While not required, you are encouraged to use separate branches for each increment.
    Reason: that way, the master branch will always stay in a 'unbroken' state as the work-in-progress will be in a separate branch till such work is ready to be merged.
  • As before, commit, tag, and push, after each increment.
Duke A-MoreOOP: Use More OOP

Why more OOP?


Duke A-Packages: Organize into Packages

  • Do the following increments in the given order because after doing A-Gradle you can use the Gradle option (rather than the IntelliJ option) when doing A-JUnit and A-JAR as they are easier to do using Gradle.

How do I fetch the add-gradle-support branch from my fork?


If your fork doesn't have the add-gradle-support branch ...


Duke A-Gradle: Use Gradle

Duke A-JUnit: Add JUnit Tests

Duke A-Jar: Create a JAR File

Note that if A-Jar increment does not require any code changes, you may tag the commit at which this was achieved as A-Jar (even if that commit has another tag already). Otherwise, tag the latest commit as usual. In both cases, push the tag to the fork.

5 Add Increments as parallel branches: A-JavaDoc, A-CodingStandard, Level-9

  • Implement these three increments as three branches first (branch names: branch-A-JavaDoc, branch-A-CodingStandard, branch-Level-9), and then merge them one-by-one. Hopefully, you will encounter some merge conflicts so that you get to practice de-conflicting branches.
%%{init: { 'theme': 'default', 'gitGraph': {'mainBranchName': 'master'}} }%% gitGraph commit id: "m1" commit id: "m2" branch branch-A-JavaDoc checkout branch-A-JavaDoc commit id: "b1c1" commit id: "b1c2" checkout master branch branch-A-CodingStandard checkout branch-A-CodingStandard commit id: "b2c1" checkout master branch branch-Level-9 checkout branch-Level-9 commit id: "b3c1" commit id: "b3c2" checkout master merge branch-A-JavaDoc tag: "A-JavaDoc" merge branch-A-CodingStandard tag: "A-CodingStandard" merge branch-Level-9 tag: "Level-9" commit id: "m6"
  • The Java and Git standards to follow (for A-CodingStandard) are given in this page.
  • After finishing, assuming you encountered merge conflicts (and some were rather painful to resolve), think of how such conflicts could have been reduced (e.g., by changing the order of merging, or minimizing parallel branches when certain type of changes are being done to the code).
Duke A-JavaDoc: JavaDoc

Duke A-CodingStandard: Follow the Coding Standard

Duke Level-9: Find

6 [Optional] Get a head start on JavaFX

If you can spare some time, start learning JavaFX by following the JavaFX tutorial @SE-EDU/guides. Doing so will make your life easier in the following week.

tP: Kickoff

Intro to tP Week 3

This week, we kick off the tP with a few light individual and team tasks, described in the sections below.

indicates an individual task (i.e., each team member has to do the task, graded individually)
indicates a team task (i.e., some or all members may do the work; graded for the whole team).
/ indicates one-person-per-team task (i.e., one member can do the task on behalf of the team, although other members are welcome to pitch in).

Stronger teams are welcome to stay one week ahead of the tP schedule. However, do not move ahead more than one week, as doing tP in a short burst will interfere with some of its learning outcomes.

1 Individual Task: Explore AB3 features Sat, Aug 31st 23:59

  • Objectives: (1) To get each of you to think of ways to improve AB3 (2) To detect any Java version compatibility issues between your local set up and the expected Java version.

  • Submission: via Canvas survey named tP: AB3 Initial Experience by Sat, Aug 31st 23:59

  • Steps:

    1. Download the latest released version (i.e., the jar file) of AB3 from its upstream repo.
    2. Get it running in your computer. Play around with it to familiarize yourself with its current features.
    3. Add yourself to the list of contacts in AB3 (using the add ... command).
    4. Take a screenshot of the AB3 Window, while it shows your own contact info you added earlier. Save it as a .png file.
    5. Think about how the AB3 user experience can be improved, for example, by tweaking the command format, or the GUI, or the features. Note them down as a list of feature suggestions, as free text (i.e., no specific format).
      Suggested: Try to come up with at least 5 ways to improve AB3, while also trying to go beyond the simple/obvious ones (i.e., this is a chance to be insightful but also creative).
      Also keep the following tP constraints/recommendations in mind when doing this, as improvements that are not aligned with tP constraints are unlikely to be useful later.

  1. Use the Canvas survey mentioned above to submit the screenshot and the feature suggestions.
    Note: The feature suggestions you submit will be shared with the team members later, so that your team can use them when designing the tP product later.

2 Team Task: Set up a project meeting time by the end of the tutorial

  • After forming teams, set up a weekly project meeting time/venue (and communication channels) with your team members:

3 Team Task: Check up on team's collective iP status Tue, Sep 3rd

  • Check with all team members if any of them needs help doing the iP, and source within the team to provide the needed help as much as you can e.g., offer to sit with them while they do the iP so that you can try to help when needed.
    Submission: After completing this task (i.e., after asking all team members if they need help for the iP, and coming up with a plan to help those who asked for help), one member should inform your tutor so that we can track the status of this task. We don't need to know who asked for help though e.g., One member is slightly behind and one significantly behind. We plan to have a code-together session on Sunday so that we can help them if they encounter problems.
Mentorship within the team is highly-encouraged and rewarded. Besides, it is in your interest to help team members level up before the tP coding begins, and also, a good early opportunity to build team spirit.