From 5ec5f02330079cb598c777d29c3be96547a6ae6f Mon Sep 17 00:00:00 2001 From: Matt Fishman Date: Thu, 23 Apr 2026 15:16:18 -0400 Subject: [PATCH] IntegrationTest: catch ResolverError for URL-based downstreams The URL branch (unregistered / private packages specified by `https://...` or `git@...`) previously ran `Pkg.add(url=pkg)`, `Pkg.develop(".")`, and `Pkg.update()` without any error handling, so a breaking change in the PR that the downstream's compat didn't allow blew up the integration test job instead of being reported as an intentional SemVer-breaking change. Move the existing `try/catch Pkg.Resolve.ResolverError` wrapper up to cover the full `if/else`, so both the URL branch and the registered- package branch share the same "not compatible with this release" exit. Surfaced by ITensor/ITensorNetworks.jl#327 where the Tennis.jl downstream (passed as a URL) failed with `ResolverError` after the PR bumped ITensorNetworks to 0.16.0. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/IntegrationTest.yml | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/IntegrationTest.yml b/.github/workflows/IntegrationTest.yml index 2f75e0a..71a4504 100644 --- a/.github/workflows/IntegrationTest.yml +++ b/.github/workflows/IntegrationTest.yml @@ -79,15 +79,15 @@ jobs: end end pkg = "${{ inputs.pkg }}" - if startswith(pkg, "https://") || startswith(pkg, "git@") - # URL: unregistered or private package, skip version-pinning. - pkg_name = replace(basename(pkg), r"\.jl$" => "") - Pkg.add(PackageSpec(; url=pkg)) - Pkg.develop(PackageSpec(; path=".")) - Pkg.update() - Pkg.test(PackageSpec(; name=pkg_name)) - else - try + try + if startswith(pkg, "https://") || startswith(pkg, "git@") + # URL: unregistered or private package, skip version-pinning. + pkg_name = replace(basename(pkg), r"\.jl$" => "") + Pkg.add(PackageSpec(; url=pkg)) # resolver may fail with main deps + Pkg.develop(PackageSpec(; path=".")) # resolver may fail with main deps + Pkg.update() + Pkg.test(PackageSpec(; name=pkg_name)) # resolver may fail with test time deps + else Pkg.add(PackageSpec(; name=pkg)) # Determine the version that gets installed in order to detect # if the package is forced to downgrade. @@ -100,12 +100,12 @@ jobs: # to see if there is a compatibility issue. Pkg.add(PackageSpec(; name=pkg, version=version)) Pkg.test(PackageSpec(; name=pkg)) # resolver may fail with test time deps - catch err - err isa Pkg.Resolve.ResolverError || rethrow() - # If we can't resolve that means this is incompatible by SemVer and this is fine - # It means we marked this as a breaking change, so we don't need to worry about - # Mistakenly introducing a breaking change, as we have intentionally made one - @info "Not compatible with this release. No problem." exception=err - exit(0) # Exit immediately, as a success end + catch err + err isa Pkg.Resolve.ResolverError || rethrow() + # If we can't resolve that means this is incompatible by SemVer and this is fine + # It means we marked this as a breaking change, so we don't need to worry about + # Mistakenly introducing a breaking change, as we have intentionally made one + @info "Not compatible with this release. No problem." exception=err + exit(0) # Exit immediately, as a success end