Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
with:
# You should create a personal access token and store it in your repository
token: ${{ secrets.CI_USER_TOKEN }}
# The token is only needed for this checkout. Later steps pass it explicitly via env
# and do not use git, so do not leave it in .git/config.
persist-credentials: false
repository: 'optimizely/travisci-tools'
path: 'home/runner/travisci-tools'
ref: 'master'
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '3.0.0', '3.1.0', '3.2.0', '3.3.0' ]
ruby: [ '3.0', '3.1', '3.2', '3.3' ]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install rubocop 1.78.0 for Ruby 3.0.0
if: matrix.ruby == '3.0.0'
- name: Install rubocop 1.78.0 for Ruby 3.0
if: matrix.ruby == '3.0'
run: |
echo "Installing rubocop 1.78.0 for Ruby 3.0.0"
echo "Installing rubocop 1.78.0 for Ruby 3.0"
bundle add rubocop --version 1.78.0 || true
bundle install
bundle exec rubocop -A Gemfile || true
Expand Down
3 changes: 3 additions & 0 deletions lib/optimizely/cmab/cmab_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ def hash_attributes(attributes)
# @param attributes [Hash] The attributes to be hashed.
# @return [String] The MD5 hash of the sorted and serialized attributes.
sorted_attrs = JSON.generate(attributes.sort.to_h)
# MD5 is intentional: this is only a fast fingerprint to detect changed attribute values in the local
# CMAB cache (computed on every CMAB evaluation). It is not used for security, so a cryptographic hash is not needed.
# nosemgrep: ruby.lang.security.weak-hashes-md5.weak-hashes-md5
Digest::MD5.hexdigest(sorted_attrs)
end
end
Expand Down
2 changes: 2 additions & 0 deletions spec/bucketing_holdout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
require 'optimizely/logger'

# Helper class for testing with controlled bucket values
# This is a plain Ruby test double, not a Rails model, so the mass assignment (attr_accessible) rule does not apply.
# nosemgrep: ruby.lang.security.model-attributes-attr-accessible.model-attributes-attr-accessible
class TestBucketer < Optimizely::Bucketer
def initialize(logger)
super(logger)
Expand Down
Loading