diff --git a/CHANGELOG.md b/CHANGELOG.md
index 603408d3..8521b96f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- #870: When running tests for just a single suite or class, will only load and compile the relevant classes instead of all the tests
- #843: Optionally include tests when packaging using either the `-include-tests` flag or `
/// Parameters:
@@ -1142,7 +1144,7 @@ Method ProcessSingleDependencyIterative(
localObj.Version.Satisfies(searchExpr) &&
((version = "") || (version = localObj.VersionString))
if installedVersionValid && '(localObj.Version.IsSnapshot() && pForceSnapshotReload) {
- set pDependencyGraph(pDep.Name) = $listbuild(pDepth,"",localObj.VersionString,pDep.DisplayName)
+ set pDependencyGraph(pDep.Name) = $listbuild(pDepth,"",localObj.VersionString,pDep.DisplayName,pDep.Scope)
set pDependencyGraph(pDep.Name,pParentInfo) = pDep.VersionString
// Add to work queue for next depth
@@ -1204,7 +1206,7 @@ Method ProcessSingleDependencyIterative(
}
set pDependencyGraph(pDep.Name) = $listbuild(
- pDepth, qualifiedReference.ServerName, moduleObj.VersionString, qualifiedReference.Deployed, qualifiedReference.PlatformVersion,pDep.DisplayName
+ pDepth, qualifiedReference.ServerName, moduleObj.VersionString, qualifiedReference.Deployed, qualifiedReference.PlatformVersion,pDep.DisplayName,pDep.Scope
)
set pDependencyGraph(pDep.Name,pParentInfo) = pDep.VersionString
@@ -1239,7 +1241,7 @@ Method ProcessSingleDependencyIterative(
// occurs if needed.
set depth = $select(previousDepth=0:pDepth,previousDepth>pDepth:previousDepth,1:pDepth)
set dependencyGraph(pDep.Name) = $listbuild(
- depth,qualifiedReference.ServerName,moduleObj.VersionString,pDep.DisplayName
+ depth,qualifiedReference.ServerName,moduleObj.VersionString,pDep.DisplayName,pDep.Scope
)
set dependencyGraph(pDep.Name,pParentInfo) = pDep.VersionString
diff --git a/tests/integration_tests/Test/PM/Integration/BuildDependencyGraphScopedDeps.cls b/tests/integration_tests/Test/PM/Integration/BuildDependencyGraphScopedDeps.cls
new file mode 100644
index 00000000..0221dba9
--- /dev/null
+++ b/tests/integration_tests/Test/PM/Integration/BuildDependencyGraphScopedDeps.cls
@@ -0,0 +1,56 @@
+Class Test.PM.Integration.BuildDependencyGraphScopedDeps Extends Test.PM.Integration.Base
+{
+
+Parameter REPONAME = "build-dependency-graph-scoped-dep";
+
+Parameter MODNAME = "module-a";
+
+Property RepoPath As %String;
+
+Method OnBeforeAllTests() As %Status
+{
+ // Set up the repo path - use GetModuleDir utility
+ set ..RepoPath = ..GetModuleDir(..#REPONAME)
+
+ // Create filesystem repo pointing to test data
+ set sc = ##class(%IPM.Main).Shell("repo -n "_..#REPONAME_" -fs -path "_..RepoPath)
+ do $$$AssertStatusOK(sc,"Created"_..#REPONAME_"repo successfully.")
+ quit sc
+}
+
+Method OnAfterAllTests() As %Status
+{
+ // Remove test repository
+ set sc = ##class(%IPM.Main).Shell("repo -delete -name "_..#REPONAME)
+ do $$$AssertStatusOK(sc,"Deleted "_..#REPONAME_"repo successfully.")
+ quit sc
+}
+
+/// BuildDependencyGraph should include scope information for scoped transitive dependencies
+Method TestDependencyGraphScopedDependency()
+{
+ do $$$AssertStatusOK(##class(%IPM.Utils.Module).LoadModuleFromDirectory(..RepoPath_..#MODNAME), "Successfully loaded module from directory.")
+ set module = ##class(%IPM.Storage.Module).NameOpen(..#MODNAME,,.sc)
+ do $$$AssertStatusOK(sc, "Successfully opened module object.")
+
+ // Expected dependencyGraph format: dependencyGraph(