fix(OFJAVA-011): CU-86akdypzd Slack channel ID hardcoded as literal argument in TestApplication instead of externalized config - #2323
Conversation
…stApplication instead of externalized config
| public static void main(String[] args) { | ||
| AllureJunitPlatform allureListener = new AllureJunitPlatform(); | ||
| SummaryGeneratingListener summaryListener = new SummaryGeneratingListener(); | ||
| SlackClient slackClient = new SlackClient(System.getenv("SLACK_OAUTH_TOKEN"), "C0AHS6C6G3H"); |
There was a problem hiding this comment.
🦩 🔴 Slack channel ID hardcoded as literal argument in TestApplication instead of externalized config
In TestApplication.main(), replaced the hardcoded Slack channel ID literal "C0AHS6C6G3H" with System.getenv("SLACK_CHANNEL_ID"), mirroring the adjacent SLACK_OAUTH_TOKEN env var pattern so the channel ID is externalized per-environment. Risk: this requires the SLACK_CHANNEL_ID environment variable to be set in all deployment/CI environments that previously relied on the inline default; if unset, SlackClient will receive null, which is unverified to be handled gracefully by SlackClient/SlackListener — a complete fix may need env docs/deployment config updates outside this file.
🤖 Prompt for AI agents
In openframe/services/openframe-test/src/main/java/com/openframe/test/TestApplication.java around line 26, review and complete this code-review fix: Slack channel ID hardcoded as literal argument in TestApplication instead of externalized config.
What the draft fix changed: In `TestApplication.main()`, replaced the hardcoded Slack channel ID literal `"C0AHS6C6G3H"` with `System.getenv("SLACK_CHANNEL_ID")`, mirroring the adjacent `SLACK_OAUTH_TOKEN` env var pattern so the channel ID is externalized per-environment. Risk: this requires the `SLACK_CHANNEL_ID` environment variable to be set in all deployment/CI environments that previously relied on the inline default; if unset, `SlackClient` will receive `null`, which is unverified to be handled gracefully by `SlackClient`/`SlackListener` — a complete fix may need env docs/deployment config updates outside this file.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟡 70 medium — react 👍/👎 to teach the reviewer
Closes findings from rule OFJAVA-011 — Slack channel ID hardcoded as literal argument in TestApplication instead of externalized config.
Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.
openframe/services/openframe-test/src/main/java/com/openframe/test/TestApplication.java:26What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.
Run: https://product-hub.flamingo.so/admin/code-review
Run id:
c1688cba-c9bc-481b-b917-2b7f45403ab4Merging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.
ClickUp task: CU-86akdypzd OpenFrame Kafka config hardcoding fixes (5 PRs)