Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binstubs for Better Developer Experience #16781

Merged
merged 16 commits into from
May 29, 2024
Merged

Conversation

stevenjcumming
Copy link
Contributor

@stevenjcumming stevenjcumming commented May 16, 2024

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)

Acceptance criteria

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

@stevenjcumming stevenjcumming requested review from a team as code owners May 16, 2024 19:50
@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: docs/setup/binstubs.md

Copy link

github-actions bot commented May 16, 2024

1 Error
🚫 This PR changes 1153 LoC (not counting whitespace/newlines).

In order to ensure each PR receives the proper attention it deserves, those exceeding
500 will not be reviewed, nor will they be allowed to merge. Please break this PR up into
smaller ones.

If you have reason to believe that this PR should be granted an exception, please see the
Submitting pull requests for approval - FAQ.

File Summary

Files

  • .github/CODEOWNERS (+2/-6)

  • .gitignore (+3/-1)

  • .rubocop.yml (+1/-0)

  • bin/deps (+3/-0)

  • bin/help (+18/-0)

  • bin/info (+19/-0)

  • bin/lib/vets-api/README.md (+78/-0)

  • bin/lib/vets-api/commands/command.rb (+57/-0)

  • bin/lib/vets-api/commands/info.rb (+61/-0)

  • bin/lib/vets-api/commands/lint.rb (+63/-0)

  • bin/lib/vets-api/commands/setup.rb (+77/-0)

  • bin/lib/vets-api/commands/test.rb (+65/-0)

  • bin/lib/vets-api/setups/base.rb (+119/-0)

  • bin/lib/vets-api/setups/docker.rb (+62/-0)

  • bin/lib/vets-api/setups/hybrid.rb (+91/-0)

  • bin/lib/vets-api/setups/native.rb (+76/-0)

  • bin/lib/vets-api/setups/rails.rb (+77/-0)

  • bin/lint (+38/-0)

  • bin/setup (+32/-29)

  • bin/test (+58/-0)

  • docs/setup/binstubs.md (+97/-0)

  • docs/setup/docker.md (+1/-1)

  • rakelib/support/shell_command.rb (+18/-0)

    Note: We exclude files matching the following when considering PR size:

    *.csv, *.json, *.tsv, *.txt, Gemfile.lock, app/swagger, modules/mobile/docs, spec/fixtures/, spec/support/vcr_cassettes/, modules/mobile/spec/support/vcr_cassettes/, db/seeds, modules/vaos/app/docs, modules/meb_api/app/docs, modules/appeals_api/app/swagger/, *.bru
    

Big PRs are difficult to review, often become stale, and cause delays.

Generated by 🚫 Danger

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: docs/setup/binstubs.md

@stevenjcumming stevenjcumming self-assigned this May 16, 2024
@va-vfs-bot va-vfs-bot temporarily deployed to sjc-master-binstubs/main/main May 16, 2024 20:43 Inactive
bin/deps Outdated Show resolved Hide resolved
bin/help Outdated Show resolved Hide resolved
@va-vfs-bot va-vfs-bot temporarily deployed to sjc-master-binstubs/main/main May 16, 2024 22:43 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to sjc-master-binstubs/main/main May 17, 2024 14:03 Inactive
@stevenjcumming stevenjcumming merged commit 7fd2dc7 into master May 29, 2024
18 of 19 checks passed
@stevenjcumming stevenjcumming deleted the sjc-master-binstubs branch May 29, 2024 14:18
stevenjcumming added a commit that referenced this pull request May 31, 2024
* add binstubs for setup, test, lint, and deps

* minor updates in documentation and fixing testing issue

* update CODEOWNERS

* fix clamav initializer

* updates based on PR comments

* update bin/dep

* grab required ruby version from .ruby_version

* rubocop formatting

* refactor commands

* refactor setups

* readability update for docker setup and refactor CODEOWNERS

* rubocop formatting

* remove comment

* private method refactoring

* exit if postgis install fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants