-
Notifications
You must be signed in to change notification settings - Fork 2k
Use Azure Artifacts feed only in CI, standard repos locally #35219
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
Changes from all commits
72cc860
0a2e892
5e67d8e
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 |
|---|---|---|
|
|
@@ -68,6 +68,11 @@ if [ -z "$TOKEN" ]; then | |
| fi | ||
| echo "Token acquired." | ||
|
|
||
| # Force Gradle to use the Azure Artifacts feed (same as CI) so that | ||
| # dependency resolution goes through the feed and triggers ingestion. | ||
| # Required because settings.gradle gates repo selection on TF_BUILD. | ||
| export TF_BUILD=True | ||
|
Contributor
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. 💡 Suggestion (2/3 consensus after follow-up) — Consider moving this |
||
|
|
||
| # Step 2: Ingest platform-specific artifacts for all OS variants | ||
| # Gradle only resolves the classifier for the current OS (e.g. aapt2-osx.jar on macOS). | ||
| # CI builds on Windows/Linux need their variants pre-ingested too. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,41 @@ | ||
| // Project Maven dependencies are resolved through the dnceng Azure Artifacts | ||
| // feed (dotnet-public-maven) for CFSClean network isolation compliance. The feed | ||
| // proxies Maven Central, Google Maven, and Gradle Plugin Portal. The credential | ||
| // provider plugin is fetched from a separate Azure Artifacts feed (artifacts-public). | ||
| // In CI (CFSClean network isolation), Maven dependencies resolve through the | ||
| // dnceng Azure Artifacts feed (dotnet-public-maven). Locally, standard Maven | ||
| // Central and Google Maven are used for faster builds. | ||
| // | ||
| // IMPORTANT: New packages must be ingested into the feed before CI can use them. | ||
| // The CI credential provider plugin skips auth in Azure Pipelines, so packages | ||
| // that aren't already in the feed will fail with 401. After adding or updating | ||
| // dependencies, run: | ||
| // | ||
| // ./eng/ingest-maven-deps.sh | ||
| // IMPORTANT: New packages must be ingested before CI can use them. | ||
| // If CI fails with "Could not GET ... 401", the package is not yet in the feed. | ||
| // Run ./eng/ingest-maven-deps.sh after adding or updating any Maven dependency. | ||
| // | ||
| // In CI, eng/init.gradle (injected by cache-gradle.yml) also handles | ||
| // project-level repo substitution for Android SDK binding targets. | ||
| // See: https://aka.ms/1es/netiso/CFS | ||
|
Contributor
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. 💡 Minor — Cross-reference to
|
||
|
|
||
| pluginManagement { | ||
|
Contributor
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. 🟢 Minor (2/3 consensus after follow-up) — Currently, AGP resolution works because If a future refactor removes the Suggestion: A brief comment noting this relationship would help future maintainers avoid accidentally breaking CI when modernizing the Gradle setup, e.g.: // NOTE: pluginManagement repos are currently secondary — AGP resolves via
// buildscript.dependencies in build.gradle. If buildscript is removed,
// this block becomes load-bearing for CI plugin resolution. |
||
| repositories { | ||
| maven { | ||
| url = 'https://pkgs.dev.azure.com/artifacts-public/PublicTools/_packaging/AzureArtifacts/maven/v1' | ||
| name = 'AzureArtifacts' | ||
| } | ||
| maven { | ||
| url = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-maven/maven/v1' | ||
| name = 'dotnet-public-maven' | ||
| if ((System.getenv('TF_BUILD') ?: '').equalsIgnoreCase('true')) { | ||
|
Contributor
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. 💡 Minor — CI plugin resolution depends on feed proxy coverage [2/3 consensus] In CI mode, |
||
| maven { | ||
| url = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-maven/maven/v1' | ||
| name = 'dotnet-public-maven' | ||
| } | ||
| } else { | ||
| google() | ||
| mavenCentral() | ||
| gradlePluginPortal() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| plugins { | ||
| id 'com.microsoft.azure.artifacts.credprovider' version '1.1.1' | ||
| } | ||
|
|
||
| dependencyResolutionManagement { | ||
| repositoriesMode.set(RepositoriesMode.PREFER_PROJECT) | ||
| repositories { | ||
| maven { | ||
| url = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-maven/maven/v1' | ||
| name = 'dotnet-public-maven' | ||
| if ((System.getenv('TF_BUILD') ?: '').equalsIgnoreCase('true')) { | ||
| maven { | ||
| url = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-maven/maven/v1' | ||
| name = 'dotnet-public-maven' | ||
| } | ||
| } else { | ||
| google() | ||
| mavenCentral() | ||
| } | ||
| } | ||
| } | ||
|
|
||
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.
💡 Minor (3/3 consensus after follow-up)
The comment explains what this does ("same as CI") but not why it's now required. The causal link — that
settings.gradleconditionally gates the Azure Artifacts path on this variable — is non-obvious to someone reading this file in isolation.Suggestion: Add a cross-reference: