-
Notifications
You must be signed in to change notification settings - Fork 41
OCPERT-154: Change urls to Atlassian Cloud #930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -706,7 +706,7 @@ def jira_notificator(search_batch_size: int, dry_run: bool, from_date: Optional[ | |
| if not jira_token: | ||
| raise RuntimeError("JIRA token is missing or empty. Please set the JIRA_TOKEN environment variable.") | ||
|
|
||
| jira = JIRA(server="https://issues.redhat.com", token_auth=jira_token) | ||
| jira = JIRA(server="https://redhat.atlassian.net/jira", token_auth=jira_token) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's examine the file and the specific line
wc -l oar/notificator/jira_notificator.pyRepository: openshift/release-tests Length of output: 106 🏁 Script executed: # Read the context around line 709
sed -n '700,720p' oar/notificator/jira_notificator.pyRepository: openshift/release-tests Length of output: 519 🏁 Script executed: # Search for all JIRA() instantiations in the codebase
rg "JIRA\(" -A 2 -B 2Repository: openshift/release-tests Length of output: 1164 🏁 Script executed: # Look for any Jira API calls to understand how the client is used
rg "jira\." oar/notificator/jira_notificator.py | head -20Repository: openshift/release-tests Length of output: 273 🏁 Script executed: # Check for any configuration or comments about Jira URL
rg "redhat\.atlassian" .Repository: openshift/release-tests Length of output: 1636 🏁 Script executed: # Look for any tests related to Jira
fd -e test -e spec | xargs rg -l "jira" 2>/dev/null | head -10Repository: openshift/release-tests Length of output: 315 🏁 Script executed: # Find the get_jira_server() definition
rg "get_jira_server" -B 3 -A 5Repository: openshift/release-tests Length of output: 1003 🏁 Script executed: # Check oar/core/jira.py for full context
cat -n oar/core/jira.pyRepository: openshift/release-tests Length of output: 22782 🏁 Script executed: # Check oar/core/const.py for configuration
cat oar/core/const.pyRepository: openshift/release-tests Length of output: 6644 🏁 Script executed: # Find where jira_server is configured
rg "jira_server" -B 3 -A 3Repository: openshift/release-tests Length of output: 935 🏁 Script executed: # Look for ConfigStore initialization and configuration
rg "class ConfigStore" -A 20Repository: openshift/release-tests Length of output: 3463 🌐 Web query:
💡 Result: For Atlassian Cloud with the
Example: from jira import JIRA
jira = JIRA(server="https://yourcompany.atlassian.net",
basic_auth=("you@example.com", "your_api_token"))Don’t include a Server/DC-style context path like Sources: Atlassian Community example for Jira Cloud + jira-python [1]; pycontribs/jira issue showing Cloud 🏁 Script executed: # Check AGENTS.md to see the documented Jira testing URL
cat AGENTS.md | grep -A 2 -B 2 "redhat.atlassian.net"Repository: openshift/release-tests Length of output: 393 🏁 Script executed: # Check if there's any documentation about the config initialization
fd -name "*.md" -o -name "*.yaml" | xargs grep -l "jira_server" 2>/dev/nullRepository: openshift/release-tests Length of output: 299 🏁 Script executed: # Look at how the jira_notificator_jira.py function is structured
cat -n oar/notificator/jira_notificator.py | head -50Repository: openshift/release-tests Length of output: 1793 Remove the The Additionally, consider moving the URL to configuration (similar to how 🤖 Prompt for AI Agents |
||
|
|
||
| ns = NotificationService(jira, dry_run) | ||
| ns.process_on_qa_issues(search_batch_size, from_date) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ class TestJiraNotificator(unittest.TestCase): | |
|
|
||
| def setUp(self): | ||
| jira_token = os.environ.get("JIRA_TOKEN") | ||
| self.jira = JIRA(server="https://issues.redhat.com", token_auth=jira_token) | ||
| self.jira = JIRA(server="https://redhat.atlassian.net/jira", token_auth=jira_token) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for JIRA server URL usages and token_auth patterns
echo "=== Files mentioning atlassian.net ==="
rg -l "atlassian\.net" --type=py
echo -e "\n=== JIRA server URL usages (context) ==="
rg -n --type=py "atlassian\.net" -A2 -B2
echo -e "\n=== token_auth usages in Python files ==="
rg -n --type=py "token_auth"
echo -e "\n=== JIRA client instantiations ==="
rg -n --type=py "JIRA\(" -A3Repository: openshift/release-tests Length of output: 5706 🏁 Script executed: #!/bin/bash
# Check for the main implementation file and related jira_notificator files
echo "=== Files related to jira_notificator ==="
find . -name "*jira*" -type f | grep -v __pycache__
echo -e "\n=== Check main implementation file (if exists) ==="
if [ -f "oar/notificator/jira_notificator.py" ]; then
echo "Found oar/notificator/jira_notificator.py"
grep -n "JIRA(" oar/notificator/jira_notificator.py | head -20
fiRepository: openshift/release-tests Length of output: 400 🏁 Script executed: #!/bin/bash
# Check oar/core/jira.py for the server configuration
echo "=== oar/core/jira.py content (first 50 lines) ==="
head -50 oar/core/jira.py
echo -e "\n=== Search for JIRA_SERVER or jira server config ==="
rg -n "get_jira_server|JIRA_SERVER" --type=py -B2 -A2
echo -e "\n=== Check config/settings files ==="
find . -name "config*" -o -name "settings*" -o -name "*constants*" | grep -v __pycache__ | head -20Repository: openshift/release-tests Length of output: 2281 🏁 Script executed: #!/bin/bash
# Check what get_jira_server returns in ConfigService
echo "=== Search for ConfigService and get_jira_server ==="
rg -n "class ConfigService|def get_jira_server" --type=py -A10Repository: openshift/release-tests Length of output: 712 🏁 Script executed: #!/bin/bash
# Look at actual usage in tests and check environment
echo "=== Check test_jira.py for any clues about server config ==="
head -100 tests/test_jira.py
echo -e "\n=== Check for any existing uses of basic_auth in codebase ==="
rg -n "basic_auth" --type=pyRepository: openshift/release-tests Length of output: 4103 🏁 Script executed: #!/bin/bash
# Check configstore.json for jira_server value
echo "=== oar/core/configstore.json ==="
cat oar/core/configstore.json | head -50
echo -e "\n=== Look for jira_server in the file ==="
rg -n "jira_server" oar/core/configstore.jsonRepository: openshift/release-tests Length of output: 2357 🏁 Script executed: #!/bin/bash
# Check for any README or documentation about Cloud migration
echo "=== Search for migration-related comments or docs ==="
rg -i "cloud|migration|atlassian" --type=md -B2 -A2 | head -50
echo -e "\n=== Check the PR/commit context if available ==="
git log --oneline -20 | head -20Repository: openshift/release-tests Length of output: 2973 🏁 Script executed: #!/bin/bash
# Let's verify what the jira library actually expects
# Search for any existing documentation or tests in the codebase
echo "=== Check if there are any docs about jira library usage ==="
find . -name "*.md" -o -name "*.txt" | xargs grep -l -i "jira" 2>/dev/null | head -10
echo -e "\n=== Check requirements or setup files for jira library version ==="
find . -name "requirements*" -o -name "setup.py" -o -name "pyproject.toml" | xargs grep -i jira 2>/dev/nullRepository: openshift/release-tests Length of output: 579 🌐 Web query:
💡 Result: For Atlassian Cloud, use Atlassian’s Cloud REST API “basic auth” is email address + API token (passwords are deprecated). [2] from jira import JIRA
jira = JIRA(
server="https://your-site.atlassian.net",
basic_auth=("you@company.com", "YOUR_ATLASSIAN_API_TOKEN"),
)Sources: [1] https://jira.readthedocs.io/examples.html [2] https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/ 🌐 Web query:
💡 Result: For the pycontribs
If you’re unsure what to use (especially with custom domains), query Jira for its canonical base URL and use the returned
Example (Cloud): from jira import JIRA
jira = JIRA(server="https://your-site.atlassian.net", basic_auth=("email@company.com", "api_token"))[1], [2] Sources: [1] pycontribs/jira README, [2] Atlassian “Basic auth for REST APIs” (Feb 6, 2026), [3] Atlassian Jira Cloud REST API intro, [4] Jira Cloud 🌐 Web query:
💡 Result: For Atlassian Jira Cloud with the from jira import JIRA
jira = JIRA(
server="https://YOUR_SITE.atlassian.net",
basic_auth=("you@company.com", "YOUR_ATLASSIAN_API_TOKEN"),
)Notes:
Sources
Correct server URL and authentication method for Atlassian Cloud compatibility. Two required fixes for Atlassian Cloud:
Correct Cloud-compatible pattern: self.jira = JIRA(
server="https://redhat.atlassian.net",
basic_auth=(os.environ.get("JIRA_EMAIL"), jira_token),
)Note: The same issues exist in 🤖 Prompt for AI Agents |
||
| self.ns = NotificationService(self.jira, True) | ||
|
|
||
| self.test_issue = self.jira.issue("OCPBUGS-59288", expand="changelog") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 94
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 5370
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 2968
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 237
🌐 Web query:
Jira Cloud browse URL format standard path atlassian.net💡 Result:
The standard Jira Cloud “browse issue” URL on an
atlassian.netsite is:https://{site}.atlassian.net/browse/{ISSUE-KEY}(example:https://mysite.atlassian.net/browse/PROJ-123) [1][2]Notes:
{site}is your Jira Cloud site subdomain (the part before.atlassian.net). [2]{ISSUE-KEY}is the issue key likePROJ-123. [1][2]Sources: Atlassian developer docs example for Jira issue URLs [1], Atlassian Developer Community confirmation of the format [2].
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 49
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 365
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 3979
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 225
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 512
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 161
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 1901
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 49
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 2523
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 49
🏁 Script executed:
Repository: openshift/release-tests
Length of output: 1613
Fix hardcoded Jira URL—it includes erroneous
/jirapath that breaks links.get_jira_link()generateshttps://redhat.atlassian.net/jira/browse/{key}, but Jira Cloud browse URLs use the formathttps://redhat.atlassian.net/browse/{key}without the/jirasuffix. Remove/jirafrom the hardcoded base URL. All links generated through this function (used in 13+ places across notifications and worksheets) are currently malformed.Fix
🤖 Prompt for AI Agents