Skip to content

Revert "fix(jira): update authentication to use Basic Auth instead of Bearer token"#1241

Merged
dbasunag merged 3 commits intomainfrom
revert-1233-jirafix
Mar 18, 2026
Merged

Revert "fix(jira): update authentication to use Basic Auth instead of Bearer token"#1241
dbasunag merged 3 commits intomainfrom
revert-1233-jirafix

Conversation

@dbasunag
Copy link
Copy Markdown
Collaborator

@dbasunag dbasunag commented Mar 17, 2026

Reverts #1233

Summary by CodeRabbit

  • Documentation
    • Updated Jira integration docs to reference PYTEST_JIRA_URL and PYTEST_JIRA_TOKEN; removed PYTEST_JIRA_USERNAME and PYTEST_JIRA_PASSWORD entries.
  • Chores
    • Jira test integration switched to token-based authentication using PYTEST_JIRA_TOKEN. Test marker examples remain unchanged.

@github-actions
Copy link
Copy Markdown

The following are automatically added/executed:

  • PR size label.
  • Run pre-commit
  • Run tox
  • Add PR author as the PR assignee
  • Build image based on the PR

Available user actions:

  • To mark a PR as WIP, add /wip in a comment. To remove it from the PR comment /wip cancel to the PR.
  • To block merging of a PR, add /hold in a comment. To un-block merging of PR comment /hold cancel.
  • To mark a PR as approved, add /lgtm in a comment. To remove, add /lgtm cancel.
    lgtm label removed on each new commit push.
  • To mark PR as verified comment /verified to the PR, to un-verify comment /verified cancel to the PR.
    verified label removed on each new commit push.
  • To Cherry-pick a merged PR /cherry-pick <target_branch_name> to the PR. If <target_branch_name> is valid,
    and the current PR is merged, a cherry-picked PR would be created and linked to the current PR.
  • To build and push image to quay, add /build-push-pr-image in a comment. This would create an image with tag
    pr-<pr_number> to quay repository. This image tag, however would be deleted on PR merge or close action.
Supported labels

{'/verified', '/build-push-pr-image', '/wip', '/cherry-pick', '/hold', '/lgtm'}

Comment thread utilities/jira.py Outdated
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 17, 2026

📝 Walkthrough

Walkthrough

Switched Jira authentication from username/password basic auth to token-based auth. Documentation and utility now require PYTEST_JIRA_TOKEN and no longer reference PYTEST_JIRA_USERNAME or PYTEST_JIRA_PASSWORD. (Ensure token storage and logging avoid exposure — see CWE-522.)

Changes

