Fix base64 encoding for ocm-container CLI compatibility#139
Conversation
Switch ALERT_DETAILS encoding from RawURLEncoding to RawStdEncoding. RawURLEncoding uses a URL-safe alphabet (-_) that the `base64 -d` CLI tool inside ocm-container doesn't understand. RawStdEncoding uses the standard alphabet (+/) which is compatible with `base64 -d`, while still avoiding = padding that breaks ocm-container's env var parsing. Created with assistance from Claude 🤖 <claude@anthropic.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
- main.go: suppress errcheck for deferred asyncWriter.Close() - model_test.go: suppress staticcheck SA9003 for placeholder empty branch - views.go: remove unused renderActionLogHeader function Created with assistance from Claude 🤖 <claude@anthropic.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR updates how the TUI passes PagerDuty alert details into ocm-container by changing the base64 encoding variant to improve CLI decode compatibility, and aligns related tests/docs cleanup.
Changes:
- Switch
ALERT_DETAILSencoding frombase64.RawURLEncodingtobase64.RawStdEncoding(still unpadded). - Update unit test expectations to match the new encoding/decoding behavior.
- Remove an unused view helper and adjust a couple of lint-related comments.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates the ALERT_DETAILS encoding note (but leaves some surrounding wording inconsistent). |
| pkg/tui/commands.go | Changes ALERT_DETAILS encoding to RawStdEncoding for better base64 -d compatibility. |
| pkg/tui/commands_test.go | Updates base64 encoding/decoding in tests to RawStdEncoding. |
| pkg/tui/views.go | Removes unused renderActionLogHeader() helper. |
| pkg/tui/model_test.go | Replaces a comment block with an empty if plus nolint. |
| main.go | Adds //nolint:errcheck to deferred asyncWriter.Close(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix inconsistent base64 encoding references in README - Remove empty if block in model_test.go Created with assistance from Claude 🤖 <claude@anthropic.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@clcollins PR #139 has been fully qualified. Qualification Summary:
Intent validation: The PR still fulfills its original intent — switching This PR is ready to merge. Qualified by Claude on behalf of @clcollins |
Summary
ALERT_DETAILSencoding frombase64.RawURLEncodingtobase64.RawStdEncodingRawURLEncodinguses URL-safe alphabet (-_) incompatible withbase64 -din ocm-containerRawStdEncodinguses standard alphabet (+/) thatbase64 -dunderstands, while still omitting=padding that breaks ocm-container's env var parsingasyncWriter.Close(), remove unusedrenderActionLogHeader()function, and remove empty test branchTest plan
echo $ALERT_DETAILS | base64 -d | jq .works inside ocm-container after login=padding characters appear in the encoded valuego test ./pkg/tui/...)🤖 Generated with Claude Code