damccorm commented on code in PR #29121:
URL: https://github.com/apache/beam/pull/29121#discussion_r1370614351


##########
.test-infra/jenkins/metrics_report/report_generator.py:
##########
@@ -27,11 +27,16 @@
 
 INFLUXDB_USER = os.getenv("INFLUXDB_USER")
 INFLUXDB_USER_PASSWORD = os.getenv("INFLUXDB_USER_PASSWORD")
-WORKING_SPACE = os.getenv("WORKSPACE", "")
-PERF_DASHBOARDS = os.path.join(
-    WORKING_SPACE,
-    "src/.test-infra/metrics/grafana/dashboards/perftests_metrics/")
-
+if "GITHUB_RUN_ID" in os.environ:
+  WORKING_SPACE = os.getenv("GITHUB_WORKSPACE", "")
+  PERF_DASHBOARDS = os.path.join(
+      WORKING_SPACE,
+      ".test-infra/metrics/grafana/dashboards/perftests_metrics/")
+else:
+  WORKING_SPACE = os.getenv("WORKSPACE", "")
+  PERF_DASHBOARDS = os.path.join(
+      WORKING_SPACE,
+      "src/.test-infra/metrics/grafana/dashboards/perftests_metrics/")

Review Comment:
   Then we also don't need to pass through `GITHUB_RUN_ID`



##########
.test-infra/jenkins/metrics_report/report_generator.py:
##########
@@ -27,11 +27,16 @@
 
 INFLUXDB_USER = os.getenv("INFLUXDB_USER")
 INFLUXDB_USER_PASSWORD = os.getenv("INFLUXDB_USER_PASSWORD")
-WORKING_SPACE = os.getenv("WORKSPACE", "")
-PERF_DASHBOARDS = os.path.join(
-    WORKING_SPACE,
-    "src/.test-infra/metrics/grafana/dashboards/perftests_metrics/")
-
+if "GITHUB_RUN_ID" in os.environ:
+  WORKING_SPACE = os.getenv("GITHUB_WORKSPACE", "")
+  PERF_DASHBOARDS = os.path.join(
+      WORKING_SPACE,
+      ".test-infra/metrics/grafana/dashboards/perftests_metrics/")
+else:
+  WORKING_SPACE = os.getenv("WORKSPACE", "")
+  PERF_DASHBOARDS = os.path.join(
+      WORKING_SPACE,
+      "src/.test-infra/metrics/grafana/dashboards/perftests_metrics/")

Review Comment:
   ```suggestion
   # If in GitHub Actions, use the actions workspace, else use the default 
workspace
   WORKING_SPACE = os.getenv("GITHUB_WORKSPACE", os.getenv("WORKSPACE", ""))
   PERF_DASHBOARDS = os.path.join(
       WORKING_SPACE,
       "src/.test-infra/metrics/grafana/dashboards/perftests_metrics/")
   ```
   
   Nit, I think we can simplify this a bit



-- 
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