-
Notifications
You must be signed in to change notification settings - Fork 332
Add CFSClean enforcement #9144
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
base: main
Are you sure you want to change the base?
Add CFSClean enforcement #9144
Changes from all commits
0141a6e
7a16aad
2d4010d
2087f9b
13da89d
31fc73d
b4e3d8b
5906b98
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.7.1 | ||
| 0.7.2 | ||
|
chidozieononiwu marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,41 @@ | ||
| parameters: | ||
| - name: npmrcPath | ||
| type: string | ||
| # When empty, defaults to the agent user's .npmrc ($HOME/.npmrc on | ||
| # Linux/macOS, %USERPROFILE%\.npmrc on Windows) so every subsequent | ||
| # npm / pnpm / npx call in the job inherits the registry + auth. | ||
| default: "" | ||
| - name: registryUrl | ||
| type: string | ||
| default: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/" | ||
| - name: CustomCondition | ||
| type: string | ||
| default: succeeded() | ||
| - name: ServiceConnection | ||
| type: string | ||
| default: '' | ||
| default: "" | ||
|
|
||
| steps: | ||
| - pwsh: | | ||
| Write-Host "Creating .npmrc file ${{ parameters.npmrcPath }} for registry ${{ parameters.registryUrl }}" | ||
| $parentFolder = Split-Path -Path '${{ parameters.npmrcPath }}' -Parent | ||
|
|
||
| if (!(Test-Path $parentFolder)) { | ||
| Write-Host "Creating folder $parentFolder" | ||
| New-Item -Path $parentFolder -ItemType Directory | Out-Null | ||
| } | ||
| - pwsh: | | ||
| $npmrcPath = '${{ parameters.npmrcPath }}' | ||
| if (-not $npmrcPath) { $npmrcPath = Join-Path $HOME '.npmrc' } | ||
|
|
||
| $content = "registry=${{ parameters.registryUrl }}`n`nalways-auth=true" | ||
| $content | Out-File '${{ parameters.npmrcPath }}' | ||
| displayName: 'Create .npmrc' | ||
| condition: ${{ parameters.CustomCondition }} | ||
| Write-Host "Creating .npmrc file $npmrcPath for registry ${{ parameters.registryUrl }}" | ||
| $parentFolder = Split-Path -Path $npmrcPath -Parent | ||
|
|
||
| - task: npmAuthenticate@0 | ||
| displayName: Authenticate .npmrc | ||
| condition: ${{ parameters.CustomCondition }} | ||
| inputs: | ||
| workingFile: ${{ parameters.npmrcPath }} | ||
| azureDevOpsServiceConnection: ${{ parameters.ServiceConnection }} | ||
| if ($parentFolder -and -not (Test-Path $parentFolder)) { | ||
| Write-Host "Creating folder $parentFolder" | ||
| New-Item -Path $parentFolder -ItemType Directory | Out-Null | ||
| } | ||
|
|
||
| "registry=${{ parameters.registryUrl }}" | Out-File $npmrcPath | ||
| Write-Host "##vso[task.setvariable variable=resolvedNpmrcPath]$npmrcPath" | ||
| displayName: "Create .npmrc" | ||
| condition: ${{ parameters.CustomCondition }} | ||
|
|
||
| - task: npmAuthenticate@0 | ||
| displayName: Authenticate .npmrc | ||
| condition: ${{ parameters.CustomCondition }} | ||
| inputs: | ||
| workingFile: $(resolvedNpmrcPath) | ||
| azureDevOpsServiceConnection: ${{ parameters.ServiceConnection }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| parameters: | ||
|
chidozieononiwu marked this conversation as resolved.
|
||
| SourceDirectory: $(Build.SourcesDirectory) | ||
|
|
||
| steps: | ||
| # Copy mirror settings to default Maven location so all requests go through CFS | ||
| - pwsh: | | ||
| $m2Dir = if ($env:USERPROFILE) { "$env:USERPROFILE\.m2" } else { "$HOME/.m2" } | ||
| New-Item -ItemType Directory -Force -Path $m2Dir | Out-Null | ||
| Copy-Item -Path "${{ parameters.SourceDirectory }}/eng/settings.xml" -Destination "$m2Dir/settings.xml" | ||
| displayName: "Setup Maven mirror settings" | ||
| # Authenticate with Azure Artifacts feeds | ||
| # MavenAuthenticate adds <server> entries to ~/.m2/settings.xml matching mirror id 'azure-sdk-for-java' | ||
| - task: MavenAuthenticate@0 | ||
| displayName: "Maven Authenticate" | ||
| inputs: | ||
| artifactsFeeds: "azure-sdk-for-java" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| parameters: | ||
|
chidozieononiwu marked this conversation as resolved.
chidozieononiwu marked this conversation as resolved.
Member
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. Still open from my last pass, and I found the specific fix this time. This template already exists upstream as The Rename it to Related, so nobody "fixes" the wrong thing: |
||
| DevFeedName: "public/azure-sdk-for-python" | ||
| EnableTwineAuth: true | ||
| EnablePipAuth: true | ||
| EnableUvAuth: true | ||
|
|
||
| steps: | ||
| - pwsh: | | ||
| # For safety default to publishing to the private feed. | ||
| # Publish to https://dev.azure.com/azure-sdk/internal/_packaging?_a=feed&feed=azure-sdk-for-python-pr | ||
| $devopsFeedName = 'internal/azure-sdk-for-python-pr' | ||
| if (-not ('$(Build.Repository.Name)').EndsWith('-pr')) { | ||
| # Publish to https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-python | ||
| $devopsFeedName = '${{ parameters.DevFeedName }}' | ||
| } | ||
| echo "##vso[task.setvariable variable=DevFeedName]$devopsFeedName" | ||
| echo "Using DevopsFeed = $devopsFeedName" | ||
| displayName: Setup DevOpsFeedName | ||
|
|
||
| - ${{ if eq(parameters.EnableTwineAuth, true) }}: | ||
| - task: TwineAuthenticate@0 | ||
| displayName: "Twine Authenticate to feed" | ||
| inputs: | ||
| artifactFeeds: $(DevFeedName) | ||
|
|
||
| - ${{ if eq(parameters.EnablePipAuth, true) }}: | ||
| - task: PipAuthenticate@1 | ||
| displayName: "Pip Authenticate to feed" | ||
| inputs: | ||
| artifactFeeds: $(DevFeedName) | ||
| onlyAddExtraIndex: false | ||
|
|
||
| - ${{ if eq(parameters.EnableUvAuth, true) }}: | ||
| - pwsh: | | ||
| if ($env:PIP_INDEX_URL) { | ||
| Write-Host "Found pip index URL: $($env:PIP_INDEX_URL)" | ||
| # UV_DEFAULT_INDEX is the canonical replacement for the deprecated UV_INDEX_URL (uv 0.4.23+). | ||
| # PIP_INDEX_URL is set by PipAuthenticate@1 and contains embedded credentials, which uv | ||
| # will use for Basic auth against the ADO feed (and its PyPI upstream) per astral-sh/uv#12651. | ||
| Write-Host "##vso[task.setvariable variable=UV_DEFAULT_INDEX]$($env:PIP_INDEX_URL)" | ||
| # Disable keyring so uv uses the URL-embedded credentials directly. | ||
| Write-Host "##vso[task.setvariable variable=UV_KEYRING_PROVIDER]disabled" | ||
| } else { | ||
| Write-Host "##[warning]PIP_INDEX_URL not set - uv will fall back to public PyPI." | ||
| } | ||
| # Force any managed Python downloads to go directly to GitHub releases | ||
| # rather than the default CDN (releases.astral.sh). | ||
| Write-Host "##vso[task.setvariable variable=UV_PYTHON_INSTALL_MIRROR]https://github.com/astral-sh/python-build-standalone/releases/download" | ||
| displayName: "Configure UV Authentication" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,11 @@ jobs: | |
| timeoutInMinutes: 180 | ||
| steps: | ||
| - checkout: self | ||
|
|
||
| - template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml | ||
|
|
||
| - template: /eng/common/pipelines/templates/steps/maven-authenticate.yml | ||
|
chidozieononiwu marked this conversation as resolved.
|
||
|
|
||
| - template: /eng/pipelines/templates/steps/setup-go.yml | ||
|
|
||
| - template: /eng/pipelines/templates/steps/set-cli-version-cd.yml | ||
|
|
@@ -101,9 +106,21 @@ jobs: | |
| version: '9.x' | ||
| displayName: Set up .NET 9 | ||
|
|
||
| - bash: dotnet nuget add source --name azure-sdk-for-net https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json | ||
| displayName: Add Azure SDK dev nuget feed | ||
|
|
||
| - bash: dotnet nuget add source --name dotnet9 https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json | ||
| displayName: Add internal dotnet nuget feed | ||
|
|
||
| - template: /eng/common/pipelines/templates/steps/pypi-auth-dev-feed.yml | ||
|
chidozieononiwu marked this conversation as resolved.
|
||
| parameters: | ||
| EnableTwineAuth: false | ||
| EnablePipAuth: true | ||
| EnableUvAuth: false | ||
|
|
||
| - task: NuGetAuthenticate@1 | ||
| displayName: Authenticate NuGet feeds | ||
|
|
||
| - template: /eng/pipelines/templates/steps/configure-oidc-auth.yml | ||
|
|
||
| - pwsh: | | ||
|
|
@@ -154,6 +171,8 @@ jobs: | |
| # Code Coverage: Generate junit report to publish results | ||
| GOTESTSUM_JUNITFILE: junitTestReport.xml | ||
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
| PIP_INDEX_URL: $(PIP_INDEX_URL) | ||
| PIP_EXTRA_INDEX_URL: $(PIP_EXTRA_INDEX_URL) | ||
|
Member
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.
The template gives pip warns on a non-URL index and ignores it rather than failing, so nothing breaks. It's just log noise and a misleading env var. Drop the line. |
||
| # Disable MSBuild node reuse for Aspire-related tests. | ||
| # MSBuild node reuse is a pure performance optimization that is generally recommended to be disabled on CI environments | ||
| # that deal with short-lived processes. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | ||
| https://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
| <mirrors> | ||
| <mirror> | ||
| <id>azure-sdk-for-java</id> | ||
| <name>Azure Artifacts Maven Mirror</name> | ||
| <url>https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java/maven/v1</url> | ||
| <mirrorOf>external:*</mirrorOf> | ||
| </mirror> | ||
| </mirrors> | ||
| </settings> |
Uh oh!
There was an error while loading. Please reload this page.