Contributing
Forking
Branching
Branch names follow the format TYPE/ISSUE/SUMMARY
. You can create it with git checkout -b TYPE/ISSUE/SUMMARY
.
TYPE
TYPE
can be bug
, chore
, or feature
.
ISSUE
ISSUE
is either a Github issue or an issue from some other
issue tracking software.
SUMMARY
SUMMARY
is is short summary of the purpose of the branch composed of lower case words separated by '-' so that it is a valid PRERELEASE
for the Gem version.
Changes
PRERELEASE
- Update
PRERELEASE
to match theSUMMARY
in the branch name. If you branched frommaster
, and version.rb does not havePRERELEASE
defined, then adding the following lines afterPATCH
:# The prerelease version, scoped to the {PATCH} version number. PRERELEASE = '<SUMMARY>'
rake spec
- Verify the specs pass, which indicates that
PRERELEASE
was updated correctly. - Commit the change
git commit -a
Your changes
Make your changes or however many commits you like, commiting each with git commit
.
Pre-Pull Request Testing
- Run specs one last time before opening the Pull Request:
rake spec
- Verify there was no failures.
Push
Push your branch to your fork on gitub: git push push TYPE/ISSUE/SUMMARY
Pull Request
- Create new Pull Request
- Add a Verification Steps comment
# Verification Steps
- [ ] `bundle install`
## `rake cucumber`
- [ ] `rake cucumber`
- [ ] VERIFY no failures
## `rake spec`
- [ ] `rake spec`
- [ ] VERIFY no failures
You should also include at least one scenario to manually check the changes outside of specs.
- Add a Post-merge Steps comment
The 'Post-merge Steps' are a reminder to the reviewer of the Pull Request of how to update the PRERELEASE
so that version_spec.rb passes on the target branch after the merge.
DESTINATION is the name of the destination branch into which the merge is being made. SOURCE_SUMMARY is the SUMMARY from TYPE/ISSUE/SUMMARY branch name for the SOURCE branch that is being made.
When merging to master
:
# Post-merge Steps
Perform these steps prior to pushing to master or the build will be broke on master.
## Version
- [ ] Edit `lib/metasploit/yard/version.rb`
- [ ] Remove `PRERELEASE` and its comment as `PRERELEASE` is not defined on master.
## Gem build
- [ ] gem build *.gemspec
- [ ] VERIFY the gem has no '.pre' version suffix.
## RSpec
- [ ] `rake spec`
- [ ] VERIFY version examples pass without failures
## Commit & Push
- [ ] `git commit -a`
- [ ] `git push origin master`
When merging to DESTINATION other than master
:
# Post-merge Steps
Perform these steps prior to pushing to DESTINATION or the build will be broke on DESTINATION.
## Version
- [ ] Edit `lib/metasploit/yard/version.rb`
- [ ] Change `PRERELEASE` from `SOURCE_SUMMARY` to `DESTINATION_SUMMARY` to match the branch (DESTINATION) summary (DESTINATION_SUMMARY)
## Gem build
- [ ] gem build *.gemspec
- [ ] VERIFY the prerelease suffix has change on the gem.
## RSpec
- [ ] `rake spec`
- [ ] VERIFY version examples pass without failures
## Commit & Push
- [ ] `git commit -a`
- [ ] `git push origin DESTINATION`
- Add a 'Release Steps' comment
The 'Release Steps' are a reminder to the reviewer of the Pull Request of how to release the gem.
# Release
Complete these steps on DESTINATION
## `VERSION`
### Incompatible API changes
If your changes are incompatible with the previous branch's API, such as removing APIs or removing parts of API
signatures:
- [ ] Increment [`MAJOR`](lib/metasploit/yard/version.rb)
- [ ] Reset [`MINOR`](lib/metasploit/yard/version.rb) to `0`
- [ ] Reset [`PATCH`](lib/metasploit/yard/version.rb) to `0`
- [ ] Commit
### Compatible API changes
If your changes are compatible with the previous branch's API, such as adding an API or adding options or optional
positional arguments to an API:
- [ ] Increment [`MINOR`](lib/metasploit/yard/version.rb)
- [ ] Reset [`PATCH`](lib/metasploit/yard/version.rb) to `0`.
- [ ] Commit
### Compatible bug fixes
If your changes are a bug fix that don't impact the APIs, then:
- [ ] Increment [`PATCH`](lib/metasploit/yard/version.rb)
- [ ] Commit
## JRuby
- [ ] `rvm use jruby@metasploit-yard`
- [ ] `rm Gemfile.lock`
- [ ] `bundle install`
- [ ] `rake release`
## MRI Ruby
- [ ] `rvm use ruby-2.1@metasploit-yard`
- [ ] `rm Gemfile.lock`
- [ ] `bundle install`
- [ ] `rake release`
Downstream dependencies
When releasing new versions, the following projects may need to be updated:
(no current downstream dependents)