Skip to content

Commit

Permalink
FF-2839 fix: update ruby-sdk/Cargo.lock to include eppo_core from cra…
Browse files Browse the repository at this point in the history
…tes.io
  • Loading branch information
rasendubi committed Jul 23, 2024
1 parent 3422e91 commit e879b19
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 31 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ jobs:
- run: npm ci
- run: make test-data

- name: Check Cargo.lock
# Ensure that Cargo.lock matches Cargo.toml
run: cargo generate-lockfile --locked
working-directory: ruby-sdk

- name: Override eppo_core for testing
run: >-
mkdir -p ~/.cargo/
echo "[patch.crates-io.eppo_core]" >> "${CARGO_HOME:-$HOME/.cargo}/config.toml"
echo "path = '$PWD/eppo_core'" >> "${CARGO_HOME:-$HOME/.cargo}/config.toml"
- name: Install dependencies
run: bundle install
working-directory: ruby-sdk
Expand Down
3 changes: 0 additions & 3 deletions ruby-sdk/.cargo/config.toml

This file was deleted.

4 changes: 4 additions & 0 deletions ruby-sdk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ target/

# rspec failure tracking
.rspec_status

# .cargo/config.toml should be used for testing with local version of
# eppo_core but it should not be committed.
/.cargo/config.toml
58 changes: 30 additions & 28 deletions ruby-sdk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions ruby-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,17 @@ Refer to our [SDK documentation](https://docs.geteppo.com/feature-flags/sdks/rub

## Supported Ruby Versions
This version of the SDK is compatible with Ruby 3.0.6 and above.

# Contributing

## Testing with local version of `eppo_core`

To run build and tests against a local version of `eppo_core`, you should instruct Cargo to look for it at the local path.

Add the following to `.cargo/config.toml` file (relative to `ruby-sdk`):
```toml
[patch.crates-io]
eppo_core = { path = '../eppo_core' }
```

Make sure you remove the override before updating `Cargo.lock`. Otherwise, the lock file will be missing `eppo_core` checksum and will be unsuitable for release. (CI will warn you if you do this accidentally.)

0 comments on commit e879b19

Please sign in to comment.