Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions jf_agent/git/bitbucket_cloud_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,16 +514,20 @@ def _standardize_pr(
and api_pr['merge_commit']
and api_pr['merge_commit'].get('hash')
):
api_merge_commit = client.get_commit(
repo.project.id, repo_slug, api_pr['merge_commit']['hash']
)
merge_commit = _standardize_commit(
api_merge_commit,
repo,
api_pr['destination']['branch']['name'],
strip_text_content,
redact_names_and_urls,
)
merge_commit_hash = api_pr['merge_commit']['hash']
try:
api_merge_commit = client.get_commit(repo.project.id, repo_slug, merge_commit_hash)
merge_commit = _standardize_commit(
api_merge_commit,
repo,
api_pr['destination']['branch']['name'],
strip_text_content,
redact_names_and_urls,
)
except requests.exceptions.HTTPError as e:
logger.info(
f'For merge commit {merge_commit_hash} received a {e.response.status_code} while retrieving PR commits'
Comment on lines +528 to +529

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a regression test in commit 08c794a: test_get_prs_merge_commit_404_does_not_skip_pr stubs client.get_commit to raise HTTPError(404) and asserts the PR is still returned with merge_commit=None.

)

# Repo links
base_repo = _standardize_short_form_repo(
Expand Down
Loading