Feature Development Workflow

First, you will need to clone the repository and configure the .env files. You may wish to go through the entire deploy cycle to ensure you’re starting with a working application to develop on.

Create a new branch

git branch new-branch-name

Branch Names

Use consistent branch naming for more opaque pull requests and flow.

For new features use:

feature/feature-name

e.g. feature/new-button

For bug fixes use:

bugfix/bug-name

e.g. bugfix/homepage-map

Pull requests automatically created by Dependabot will use:

dependabot/bundler/gem-being-updated

.e.g dependabot/bundler/sidekiq-7.0.7

Using these consistently will help us keep track of branches and why they were created

Make changes in the newly created branch

Checkout the new branch:

git checkout new-branch-name

Commit changes to your local branch:

git add .
git commit -m "notes about your commits"

bundle update & install

If you make changes to the gemfile run:

bundle install

and

bundle update

This will install depdnencies and modify the gemfile.lock file. Do this before pushing to ensure all changes are captured in your push.

Run the ruby linter

This linter will check that our ruby code meets the language specifications

bundle exec standardrb

if the linter detects problems, you can usually fix them with

bundle exec standardrb --fix

Run the test suite

RAILS_ENV=test bundle exec rake ci

Green lines are passed tests, red are failed and will tell you which line broke .

See the tests directory in the repo.

Push your branch to GitHub

git push

Open a Pull Request

Open a pull request in git hub.

Assign a reviewer. It’s a good idea to have someone else inspect any changes you made.

The review process might look like this:

  1. Pull the new feature branch to your local machine
  2. Follow the instructions to deploy to your local machine
  3. Run the linter and test suite
  4. Start the application and make sure it works
  5. Review the changed files from the pull request in GitHub and make any comments.
  6. Make revisions or encourage the person who opened the PR to make changes.
  7. Merge the pull request into the main branch and delete the feature branch.

Tag a release

Once the pull request is merged, we should tag a release using semantic tagging.

git tag v4.0.x 
git push origin --tags

Deploy

Deploy to development environment for further testing.

Open the Rails Console for Interactive Development on the CLI

From the GeoDiscovery directory, run rails console or rails c

See the Rails documentation for more info