Fix returned namespaces (packages) and setup the docs job's repository settings so it can pull from the dev feed.#39875
Merged
Conversation
danieljurek
approved these changes
Apr 23, 2024
danieljurek
left a comment
Member
There was a problem hiding this comment.
LGTM. Thanks for DRYing up mvn-linux-repository-settings.yml which was on its way to further proliferation.
Contributor
Author
|
I'm going to override check-enforcer. Everything passed and the second commit was only to remove the changes to template's ci.yml file that were used to test the code which requires the docs portion of the releases. |
Contributor
Author
|
/check-enforcer override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These changes are being pulled from an existing, pending PR because they're more immediate.
There are a couple of things going on here:
$namespaces = $namespaces | Sort-Object -Uniqueto remove any dupes (which shouldn't be there anyways but it's better safe than sorry). $namespaces is declared as$namespaces = @()which is the standard array,$namespaces.GetType()before the call to Sort-Objects is System.Object[] and it retains that type if there are two or more objects in the array. In the case of a single item it converts the type to a string and in the case of an empty array, the type is converted to System.Collections.Generic.List[System.Object]. The problem with this is that when it's converts System.Collections.Generic.List[System.Object] it ends up being an array that contains null. This means that the .Count is 1 and the single item it contains is null. When converted to json it becomes this.Which has some "hilarious" effects on docs processing. The fix here is to ensure that Sort-Object always returns an array
@($namespaces | Sort-Object -Unique)Note: the changes to template's ci.yml are for testing purposes and will be removed prior to merge.