-
Notifications
You must be signed in to change notification settings - Fork 19
Command Line Developer Tools
With the release of APPEALS-51865, new git
commands have been created to help Caseflow developers catch failing tests on their development branches. The current commands are git clean-pr
, git clean-push
, and git codeclimate
- Go to your .bashrc or .zshrc file and add the following path:
export PATH=$PATH:/<<your-directory-here>>/git-commands
- Source the git commands directory by running:
source ~/.bashrc
orsource ~/.zshrc
depending on step 1.
git clean-pr
is a command line dev tool that runs the following relevant tests based on files changed within the git in-flight commits:
- Ruby spec test
- Ruby feature tests
- Rubocop
- fasterer
- scss-lint
- jest
- lint:fix
- prettier
- Codeclimate (optional)
Tests will only be run if relevant for the file type (ex: Ruby files will run spec, feature, rubocop etc. while Javascript files will run Jest/Lint/etc. tests).
The syntax for the command is git clean-pr [branch-name] -- [codeclimate] [autofix]
The options for the command are:
-
branch-name option: by default, the command runs tests for differences in the base branch and in-flight commits. If a branch is passed, tests will be run for files that are different between the base branch and the
branch-name
passed in. - codeclimate option: if this option is passed in, the command will run git codeclimate for each file in the in-flight commit.
- autofix option: if this option is passed, the test will attempt to autofix failures for these following tests:
- Rubocop
- Jest snapshots
To run options with the command a --
separator is mandatory to run the options without issues.
The git clean-push
command runs git clean-pr
in conjuncture with a single line push command to the base branch.
The syntax for the command is:
git clean-push [commit-message] -- [codeclimate] [autofix]
The options for the command are:
- commit-message option (mandatory): a mandatory commit message needs to be run with the command in order for a commit to be created. The command returns an error message if a commit isn't passed. The string value needs to be wrapped in either single or double quotes.
- codeclimate option: see codeclimate option
- autofix option: see autofix option above
Once the test suite is finished running, git clean-pr
will prompt the user if they want to push their changes. If the user enters y
or Y
, the changes will be pushed, and if the user enters n
or N
, the command will exit. Similar to git clean-pr
, options need to be run with a --
separator in order for the command to run successfully.
The git codeclimate
command pulls down a CodeClimate CLI docker image and runs the Caseflow CodeClimate suite of tests for each file changed in the in-flight commits log. The syntax for the command is
git codeclimate [path-to-file-here]
If no file path is passed, the command will run codeclimate analyze
on the entire Caseflow repository. Due to the extensive time it takes to run tests for the entire project, the command sets the timeout for 1 hour (overriding the default 15 minute timeout) when testing the entire project.
- Home
- Acronyms and Glossary
- Caseflow products
- Caseflow Intake
- Caseflow Queue
- Appeals Consumer
- Caseflow Reader
- Caseflow eFolder
- Caseflow Hearings
- Caseflow Certification
- Caseflow APIs
- Appeal Status API
- Caseflow Dispatch
-
CSUM Roles
- System Admin
- VHA Team Management
- Active Record Queries Resource
- External Integrations
- Caseflow Demo
- Caseflow ProdTest
- Background
- Stuck Jobs
- VA Notify
-
Caseflow-Team
- Tier 4
- Bat Team
- Technical Documentation
- Backend Code Patterns
- Backend Working Group
- FACOLS, VACOLS DB Schema
- Asyncable Models
- External Data: where and why
- Data Fetching Scripts
- Caseflow Data Model and Dictionary
- User Access Permissions
- Controller Schemas
- Constants
- Frontend Best Practices
- Accessibility
- How-To
- Debugging Tips
- Adding a Feature Flag with FeatureToggle
- Editing AMA issues
- Editing a decision review
- Fixing task trees
- Investigating and diagnosing issues
- Data and Metric Request Workflow
- Exporting and Importing Appeals
- Explain page for Appeals
- Record associations and Foreign Keys
- Upgrading Ruby
- Stuck Appeals
- Testing Action Mailer Messages Locally
- Re-running Seed Files
- Rake Generator for Legacy Appeals
- Manually running Scheduled Jobs
- System Admin UI
- Caseflow Makefile
- Upgrading Postgresql from v11.7 to v14.8 Locally
- VACOLS VM Trigger Fix M1
- Using SlackService to Send a Job Alert
- Technical Talks