Cohort / File(s) Summary
Jira docs
docs/GETTING_STARTED.md
Updated setup instructions to remove PYTEST_JIRA_USERNAME/PYTEST_JIRA_PASSWORD and require PYTEST_JIRA_TOKEN and PYTEST_JIRA_URL.
Jira utility
utilities/jira.py
Rewrote Jira client construction to pass server via server= and use PYTEST_JIRA_TOKEN for token-based basic_auth; removed password-based auth/options usage. Verify token is not logged or printed (CWE-522).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal and only references the reverted issue without following the repository template structure. Complete the description template with Summary, Related Issues, How it has been tested, and Additional Requirements sections.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly indicates this PR reverts a previous commit and specifies the authentication change being undone.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-1233-jirafix
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@utilities/jira.py`:
- Around line 25-28: The cached JIRA client is being created with potentially
missing env vars (PYTEST_JIRA_TOKEN, PYTEST_JIRA_URL) so an invalid client could
be cached; update the function that returns JIRA (the one that calls JIRA(...)
under the `@cache` decorator) to explicitly read and validate
os.getenv("PYTEST_JIRA_TOKEN") and os.getenv("PYTEST_JIRA_URL") before
constructing the JIRA instance and raise a clear exception if either is
missing/empty, so the error is raised immediately and a bad client is never
stored in the cache.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 0620b3ff-ab87-46e4-a4dd-aaba3cee35b9

📥 Commits

Reviewing files that changed from the base of the PR and between 15b5606 and e5fda99.

📒 Files selected for processing (2)
  • docs/GETTING_STARTED.md
  • utilities/jira.py

Comment thread utilities/jira.py
Copy link
Copy Markdown
Member

@mwaykole mwaykole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbasunag is it working i was trying the same yday but that did not work for me

mwaykole
mwaykole previously approved these changes Mar 18, 2026
@github-actions github-actions bot added size/xs and removed size/s labels Mar 18, 2026
This reverts commit a8f5a88.

Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com>
Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com>
@dbasunag dbasunag force-pushed the revert-1233-jirafix branch from 9b521c3 to 3278c96 Compare March 18, 2026 15:40
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/GETTING_STARTED.md (1)

141-142: Consider rewording to avoid repetitive sentence starts.

Three consecutive sentences begin with "To", reducing readability.

♻️ Proposed rewording
-To skip running tests which have open bugs, [pytest_jira](https://github.com/rhevm-qe-automation/pytest_jira) plugin is used.
-To run tests with jira integration, you need to set `PYTEST_JIRA_URL` and `PYTEST_JIRA_TOKEN` environment variables.
-To make a test with jira marker, add: `@pytest.mark.jira(jira_id="RHOAIENG-0000", run=False)` to the test.
+To skip running tests which have open bugs, [pytest_jira](https://github.com/rhevm-qe-automation/pytest_jira) plugin is used.
+Enable jira integration by setting `PYTEST_JIRA_URL` and `PYTEST_JIRA_TOKEN` environment variables.
+Mark a test with jira by adding: `@pytest.mark.jira(jira_id="RHOAIENG-0000", run=False)` to the test.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/GETTING_STARTED.md` around lines 141 - 142, Reword the three sentences
that all start with "To" by combining and varying phrasing: mention environment
variables first (PYTEST_JIRA_URL and PYTEST_JIRA_TOKEN) as required for running
tests with Jira integration, then explain how to mark a test using
`@pytest.mark.jira`(jira_id="RHOAIENG-0000", run=False) in a separate sentence
that uses a different lead (e.g., "Mark a test with..." or "Use the marker...")
so the lines referencing PYTEST_JIRA_URL, PYTEST_JIRA_TOKEN and the pytest
marker are clearer and no longer repetitively start with "To".
🤖 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`:
- Line 141: Update the GETTING_STARTED.md test setup line to include
PYTEST_JIRA_USERNAME along with PYTEST_JIRA_URL and PYTEST_JIRA_TOKEN and add a
short security guidance sentence instructing developers to store these
credentials in environment variables or a secrets manager (or a gitignored .env)
and never hardcode them or print them to logs; reference utilities/jira.py and
its basic_auth tuple so readers know why PYTEST_JIRA_USERNAME is required and
emphasize avoiding commit of credentials to version control.

---

Nitpick comments:
In `@docs/GETTING_STARTED.md`:
- Around line 141-142: Reword the three sentences that all start with "To" by
combining and varying phrasing: mention environment variables first
(PYTEST_JIRA_URL and PYTEST_JIRA_TOKEN) as required for running tests with Jira
integration, then explain how to mark a test using
`@pytest.mark.jira`(jira_id="RHOAIENG-0000", run=False) in a separate sentence
that uses a different lead (e.g., "Mark a test with..." or "Use the marker...")
so the lines referencing PYTEST_JIRA_URL, PYTEST_JIRA_TOKEN and the pytest
marker are clearer and no longer repetitively start with "To".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 3d065a15-339a-49c4-9e79-bce576bf942a

📥 Commits

Reviewing files that changed from the base of the PR and between bf3dd40 and 7620f94.

📒 Files selected for processing (2)
  • docs/GETTING_STARTED.md
  • utilities/jira.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • utilities/jira.py

Comment thread docs/GETTING_STARTED.md
Copy link
Copy Markdown
Contributor

@fege fege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@dbasunag dbasunag merged commit f471c14 into main Mar 18, 2026
12 checks passed
@dbasunag dbasunag deleted the revert-1233-jirafix branch March 18, 2026 16:03
@github-actions
Copy link
Copy Markdown

Status of building tag latest: success.
Status of pushing tag latest to image registry: success.

ssaleem-rh pushed a commit to ssaleem-rh/opendatahub-tests that referenced this pull request Mar 23, 2026
… Bearer token" (opendatahub-io#1241)

* revert: undo jira auth change to Basic Auth

This reverts commit a8f5a88.

Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com>

* fix: updates needed in jira call

Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com>

---------

Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com>
Signed-off-by: Shehan Saleem <ssaleem@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants