Skip to content

Developer Guidelines

Setting Up WSL (Windows users only)

WSL allows you to effortlessly incorporate a Linux environment into your Windows operating system. This method empowers developers to leverage the robust development tools of Linux while remaining within their Windows ecosystem. For the installation instructions of WSL, please refer to the following links:

Setting Up GitHub project repository

Connecting to GitHub with SSH

For an enhanced method of authentication when interacting with GitHub repositories, employing an SSH key is highly advisable, as opposed to the less secure username and password authentication. For detailed instructions, refer to the GitHub documentation:

Cloning Repository

To clone a repository using SSH and set up essential Git configurations, you can execute the following shell commands:

# Clone the repository via SSH
git clone git@github.com:bcgov/platform-services-registry.git

# Change into the cloned repository directory
cd platform-services-registry

GPG key signing

To ensure the legitimacy of Git commits, it is strongly recommended to sign them using a GPG key. For step-by-step guidance, please consult the GitHub documentation:

To enable GPG signing in Git, follow these steps in the repository:

# Define the signing key hash
git config user.signingkey "<hash>"

# Specify Git to sign commits and tags with GPG
git config commit.gpgsign true
git config tag.gpgsign true

# Set the GPG program for signing (if not already set)
git config gpg.program gpg

Setting up the local development environment

  • Using Linux or MacOS terminals is advised for the development of web applications and managing their pipelines.
  • asdf is a tool to manage the required packages with specific versions.
  • All the packages are defined in tool-versions.

Installation

  1. Install asdf according to the asdf installation guide.
  2. https://asdf-vm.com/guide/getting-started.html#getting-started
  3. Install asdf packages defined in .tool-versions.
    cat .tool-versions | cut -f 1 -d ' ' | xargs -n 1 asdf plugin-add || true
    asdf plugin-add docker-compose https://github.com/virtualstaticvoid/asdf-docker-compose.git || true
    asdf plugin-update --all
    asdf install
    asdf reshim
    
  4. Confirm the packages installed.
    asdf current
    
  5. Install python packages.
    pip install -r requirements.txt
    
  6. Install the pre-commit script.
    pre-commit install
    pre-commit install --hook-type commit-msg
    

Setting Up GitHub Workspace

Working on features

  1. Create a feature branch.
    git checkout -b "feat/1091"
    
  2. Make sure the branch is rebased onto main branch.
    git pull origin main --rebase
    
  3. Make changes to complete the task.
  4. Make a commit with the changes.
    git add .
    git commit -m "feat(1091): add new page" # `pre-commit` hooks will be triggered to ensure the code quality.
    git pull origin main --rebase
    
  5. Push the commit to the remote repository.
    git push
    
  6. Make a PR from the feature branch into the target branch via UI.
  7. Wait until the checks pass before requesting the peer review via UI.
  8. Once the PR is approved, merge the PR via UI.