iP: Week 2iP: Week 4


iP: Week 3

  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

You are required to follow the Git standard from this week, as specified on 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 since 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:

Repeating some FAQs from last week ...

FAQ about iP increments

FAQ How are the iP git tags used in grading?


FAQ What if I discovered a bug after I finished an increment?


FAQ I did multiple increments in the same commit. How to fix?


FAQ The requirements of an increment scheduled for this week are already satisfied by the work I did in an earlier week. What now?


FAQ My iP increments are not detected by the dashboard because I forgot to push my tags earlier. What now?


FAQ Can the iP dashboard be updated more frequently?


FAQ If I do optional increments, do I get more marks?


FAQ Oh no! I used the wrong tag/branch name.


FAQ I forked the iP repo from a previous semester. How to fix?



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-AY2627-S1/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 empty.
      You may leave the Allow edits by maintainers box unchecked. If checked, maintainers of the upstream repo can push small fixes to your PR (for example, to resolve minor issues before merging).
    • If you created the PR correctly, it should appear in the list of PRs here.
    • Steps for creating a PR are given in Git-Mastery → Lesson: T9L1. Creating Pull Requests (omit the 'preparation' step):

There is no need to create new PRs every time you update the code in your fork. The PR will update automatically to reflect the latest code of the branch it was sent from (i.e., when you push changes to the master branch of your fork).

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 about it 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 into 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 into 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 in a similar way, using a branch branch-Level-8.
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 a separate branch for each increment.
    Reason: that way, the master branch will stay in an 'unbroken' state, while work in progress remains in a separate branch until it 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: after doing A-Gradle, you should use the Gradle option (rather than the IntelliJ option) when doing A-JUnit and A-Jar, because those increments 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 the 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 on 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 types of changes are being made to the code).

If your code already has Javadoc comments for all public methods, you can simply add the A-JavaDoc tag to the current commit and skip the A-JavaDoc increment.

Duke A-JavaDoc: JavaDoc if-applicable

Duke A-CodingStandard: Follow the Coding Standard

FAQ What to do if a certain aspect is not covered by the Java/Git 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.

AI Guidance » JavaFX Tutorial

You can use AI to go through the JavaFX tutorial the same way you've been doing so far in the project.

For example, after setting up the starter project given in the JavaFX tutorial in a local folder, you can start a Codex project in that folder. Next, you can use a prompt like this:

See the JavaFX tutorial given at https://se-education.org/guides/tutorials/javaFxPart1.html

Implement the HelloWorld application as described in that page.

How much you use AI depends on how deeply you want to internalize JavaFX concepts. If you don't expect to need JavaFX in the future, you can go for maximum use of AI.

If you wish to use the present-changes-visually skill in this project as well, you can issue a prompt like this:

Promote the skill present-changes-visually I created in the project [give the project folder here] into a system-wide skill so that I can use it from other projects.

You might have to restart Codex to make the promoted skill available for use.



iP: Week 2iP: Week 4