refactor: rename get_async_azure_credential to build_async_azure_credential (address Copilot review on #915)#916
Merged
Conversation
…ential Addresses Copilot review feedback on PR #915 (merged into dev). The two helpers get_azure_credential_async (async fn) and get_async_azure_credential (sync fn) differ only by word order, which is easy to confuse at call sites. Renaming the sync builder to build_async_azure_credential makes the sync-vs-async distinction explicit: build_ implies sync construction, async describes the returned credential type. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Coverage Report •
|
||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Renames the sync helper get_async_azure_credential to build_async_azure_credential to disambiguate it from the existing async helper get_azure_credential_async, addressing a Copilot review comment from PR #915.
Changes:
- Renamed function definition in
azure_credential_utils.pyand clarified its docstring. - Updated the import and call site in
history_service.pyto use the new name.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/api/helpers/azure_credential_utils.py | Renames helper to build_async_azure_credential and improves docstring contrasting it with the async variant. |
| src/api/services/history_service.py | Updates import and call site in init_cosmosdb_client to use the new name. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Avijit-Microsoft
approved these changes
May 15, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
dev->mainmerge in PR chore: dev to main merge #914.get_async_azure_credentialalongside the existing async helperget_azure_credential_async. The two names differ only by word order, which is easy to confuse at call sites — andhistory_service.pynow imports both side-by-side.build_async_azure_credentialso the sync-vs-async distinction is explicit at every call site (build_implies sync construction;asyncdescribes the returned credential type). No behavioral change.Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
src/api/helpers/azure_credential_utils.py—get_async_azure_credentialis renamed tobuild_async_azure_credential; signature, branching onAPP_ENV, and returned credential types are unchanged.src/api/services/history_service.py— import on line 8 and call site ininit_cosmosdb_client(line 49) updated to the new name.get_azure_credential_async(the original async helper, used in theasync withblock on line 73) is left untouched.flake8 --config=.flake8 src/apipasses locally.Other Information
build_async_azure_credential(one of Copilot's two suggestions) becausebuild_is a common Python idiom for sync factory functions and reads more naturally than the_syncsuffix variant.