Using GIT for Feature Development in Joget

Introduction

In Joget, GIT is a powerful tool for feature development. It allows developers to work on new features independently, ensuring that ongoing changes do not affect different versions or servers. This method provides a seamless way to develop and deploy features without interference.

Beware that GIT commands are used in this article, so ensure you are comfortable working around GIT.

How does it work?

In this example, you have a Meeting app, and the table below describes the work to be carried out. 

App Version Description
1 Modify the request form.
2 Add a calendar menu to the app.

To utilize GIT for feature development in Joget, follow these steps:

  1. Start with the Meeting app, where various features are developed across versions.
  2. Modify the request form and add a calendar menu in versions 1 and 2.
    • For Version 1:
      • Go to App Composer > Builders.
      • In the Form Builder, select Request.
      • Modify the request form. Completed work on app version 1.


    • For Version 2:
      • Go to App Composer > Builders.
      • In the UI Builder, select Meeting.
      • Add a calendar. Completed work on app version 2.


  3. Upon successful development and testing in versions 1 and 2, prepare to merge these into a new version, v3.
  4. In the App Configuration Management screen, select Version 2 and create a New Version (v3).
  5. Go to the newly created version directory via the command line: wflow/app_arc/meeting/meeting_3.
  6. Execute the following GIT commands to merge V1 and V3:
    git remote add v1 ../meeting_1
    git fetch v1
    git merge v1/meeting_1 meeting_3 --allow-unrelated-histories

  7. Resolve any merge conflicts that arise. In the figure shown below, you can see that there are four conflicted files.

  8. In this case, you can use Visual Studio Code to inspect and resolve the conflicted files.


  9. After resolving conflicts, select Commit the Merge.

  10. Returning to the Joget screen, visit Meeting request V3
  11. Go to App Configuration Management > Git Configuration.
  12. Enable Auto Sync DB from GIT.
  13. Click anywhere on the screen; for example, go to Properties & Export or open any app builder tool to trigger the synchronization.
  14. Check the server log to confirm that the synchronization has been completed successfully. Look for messages like these:
    INFO  16 Jun 2021 17:43:34 org.joget.apps.app.service.AppDevUtil - Change detected (Wed Jun 16 17:41:57 MYT 2021 vs Wed Jun 16 17:22:07 MYT 2021), init sync for app {id=meeting, version=3, published=false}
    INFO  16 Jun 2021 17:43:35 org.joget.apps.app.service.AppDevUtil - Sync complete for app {id=meeting, version=3, published=false}
    INFO  16 Jun 2021 17:43:35 org.joget.apps.app.service.AppDevUtil - Commit to Git repo by admin: Update app definition meeting. _Update app config meeting._
  15. Once synchronization is confirmed, inspect the application to ensure that all features from versions 1 and 2 are correctly integrated into version 3.
  16. If the verification or testing of app version 3 is unsatisfactory, you may restart the process.
    Delete version 3 from App Configuration Management and the corresponding directory (app_src/meeting/meeting_3).
Created by Julieth Last modified by Aadrian on Dec 13, 2024