mneethiraj commented on code in PR #1167:
URL: https://github.com/apache/ranger/pull/1167#discussion_r3825033111


##########
.github/workflows/ci.yml:
##########
@@ -107,15 +111,19 @@ jobs:
       - name: Download DB and Log4J connectors
         run: |
           cd dev-support/ranger-docker
-          ./download-archives.sh none
+          # Kafka archive is needed to build the ranger-kafka image (audit 
pipeline).
+          ./download-archives.sh kafka
       
       - name: Build all ranger-service images
         run: |
           cd dev-support/ranger-docker
           export RANGER_DB_TYPE=postgres
+          # OpenSearch is the default audit index store; it is brought up only 
via the audit service.

Review Comment:
   Comment at line 121 is repeated 4 times; to keep this file readable, I 
suggest getting rid of this comment.



##########
audit-server/audit-dispatcher/dispatcher-common/src/main/java/org/apache/ranger/audit/dispatcher/kafka/AuditDispatcherBase.java:
##########
@@ -102,6 +102,13 @@ public AuditDispatcherBase(Properties props, String 
propPrefix, String dispatche
         topicName  = MiscUtil.getStringProperty(props, propPrefix + "." + 
AuditServerConstants.PROP_TOPIC_NAME, AuditServerConstants.DEFAULT_TOPIC);
     }
 
+    // Package-private: for unit tests only — skips Kafka/consumer 
initialisation.
+    AuditDispatcherBase() {
+        this.dispatcherGroupId = "test";

Review Comment:
   Instead of hardcoded string `"test"` in the product code, consider having it 
passed as a parameter from the test code.
   ```
   AuditDispatcherBase(String dispatcherGroupId, KafkaConsumer<String, String> 
dispatcher, String topicName) {
     this.dispatcherGroupId = dispatcherGroupId;
     this.dispatcher        = dispatcher;
     this.topicName         = topicName;
   }
   ```
   
   Corresponding updates will be needed in `AuditOpenSearchDispatcher()` and 
`TestAuditOpenSearchDispatcher.setUp()` as well.



##########
dev-support/ranger-docker/.env:
##########
@@ -53,6 +53,14 @@ TAGSYNC_VERSION=3.0.0-SNAPSHOT
 # PDP Configuration
 PDP_VERSION=3.0.0-SNAPSHOT
 
+# Audit index store for docker-compose.ranger-audit-service.yml (solr | 
opensearch).
+# Only the matching store container + its dispatcher come up (never both).
+AUDIT_INDEX_STORE=opensearch
+# AUDIT_INDEX_STORE drives Compose profiles, so a single variable selects the 
store.
+# To ALSO fan audits out to HDFS, add the hdfs profile only when ranger-hadoop 
is up:
+#   export COMPOSE_PROFILES=$AUDIT_INDEX_STORE,hdfs
+COMPOSE_PROFILES=${AUDIT_INDEX_STORE}

Review Comment:
   `COMPOSE_PROFILES` - the name doesn't convey the purpose of this variable. 
Also, it is not clear where this is used. Consider removing this or renaming it 
to something like `AUDIT_DESTINATIONS`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to