fix(merge-from-scope), do not throw an error about missing artifacts when merging main to a lane #8557
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously,
collectVersionsObjects
had a bug,ignoreMissingLocalArtifacts
didn't do anything, even when it wasfalse
, it was still ignoring local artifacts becauselocallyChangedHashes.includes(versionObject.hash.toString())
always returnedfalse
. TheversionObject.hash.toString()
printed the hash method instead of the hash content. It's fixed to beversionObject.hash().toString()
to make it work.Because of the that bug, #7119 was adding new flag
ignoreMissingExternalArtifacts
unnecessarily. It assumed that an error wasn't thrown because it was external which wasn't correct. In this PR this flag has removed.In addition to this, when merging from scope and merging main to a lane, we can skip the import of the artifacts because once the user asks for the artifacts we retrieve it from main if not found in the lane.
One last thing, because until now
ignoreMissingLocalArtifacts
practically did nothing, I'm afraid that after this fix it'll throw errors unnecessarily, so I made the default to not throw when missing. We didn't get any complain about missing artifacts in the remote scopes, so it should be fine.This flag was renamed to
throwForMissingLocalArtifacts
for clarity. The only place we throw is when merging-from-scope and the source is a lane, not main.