Skip to content
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

Adjustments enabling change-specific PackageInfo #8602

Merged
merged 9 commits into from
Jul 18, 2024

Conversation

scbedd
Copy link
Member

@scbedd scbedd commented Jul 10, 2024

Effectively, this allows Save-Package-Properties to honor the diff file.

In practice it looks like this

todo:

  • Do we want to keep ServiceInput or duplicate this thing into another script entirely?
  • Remove debugging outputs

On my build phase, this is the yml gating access to the filter

- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
    - pwsh: |
        mkdir -p $(Build.ArtifactStagingDirectory)/diff
      displayName: Create PR Diff Folder

    - task: PowerShell@2
      inputs:
        filePath: 'eng/common/scripts/Generate-PR-Diff.ps1'
        arguments: '-TargetPath "$(Build.SourcesDirectory)" -ArtifactPath $(Build.ArtifactStagingDirectory)/diff'
      displayName: 'Generate PR Diff'

    - pwsh: |
        Write-Host "We freshly generated the PR diff, and this is what it sees!"
        Get-ChildItem -R -Force $(Build.ArtifactStagingDirectory)/diff | % { $_.FullName }
        cat $(Build.ArtifactStagingDirectory)/diff/diff.json
      displayName: Dump PR Diff

    - task: Powershell@2
      inputs:
        filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
        arguments: >
          -ServiceInput $(Build.ArtifactStagingDirectory)/diff/diff.json
          -OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo
        pwsh: true
        workingDirectory: $(Pipeline.Workspace)
      displayName: Save package properties filtered for PR
  - ${{ else }}:
    - task: Powershell@2
      inputs:
        filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
        arguments: >
          -ServiceInput ${{parameters.ServiceDirectory}}
          -OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo
        pwsh: true
        workingDirectory: $(Pipeline.Workspace)
      displayName: Save package properties for service

Everywhere else that may need to do work against the changeset will get this packages artifact, then utilize it to determine targeted packages

  - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
    # if we are in a PR, utilize the fact that the package properties folder will already be downloaded in the Packages folder
    # any json file that exists within the PackagePropertiesFolder will be added to the targeting string
    - pwsh: |
        $packageProperties = Get-ChildItem -Recurse -Force "${{ parameters.PackagePropertiesFolder }}" `
          | Where-Object { $_.Extension -eq '.json' } `
          | Foreach-Object { $_.Name } `
          | ForEach-Object { $_.Replace(".json", "") }

        $setting = $packageProperties -join ","

        Write-Host "Setting TargetingString to $setting"
        Write-Host "##vso[task.setvariable variable=TargetingString;]$setting"
      displayName: Check override of targeting string by variable for PR builds

What this specifically willl vary per language. For Python it's just setting TargetingString variable to a comma separated list of package names.

EDIT: the rebase worked. got through android patch.

…sion on the serviceInput parameter. probably want to go to a separate script entirely?

add missing line
@scbedd scbedd self-assigned this Jul 10, 2024
@scbedd scbedd requested a review from a team as a code owner July 10, 2024 23:21
@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

scbedd added a commit to Azure/azure-sdk-for-js that referenced this pull request Jul 18, 2024
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#8602 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: Scott Beddall (from Dev Box) <[email protected]>
Co-authored-by: Scott Beddall <[email protected]>
Co-authored-by: Wes Haggard <[email protected]>
@scbedd scbedd merged commit 8748ba8 into main Jul 18, 2024
12 checks passed
@scbedd scbedd deleted the feature/pr-build-adjustments branch July 18, 2024 19:00
WhitShake pushed a commit to WhitShake/azure-sdk-tools that referenced this pull request Jul 24, 2024
* add additional argument to Save-Package-Properties to allow for usage in pull request context

---------

Co-authored-by: Scott Beddall (from Dev Box) <[email protected]>
Co-authored-by: Scott Beddall <[email protected]>
Co-authored-by: Wes Haggard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants