Skip to content

Ensure artifact dependency keeps correct mode, ordering and checksum values#15500

Merged
bergmania merged 1 commit intov13/devfrom
v13/hotfix/artifactdependency-ordering
Dec 21, 2023
Merged

Ensure artifact dependency keeps correct mode, ordering and checksum values#15500
bergmania merged 1 commit intov13/devfrom
v13/hotfix/artifactdependency-ordering

Conversation

@ronaldbarendse
Copy link
Copy Markdown
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Description

PR #15318 causes a regression in adding artifact dependencies to ArtifactDependencyCollection for the same UDI, but with a different ordering flag set. Instead of not adding the artifact when the dependency mode was the same, the logic was changed to only prevent downgrading it from ArtifactDependencyMode.Match to ArtifactDependencyMode.Exist. So dependencies with the same mode would override an already added one and thereby potentially reset the ordering flag.

Deploy actually relied on this implementation detail, because a dependency to the parent content node would first be added using new ArtifactDependency(art.Parent, true, ArtifactDependencyMode.Exist) (with ordering enabled), before any dependencies/references within the content were added later. As long as the mode wasn't upgraded to Match (which wouldn't make sense for referenced content), the ordering flag from the first added dependency would still be used. However, because this isn't the case anymore, if the content references the parent node and adds a dependency using new ArtifactDependency(udi, false, ArtifactDependencyMode.Exist) (with ordering disabled), Deploy won't ensure the parent gets processed before any of it's children and you can get a ProcessArtifactException with a message saying it can't find the parent 😢

To properly fix this, I've ensured both the Ordering and Mode properties can be internally set and existing dependencies are updated to only 'upgrade' the values (exist to match and non-ordering to ordering). I've also added new tests to verify this.

@ronaldbarendse ronaldbarendse added status/regression A previously working feature that has broken or changed behavior unexpectedly type/bug affected/v13 labels Dec 21, 2023
@bergmania bergmania merged commit f705479 into v13/dev Dec 21, 2023
@bergmania bergmania deleted the v13/hotfix/artifactdependency-ordering branch December 21, 2023 13:55
bergmania pushed a commit that referenced this pull request Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/13.0.3 status/regression A previously working feature that has broken or changed behavior unexpectedly type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants