fix(jira): update authentication to use Basic Auth instead of Bearer token#1233
fix(jira): update authentication to use Basic Auth instead of Bearer token#1233mwaykole merged 3 commits intoopendatahub-io:mainfrom
Conversation
|
The following are automatically added/executed:
Available user actions:
Supported labels{'/hold', '/verified', '/lgtm', '/cherry-pick', '/build-push-pr-image', '/wip'} |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughJira auth changed from token-based to Basic Authentication: code now reads PYTEST_JIRA_URL, PYTEST_JIRA_USERNAME, and PYTEST_JIRA_PASSWORD and builds a basic_auth (username, password) tuple. Verify secrets are stored securely and not logged (CWE-200, CWE-798). Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip You can validate your CodeRabbit configuration file in your editor.If your editor has YAML language server, you can enable auto-completion and validation by adding |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/GETTING_STARTED.md`:
- Around line 143-147: The docs currently tell users to export the API token
directly (PYTEST_JIRA_PASSWORD), which risks storing secrets in shell history;
update the snippet to stop showing a plaintext export and instead prompt for the
Jira API token interactively (use a silent read into PYTEST_JIRA_PASSWORD,
export that variable afterward) and add a newline/echo after the prompt; keep
the PYTEST_JIRA_URL and PYTEST_JIRA_USERNAME lines unchanged and mention the API
token source URL in a comment.
In `@utilities/jira.py`:
- Around line 33-35: The code calls JIRA(...) with credentials from os.getenv
which may be None; add a fail-fast validation before the JIRA(...) call to
ensure PYTEST_JIRA_USERNAME, PYTEST_JIRA_PASSWORD and PYTEST_JIRA_URL are
present (non-empty), and raise a clear exception (e.g., RuntimeError) with a
descriptive message if any are missing, then pass the validated values into
JIRA(...). Use the exact symbols from the diff (the JIRA(...) call and the env
var names) so the check sits immediately before the return.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 1a8da959-d4f8-4775-a7d5-a9f9742f3160
📒 Files selected for processing (2)
docs/GETTING_STARTED.mdutilities/jira.py
…token Signed-off-by: Milind waykole <mwaykole@redhat.com> Made-with: Cursor
|
tested and verified the changes |
|
Status of building tag latest: success. |
…token (opendatahub-io#1233) Made-with: Cursor Signed-off-by: Milind waykole <mwaykole@redhat.com> Signed-off-by: Shehan Saleem <ssaleem@redhat.com>
Changes:
for Basic Auth instead of PYTEST_JIRA_TOKEN for Bearer auth
and explain that PYTEST_JIRA_PASSWORD contains the API token
and warning against using PYTEST_JIRA_TOKEN which causes Bearer auth failures
Fixes 403 Forbidden errors during test collection and 404 errors in test code
when accessing Jira API.
Summary by CodeRabbit
Documentation
Refactor