Skip to content

PR-to-issue fixes for story points and priority#477

Open
Bala-Sakabattula wants to merge 3 commits into
release-engineering:mainfrom
Bala-Sakabattula:PR-to-issue-fixes
Open

PR-to-issue fixes for story points and priority#477
Bala-Sakabattula wants to merge 3 commits into
release-engineering:mainfrom
Bala-Sakabattula:PR-to-issue-fixes

Conversation

@Bala-Sakabattula
Copy link
Copy Markdown
Collaborator

Problem:
PRs are syncing as issues, but the story points and priority fields are not being synced.

Fix:
In the upstream layer, we already fetch GitHub project values such as estimate (used as story points) and priority for issues. The same logic has now been extended for PRs as well, ensuring that both story points and priority are synced correctly.

webbnh

This comment was marked as resolved.

@psss psss mentioned this pull request Jun 1, 2026
@Bala-Sakabattula
Copy link
Copy Markdown
Collaborator Author

@webbnh I made the changes as per suggestion can you please review it again..

@webbnh
Copy link
Copy Markdown
Collaborator

webbnh commented Jun 1, 2026

/retest

webbnh
webbnh previously approved these changes Jun 1, 2026
Copy link
Copy Markdown
Collaborator

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

The refactor turned out very nicely, thanks!

I've flagged a couple of things which I think you should consider, but I'm approving anyway.

Comment thread sync2jira/upstream_pr.py Outdated
Comment on lines +46 to +47
return None
token = config["sync2jira"].get("github_token")
headers = {"Authorization": "token " + token} if token else {}
github_client = Github(token, retry=5)
headers, github_client = u_issue._github_client(config)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Given that we have cross-module references, github_client() should not be named with an underscore prefix!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

changed the name to get_github_client ad if we remove underscore there will be conflict with local variable.

Comment thread tests/test_upstream_pr.py Outdated
Comment on lines +252 to +254
self.assertEqual(mock_reformat.call_count, expected_count)
self.assertEqual(mock_add_project.call_count, expected_count)
self.assertEqual(mock_pr_from_github.call_count, expected_count)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm inclined to think that these are implementation details which we don't really want to require -- whether these functions are called directly or a specific number of times is not part of the interface contract.

If you really want to exercise this, the assertions should be checking what was returned, not how it was instantiated.

Otherwise, we're locking ourselves into a particular implementation, which is counterproductive.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

replaced the three call-count assertions with a single assertion on the returned values — verifying that github_prs() yields exactly the PR objects produced by PR.from_github.

Comment thread sync2jira/upstream_pr.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants