Bug reports and pull requests are welcome on GitLab at https://gitlab.com/oauth-xx/masq2 . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
To submit a patch, please fork the project and create a patch with tests. Once you're happy with it send a pull request.
We so if you make changes, remember to update it.
Simply follow these instructions:
- Fork the repository
- Create your feature branch (
git checkout -b my-new-feature) - Make some fixes.
- Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Make sure to add tests for it. This is important, so it doesn't break in a future release.
- Create new Pull Request.
From time to time the appraisal gemfiles in gemfiles/ will need to be updated.
They are created and updated with the commands:
NOTE: We run on a fork of Appraisal.
Please upvote the PR for eval_gemfile support
BUNDLE_GEMFILE=Appraisal.root.gemfile bundle
BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal updateWhen adding an appraisal to CI check the runner tool cache to see which runner to use.
When fixing an issue in CI with a specific appraisal:
adsf local ruby 3.0.7 # or whatever version you need
BUNDLE_GEMFILE=Appraisal.root.gemfile bundle install
BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle # or whatever appraisal you need
BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle exec rake test # or whatever command failedTake a look at the reek list which is the file called REEK and find something to improve.
To refresh the reek list:
bundle exec reek > REEKTo run all tests
bundle exec rake testTo run a single test:
bundle exec ruby -I test file/path/to/test.rb --name test_name_that_is_realJust swap out the example file path and test name, to be something like below:
bundle exec ruby -I test test/functional/masq/sessions_controller_test.rb --name test_should_authenticate_with_password_and_yubico_otpRun all the default tasks, which includes running the gradually autocorrecting linter, rubocop-gradual.
bundle exec rakeOr just run the linter.
bundle exec rake rubocop_gradual:autocorrectYour picture could be here!
Made with contributors-img.
Also see GitLab Contributors: https://gitlab.com/oauth-xx/masq2/-/graphs/main
IMPORTANT: Your public key for signing gems will need to be picked up by the line in the
gemspec defining the spec.cert_chain (check the relevant ENV variables there),
in order to sign the new release.
See: RubyGems Security Guide
- Run
bin/setup && bin/rakeas a tests, coverage, & linting sanity check - Update the version number in
version.rb, and ensureCHANGELOG.mdreflects changes - Run
bin/setup && bin/rakeagain as a secondary check, and to updateGemfile.lock - Run
git commit -am "🔖 Prepare release v<VERSION>"to commit the changes - Run
git pushto trigger the final CI pipeline before release, & merge PRs- NOTE: Remember to check the build!
- Run
export GIT_TRUNK_BRANCH_NAME="$(git remote show origin | grep 'HEAD branch' | cut -d ' ' -f5)" && echo $GIT_TRUNK_BRANCH_NAME - Run
git checkout $GIT_TRUNK_BRANCH_NAME - Run
git pull origin $GIT_TRUNK_BRANCH_NAMEto ensure you will release the latest trunk code - Set
SOURCE_DATE_EPOCHsorake buildandrake releaseuse same timestamp, and generate same checksums- Run
export SOURCE_DATE_EPOCH=$EPOCHSECONDS && echo $SOURCE_DATE_EPOCH - If the echo above has no output, then it didn't work.
- Note that you'll need the
zsh/datetimemodule, if runningzsh. - In
bashyou can usedate +%sinstead, i.e.export SOURCE_DATE_EPOCH=$(date +%s) && echo $SOURCE_DATE_EPOCH
- Run
- Run
bundle exec rake build - Run
bin/gem_checksums(more context 1 and 2) to create SHA-256 and SHA-512 checksums- Checksums will be committed automatically by the script, but not pushed
- Run
bundle exec rake releasewhich will create a git tag for the version, push git commits and tags, and push the.gemfile to rubygems.org