From c2d32c0d20c9aab0cfbc94e7ffc2c87310ee442f Mon Sep 17 00:00:00 2001 From: robfromboulder Date: Wed, 14 Aug 2024 05:13:09 -0600 Subject: [PATCH] Easier contributions on mac (#128) * Ignore .DS_Store files created on MacOS * Bind redis-server to localhost * Update CONTRIBUTING --- .gitignore | 1 + CONTRIBUTING.md | 33 ++++++++++++++++++- .../registry/S3PolicyServiceTest.java | 2 +- .../alerts/RedisAlertServiceTest.java | 2 +- .../RedisAnonymizationCacheServiceTest.java | 2 +- ...torBasedSpanDisambiguationServiceTest.java | 2 +- 6 files changed, 37 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 4ab6e4593..e088357af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store .metadata .cache .settings/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8dd142ac5..18fd7f636 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,36 @@ -# Code of Conduct +# Contributing to Phileas + +## Code of Conduct In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. Please read and understand the [Code of Conduct](https://github.com/philterd/phileas/blob/main/CODE_OF_CONDUCT.md). + +## GitHub Workflow + +We prefer to take contributions as GitHub pull requests. This workflow allows you to create your own copy of Phileas, try out some changes, and then share your changes back to the community, with proper review and feedback from other Phileas contributors. + +1. Create a fork of philterd/phileas +2. Create a feature branch +3. Build and test local changes +4. Commit changes to your feature branch +5. Open a pull request +6. Participate in code review +7. Celebrate your accomplishment + +## Building and Testing Changes + +### Required Tools + +* Java 17+ +* maven +* redis-server + +### Building on Linux + +Ubuntu is our daily driver, but any Linux distribution should work. + +### Building on MacOS + +In System Settings | Privacy & Security | Developer Tools, enable `Terminal` and `IntelliJ IDEA` (and other IDEs where you run tests). +Otherwise you'll get errors where `redis-server` fails to start when running tests. \ No newline at end of file diff --git a/phileas-core/src/test/java/ai/philterd/test/phileas/services/registry/S3PolicyServiceTest.java b/phileas-core/src/test/java/ai/philterd/test/phileas/services/registry/S3PolicyServiceTest.java index ad39e6ac5..744a4d945 100644 --- a/phileas-core/src/test/java/ai/philterd/test/phileas/services/registry/S3PolicyServiceTest.java +++ b/phileas-core/src/test/java/ai/philterd/test/phileas/services/registry/S3PolicyServiceTest.java @@ -122,7 +122,7 @@ public void before() throws IOException { api.start(); if(!isExternalRedis) { - redisServer = RedisServer.builder().port(31000).build(); + redisServer = RedisServer.builder().setting("bind 127.0.0.1").port(31000).build(); redisServer.start(); } diff --git a/phileas-services/phileas-services-alerts/src/test/java/ai/philterd/test/phileas/services/alerts/RedisAlertServiceTest.java b/phileas-services/phileas-services-alerts/src/test/java/ai/philterd/test/phileas/services/alerts/RedisAlertServiceTest.java index 9e8b7022f..028092d72 100644 --- a/phileas-services/phileas-services-alerts/src/test/java/ai/philterd/test/phileas/services/alerts/RedisAlertServiceTest.java +++ b/phileas-services/phileas-services-alerts/src/test/java/ai/philterd/test/phileas/services/alerts/RedisAlertServiceTest.java @@ -102,7 +102,7 @@ public static void beforeClass() { public void before() throws IOException { if(!isExternalRedis) { - redisServer = RedisServer.builder().port(31000).build(); + redisServer = RedisServer.builder().setting("bind 127.0.0.1").port(31000).build(); redisServer.start(); } else { // Clear alerts from the cache. diff --git a/phileas-services/phileas-services-anonymization/src/test/java/ai/philterd/test/phileas/services/anonymization/cache/RedisAnonymizationCacheServiceTest.java b/phileas-services/phileas-services-anonymization/src/test/java/ai/philterd/test/phileas/services/anonymization/cache/RedisAnonymizationCacheServiceTest.java index 4656c7a68..cb920d13e 100644 --- a/phileas-services/phileas-services-anonymization/src/test/java/ai/philterd/test/phileas/services/anonymization/cache/RedisAnonymizationCacheServiceTest.java +++ b/phileas-services/phileas-services-anonymization/src/test/java/ai/philterd/test/phileas/services/anonymization/cache/RedisAnonymizationCacheServiceTest.java @@ -94,7 +94,7 @@ public static void beforeClass() { public void before() { if(!isExternalRedis) { - redisServer = RedisServer.builder().port(31000).build(); + redisServer = RedisServer.builder().setting("bind 127.0.0.1").port(31000).build(); redisServer.start(); } diff --git a/phileas-services/phileas-services-disambiguation/src/test/java/ai/philterd/test/phileas/services/disambiguation/RedisVectorBasedSpanDisambiguationServiceTest.java b/phileas-services/phileas-services-disambiguation/src/test/java/ai/philterd/test/phileas/services/disambiguation/RedisVectorBasedSpanDisambiguationServiceTest.java index 835436ede..e27e0b0a5 100644 --- a/phileas-services/phileas-services-disambiguation/src/test/java/ai/philterd/test/phileas/services/disambiguation/RedisVectorBasedSpanDisambiguationServiceTest.java +++ b/phileas-services/phileas-services-disambiguation/src/test/java/ai/philterd/test/phileas/services/disambiguation/RedisVectorBasedSpanDisambiguationServiceTest.java @@ -40,7 +40,7 @@ public class RedisVectorBasedSpanDisambiguationServiceTest { @BeforeEach public void before() { - redisServer = RedisServer.builder().port(31000).build(); + redisServer = RedisServer.builder().setting("bind 127.0.0.1").port(31000).build(); redisServer.start(); }