etcluvic / hsscommons

0 stars 2 forks source link

HSSCommons Overlay

This repository contains code modified for the HSSCommons project by CANARIE. It acts as an overlay to the HUBzero CMS code to customize HUBzero for use by HSSCommons.****

The HSSCommons git repository consists of two main branches: test and h2.2.22.

The test branch is associated with the test instance of the HSSCommons site.

Installation

This code should be placed in the /app folder of the HUBzero CMS. It is currently developed against version 2.2.22 of HUBzero.

Contributing to HSSCommons

Start by running the following:

$ git clone -b test https://github.com/etcluvic/hsscommons.git  # Clone 'test' branch                                                       
$ git checkout -b i43-new-feature                               # Create a new branch, named after  
                                                                # an issue number and description

You can start making changes to the code. After finishing making changes:

$ git add <file name>               # State changes for each file
$ git commit -m '<commit message>'  # commit your changes

There are two cases that can happen here.

Case 1: If there are changes in the test branch from when you pulled the branch, run:

$ git checkout test                 # Switch back to 'test' branch
$ git pull origin test              # Pull the latest changes on 'test'
$ git checkout i43-new-feature      # Switch back to your feature branch
$ git merge test                    # Merge the new changes in 'test' branch into your feature branch
$ git push origin i43-new-feature   # Push your changes to the feature branch on the remote server

Case 2: If test branch stays the same from when you pulled the branch, just run:

$ git push origin i43-new-feature   # Push your changes to the feature branch on the remote server

If you think your branch is ready to merge, create a Pull Request as follow:

  1. Visit HSSCommons GitHub repository
  2. Click Pull Requests, select New pul request
  3. For compare, select your branch (i43-new-feature in this case). For base, select test
  4. Compare the changes between the your branch and the test branch. The changes you just pushed on your branch should be highlighted. Verify the changes and make sure to write a descriptive comment.
  5. Click Create Pull Request
  6. One of the team members will review the branch, and merge it into test for you.
  7. If the feature works well on the Test Instance, the team member will merge it into h2.2.22 branch
  8. To have the h2.2.22 instance reflect the changes in the h2.2.22 branch, we need to create a ticket with UVic Systems.

To continue working on the next feature, simply repeat the process above, start with running:

$ git checkout -b i44-next-new-feature  # Create a new branch for the next new feature

The work process can be described in the chart below:

flowchart TD
    id1(git clone -b test https://github.com/etcluvic/hsscommons.git) --> id2(git checkout -b i43-new-feature)
    --> id3(work on it, make changes) --> id4(git add <file_name>) --> id5(git commit -m 'Message')
    -- Still have untracked files --> id4(git add <file_name>)
    id5 -- There are changes in 'test' --> id6(git checkout test) --> id7(git pull origin test)
    --> id8(git checkout i43-new-feature) --> id9(git merge test) --> id10(git push origin i43-new-feature)
    id5 -- No changes in 'test' --> id10
    id10 -- Work on the next feature --> id2

Adding files from hubzero-cms

As mentioned above the code in this repository acts as an overlay to the Hubzero CMS code. To make new customizations to files that exist in the hubzero-cms core but not in this repository follow the following steps.

  1. Clone the hubzero-cms repo somewhere on your system using git clone -b 2.2.22 https://github.com/hubzero/hubzero-cms.git (only needs to be done once)
  2. Copy the directory you want to modify from the hubzero-cms to the hsscommons local repo on your system. Ensure to maintain the directory structure as much as possible. For example if the folder exists in hubzero-cms/core/plugins/publications/ then the copied folder should go to hsscommons/plugins/publications
  3. git add, commit and push the files that have just been copied over.
  4. Make any modifications to the copied files.

Licence

This code maintains the MIT licence of the original files.