Skip to content

Fix scoped builds crashing on integration publishing#46233

Merged
scbedd merged 3 commits intomainfrom
copilot/fix-integration-publishing-crash
Apr 10, 2026
Merged

Fix scoped builds crashing on integration publishing#46233
scbedd merged 3 commits intomainfrom
copilot/fix-integration-publishing-crash

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

  • Understand the new approach: match artifact name against BuildTargetingString globs
  • Replace Test-Path check with BuildTargetingString glob matching in Integration stage
  • Validate (parallel_validation passed)
Original prompt

Context

Issue: Scoped builds crash on integration publishing
Repo: Azure/azure-sdk-for-python
Issue: #42014 (assigned to @scbedd)

When a developer queues a build that is scoped via BuildTargetingString and attempts to publish to integration with SetDevVersion=true, the build fails because the pipeline expects an artifact/package that was filtered out by the targeting string and therefore does not exist.

The issue body states the desired behavior:

  • This should work.
  • Integration publishing should gracefully skip publishing a package when the build targeting string doesn't apply (i.e., the package was not built / artifact not produced).

There is a failing Azure DevOps build log referenced in the issue:

Task

Create a PR in Azure/azure-sdk-for-python that fixes the integration publishing pipeline logic so that scoped builds (using BuildTargetingString) do not fail when packages are filtered out.

Requirements

  1. Reproduce/understand the failure by inspecting the pipeline scripts/templates used for integration publishing and how they discover expected artifacts.
  2. Identify where the pipeline:
    • enumerates packages to publish, and
    • assumes an artifact exists for each enumerated package.
  3. Implement a fix so that when a package is not built due to BuildTargetingString filtering (or otherwise absent artifacts), the integration publishing step:
    • skips that package,
    • logs a clear message indicating it was skipped because the artifact wasn’t produced / not targeted,
    • continues publishing remaining targeted packages.
  4. Ensure the fix works for both:
    • SetDevVersion=true (dev version publishing) and
    • normal integration publishing scenarios.
  5. Add/update tests where feasible (unit tests for scripts, or pipeline-level validation if present). If tests are not practical, add a lightweight validation script step or robust error handling with clear logs.
  6. Update any documentation/comments in the pipeline templates to explain the behavior.

Implementation guidance

  • Prefer making the logic resilient by checking artifact existence before attempting publish.
  • If a manifest/list of built artifacts exists (e.g., output file from the build stage), use it as the source of truth instead of static package enumeration.
  • Keep behavior unchanged for non-scoped builds.

PR Deliverables

  • Code changes to pipeline templates/scripts that handle integration publishing.
  • Any accompanying tests or validation steps.
  • PR description should:

Acceptance criteria

  • Scoped build + integration publish + SetDevVersion=true no longer fails due to missing expected artifacts.
  • Untargeted packages are skipped with a clear log message.
  • Targeted packages still publish successfully.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Examine the body and my comment on this issue #42014

I want you to submit a PR that resolves this issue. Effectively integration needs to handle when the package is filtered out at the very least.

Feel free to understand the problem and confer with me before executing on a solution.

Assistant: I’ve queued up the PR creation workflow, but I’m currently waiting on your accept/reject response to the permissions prompt before I can proceed with implementing and submitting the fix.

This pull request was created from Copilot chat.

When a build is scoped via BuildTargetingString, only targeted packages
have artifact directories. The Integration stage was calling Get-ChildItem
on all artifact directories, causing a fatal error for non-targeted packages.

Add Test-Path check to gracefully skip packages whose artifact directories
don't exist, logging a clear message indicating the package was not targeted.

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/034428c7-04c1-4353-9aac-7b0e713c1aaf

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix integration publishing crash on scoped builds Fix scoped builds crashing on integration publishing Apr 9, 2026
Copilot AI requested a review from scbedd April 9, 2026 20:54
@scbedd scbedd moved this to 🔬 Dev in PR in Azure SDK EngSys 🚀🌒🧑‍🚀 Apr 9, 2026
…irectory existence

When BuildTargetingString is set, split it by comma and test each artifact
name against the glob patterns using PowerShell -like before attempting to
publish. Non-matching packages are skipped with a clear log message.

Closes #42014

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/88e37a34-ffce-4971-91c0-223321039c44

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
@scbedd scbedd marked this pull request as ready for review April 9, 2026 21:56
@scbedd scbedd requested review from benbp and weshaggard as code owners April 9, 2026 21:56
Copilot AI review requested due to automatic review settings April 9, 2026 21:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Integration publishing logic in the Python release archetype pipeline to avoid attempting integration publishing for packages that were filtered out by a scoped build (BuildTargetingString), addressing failures where expected artifacts were not produced.

Changes:

  • Add a BuildTargetingString check in the Integration publish step to skip publishing non-targeted packages with a clear log message.
Show a summary per file
File Description
eng/pipelines/templates/stages/archetype-python-release.yml Adds targeting-string matching to skip integration publish for artifacts excluded by scoped builds.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread eng/pipelines/templates/stages/archetype-python-release.yml
Comment thread eng/pipelines/templates/stages/archetype-python-release.yml
@scbedd
Copy link
Copy Markdown
Member

scbedd commented Apr 10, 2026

/check-enforcer override

@scbedd scbedd merged commit 80b927e into main Apr 10, 2026
24 checks passed
@scbedd scbedd deleted the copilot/fix-integration-publishing-crash branch April 10, 2026 17:55
tendau pushed a commit that referenced this pull request Apr 13, 2026
* Fix scoped builds: check BuildTargetingString glob match instead of directory existence

When BuildTargetingString is set, split it by comma and test each artifact
name against the glob patterns using PowerShell -like before attempting to
publish. Non-matching packages are skipped with a clear log message.

Closes #42014

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/88e37a34-ffce-4971-91c0-223321039c44

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
@kurtzeborn kurtzeborn moved this from 🔬 Dev in PR to 🎊 Closed in Azure SDK EngSys 🚀🌒🧑‍🚀 Apr 14, 2026
fafhrd91 pushed a commit to fafhrd91/azure-sdk-for-python that referenced this pull request Apr 28, 2026
* Fix scoped builds: check BuildTargetingString glob match instead of directory existence

When BuildTargetingString is set, split it by comma and test each artifact
name against the glob patterns using PowerShell -like before attempting to
publish. Non-matching packages are skipped with a clear log message.

Closes Azure#42014

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/88e37a34-ffce-4971-91c0-223321039c44

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Scoped builds crash on integration publishing

5 participants