vets-api icon indicating copy to clipboard operation
vets-api copied to clipboard

Binstubs for Better Developer Experience

Open stevenjcumming opened this issue 9 months ago • 3 comments

Summary

The introduction of binstubs, which are executable wrappers, is proposed as a solution to harmonize the development environment across different setup configurations. The primary objective of these binstubs is to standardize core development commands, such as setup, running applications, and executing tests. By ensuring uniformity in these processes, we aim to mitigate the discrepancies currently observed in testing outcomes.

Note: Sorry for the big PR, most of this has already been reviewed, but it was branched off the k8s branch

Setup

  • Setup replaces the existing manual setup setups by combining most of them into one command
  • Some setup steps must be done manually such as Postgres & PostGIS for native
  • Currently bin/setup only supports Mac OSX
  • bin/setup for native, docker, and hybrid developer setup
  • Setup preference is stored in .developer-setup

Test

  • Replace existing testing command with a binstub bin/test
  • Options include --ci, --no-parallel, --coverage, --log
  • Input folders/files can be include like with rspec
  • Uses the .developer-setup preference for the testing environment

Lint

  • Add binstub for linting with command bin/lint
  • Uses rubocop, brakeman, and bundle-audit
  • Options include --dry,--only-rubocop,--only-brakeman
  • Inputs can include files and folder
  • Autocorrecting in rubocop is on by default, but --dry will override autocorrect option

Others

  • bin/help - Display vets-api related binstubs
  • bin/info - Display version related information

Impacted Areas

  • This only changes local development. No functional changes

Related Issue(s)

  • https://github.com/department-of-veterans-affairs/va.gov-team/issues/74660
  • https://github.com/department-of-veterans-affairs/va.gov-team/issues/77053
  • https://github.com/department-of-veterans-affairs/va.gov-team/issues/75918
  • https://github.com/department-of-veterans-affairs/va.gov-team/issues/75920
  • (USER TESTING) https://github.com/department-of-veterans-affairs/va.gov-team/issues/77436

Acceptance criteria

  • [x] bin/help outputs a help message
  • [x] bin/info outputs a message with various versions
  • [x] bin/setup can setup local environments native, hybrid, and docker
  • [x] bin/test runs test suite with various options
  • [x] bin/lint runs security checks and linting

stevenjcumming avatar May 16 '24 19:05 stevenjcumming