Skip to content

ORAS repos automatically filter deployed code modules with the current IRIS version - #1231

Open
isc-dchui wants to merge 9 commits into
mainfrom
improve-deployed-code
Open

isc-dchui wants to merge 9 commits into
mainfrom
improve-deployed-code

Conversation

@isc-dchui

@isc-dchui isc-dchui commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Platform filtering

Deployed code is built separately per IRIS version, so the registry tag carries a platform suffix (__2026.1 on module:1.0.0__2026.1). search and install now compare that suffix against the current platform version, $system.Version.GetMajor()_"."_GetMinor(), centralized as $$$CurrentPlatformVersion in Common.inc, and treat a mismatch as unavailable rather than something IPM would try and fail to pull.

  • install filters at search time in %IPM.Repo.Manager:SearchRepositoriesForModule, which now returns a second list of the deployed results that matched by name/version but not platform. If a module resolves to nothing but that list is non-empty, install reports which platforms the (newest) filtered version actually supports, instead of a bare "not found":
    'platform-filter-test' 2.0.0 is not available for platform version 2026.1. Available platform versions: 2026.2. Run 'search platform-filter-test -versions' to see all versions.
    
  • search gained a Platforms column. Without -versions it drops incompatible versions entirely (ModuleInfo:IsCompatibleWithPlatform); non-deployed modules always pass, since they aren't platform-specific.
  • -versions is where it gets a bit unusual: ORAS reports one AllVersions entry per version regardless of how many platforms that version was built for, so there's no single "platform" to attach to that row. PreferCompatibleVersions reorders the list so platform-matching versions sort first (newest first within each group) without hiding anything, and per-version platform tagging is skipped for this mode since a single row can't stand in for more than one platform.

The dependency install fix (#987)

#987 is "installing dependencies with ORAS fails to get the manifest". Root cause: platform version wasn't threaded through dependency resolution at all. Module.cls's dependency graph tuples, and the inverted graph built from them, only carried (depth, server, version), so deployed and platform version fell off during flattening and a dependency that needed a platform-tagged pull had nothing to build the tag from. Both graphs now carry Deployed and PlatformVersion through to the QualifiedModuleInfo handed to GetModule.

Only ORAS hit this as it's the only service that builds its artifact identifier, the OCI tag, from pModuleReference.PlatformVersion client-side. Remote resolves platform server-side per request, and Filesystem doesn't model platform at all. Tag construction moved into one place, PackageService:TagForReference, used by both GetModule and the previously-separate GetModuleManifest, which built its tag from just the semver with no platform suffix, asking the registry for a tag that was never published. TagForReference now throws explicitly if a deployed reference has no resolved platform version, rather than silently building a wrong one.

Riding along, since it surfaced while fixing the above:

  • GetModuleManifest was returning a raw %String where %IPM.Repo.IPackageService promises a stream; callers calling stream methods on it would fail. Wrapped in %Stream.GlobalCharacter.
  • BuildAllDependencyGraphs used to quit out of the entire multi-repository scan on the first manifest it couldn't fetch. It now records the failure per-module and keeps going, so one bad manifest doesn't blank out dependency resolution for every other repo.

Smaller things bundled in

  • PublishService now refuses to publish a deployed module with no platform version, instead of silently tagging it without the platform suffix.
  • Base.cls:%Compile's cycle detection previously carved out an exception for HasDeployedResources, since a deployed module's Deploy=true children are excluded from the compile-flag map and legitimately never finish, but that exception disabled cycle detection for the whole module along with them. It now removes a resource from the "still needs compiling" set as soon as none of its pending work is compilable, so the exception isn't needed. A module with deployed code may now surface a genuine cycle among its non-deployed resources that was previously silent.
  • Document.cls marks Module.Deployed and saves it as soon as a Studio-project deploy source is detected, because %Compile reopens the module from the database afterward and needs that flag to skip source compilation for it.

Testing

New integration tests in Test.PM.Integration.OrasDeployedPlatformFilter against a real ORAS (zot) registry: visible/installable on a matching platform, hidden from search and install on a mismatched one, the install error message, and a dependency pinned to a version that only exists for an incompatible platform. Unit tests in Test.PM.Unit.DeployedModuleFilter cover IsCompatibleWithPlatform/FormatPlatformVersions directly.

Checklist

  • This branch has the latest changes from the main branch rebased or merged.
  • Changelog entry added.
  • Unit (zpm test -only) and integration tests (zpm verify -only) pass.
  • Style matches the style guide in the contributing guide.
  • Documentation has been/will be updated
    • Source controlled docs, e.g. README.md, should be included in this PR and Wiki changes should be made after this PR is merged (add an extra issue for this if needed)
  • Pull request correctly renders in the "Preview" tab.

@isc-tleavitt isc-tleavitt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One minor nitpick.

Comment thread src/cls/IPM/Main.cls Outdated
@isc-dchui
isc-dchui force-pushed the improve-deployed-code branch from 472a084 to 12900f3 Compare September 22, 2026 13:44
@@ -1391,7 +1402,9 @@ ClassMethod ConstructInvertedDependencyGraph(
quit
}
// Invert dependency graph, subscripts (<module>, <depends on>)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: Should this comment be deleted as well with the line below/changed to match that there are 4 subscripts that are now being used

@isc-eneil isc-eneil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@isc-dchui Looks good! Left a couple of small comments.

Comment thread src/cls/IPM/Main.cls
set tSearchCriteria.VersionExpression = tVersion
set tSearchCriteria.Keywords = tKeywords
$$$ThrowOnError(##class(%IPM.Repo.Utils).SearchRepositoriesForModule(tSearchCriteria,.tResults))
$$$ThrowOnError(##class(%IPM.Repo.Utils).SearchRepositoriesForModule(tSearchCriteria,.tResults,,.tPlatformFiltered))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: call this tPlatformIncompatibleModules or something like that for clarity-- it's not clear from the naming whether this contains modules that are or are not platform compatible

Comment thread src/cls/IPM/Main.cls
$$$ThrowOnError(##class(%IPM.Utils.Module).LoadQualifiedReference(tResult, .tParams, , log))
}
} else {
// The module may have matched but been excluded for being deployed for other platforms

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The first part of this comment is a bit confusing to me-- can you reword slightly? I suggest "The module may have been found in the configured repository but no platform-compatible version exists."


/// Load a module fixture from _data, package it, and return the path to the .tgz without
/// the extension.
Method LoadAndPackage(moduleFolder As %String = "") As %String

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Consider moving this into Base.cls, seems broadly applicable (to publishing tests especially)


/// Returns true if any configured repository offers the named module. Queries the resolution
/// API directly rather than parsing the terminal output of repo -list-modules.
ClassMethod ModuleVisibleInList(moduleName As %String) As %Boolean

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also could be moved to Base.cls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installing deployed code modules should use smarter filtering Dependency modules that come from an ORAS repo not getting installed correctly

4 participants