eng, replace Maven Central with Azure Artifacts feed in automation scripts#49125
Open
XiaofeiCao wants to merge 1 commit intomainfrom
Open
eng, replace Maven Central with Azure Artifacts feed in automation scripts#49125XiaofeiCao wants to merge 1 commit intomainfrom
XiaofeiCao wants to merge 1 commit intomainfrom
Conversation
…scripts - Updated MAVEN_HOST in parameters.py to use Azure Artifacts feed URL - Added SYSTEM_ACCESSTOKEN Bearer auth headers to requests in utils.py and generate_utils.py for CI environments - Added timeout=30 to all requests.get() calls missing timeouts - Exposed SYSTEM_ACCESSTOKEN env var in generation.yml pipeline steps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates eng/automation Python scripts and pipeline wiring to prefer the Azure Artifacts Maven feed over Maven Central, adding optional CI authentication and request timeouts to improve reliability in restricted build environments.
Changes:
- Switched
MAVEN_HOSTto the Azure Artifacts Maven feed URL for automation downloads. - Added optional
SYSTEM_ACCESSTOKENbearer authentication for Maven feed HTTP requests (CI-friendly) and added missingtimeout=30on relevantrequests.get()calls. - Updated
eng/automation/generation.ymlsteps to passSYSTEM_ACCESSTOKENinto generation scripts.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/automation/utils.py | Adds bearer auth + timeout to the Maven lookup used for GA version discovery. |
| eng/automation/parameters.py | Repoints Maven host constant from Maven Central to Azure Artifacts feed. |
| eng/automation/generation.yml | Exposes SYSTEM_ACCESSTOKEN to generation steps. |
| eng/automation/generate_utils.py | Adds bearer auth + timeout to jar download used for changelog/breaking-change comparison. |
| eng/automation/generate_data.py | Adds a timeout to HTTP reads in uri_file_read. |
Comments suppressed due to low confidence (1)
eng/automation/utils.py:418
get_latest_ga_versioncurrently fetches.../{group}/{artifact}and parses an HTML directory listing (<a href="...">) to discover GA versions. WithMAVEN_HOSTnow pointing at an Azure Artifacts Maven feed, that endpoint may not expose an HTML listing (or may change format), which can break GA version discovery and downstream changelog comparisons. Prefer querying.../{group}/{artifact}/maven-metadata.xmland parsing<version>elements (standard Maven repo behavior) to make this work reliably across Maven Central and Azure Artifacts (similar to how the PowerShell scripts querymaven-metadata.xml).
group_path = group_id.replace(".", "/")
headers = {}
token = os.environ.get("SYSTEM_ACCESSTOKEN")
if token:
headers["Authorization"] = f"Bearer {token}"
response = requests.get(f"{MAVEN_HOST}/{group_path}/{module}", headers=headers, timeout=30)
response.raise_for_status()
ga_version_pattern = r"<a href=\"(\d+\.\d+\.\d+)\/"
ga_versions = [v.group(1) for v in re.finditer(ga_version_pattern, response.text, re.S)]
weidongxu-microsoft
approved these changes
May 9, 2026
Member
weidongxu-microsoft
left a comment
There was a problem hiding this comment.
LGTM
but wait for EngSys
XiaofeiCao
commented
May 9, 2026
Comment on lines
+60
to
+61
| env: | ||
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
Contributor
Author
There was a problem hiding this comment.
This pipeline should no longer be used. Update here for consistency.
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.
Similar to PR #48817 (PowerShell scripts), this updates the Python automation scripts under
eng/automation/to use the Azure Artifacts internal feed instead of Maven Central.Key Changes
Feed URL Update:
MAVEN_HOST(repo1.maven.org) with Azure Artifacts feed URL (pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java/maven/v1)Authentication:
SYSTEM_ACCESSTOKENBearer auth headers to HTTP requests inutils.pyandgenerate_utils.pyfor CI environmentsSYSTEM_ACCESSTOKENis unset (local dev), requests proceed without authTimeout:
timeout=30to allrequests.get()calls that were missing timeoutsPipeline:
SYSTEM_ACCESSTOKENenv var ingeneration.ymlpipeline steps