Skip to content

Fix returned namespaces (packages) and setup the docs job's repository settings so it can pull from the dev feed.#39875

Merged
JimSuplizio merged 3 commits into
Azure:mainfrom
JimSuplizio:FixReturnedNamespaces
Apr 23, 2024
Merged

Fix returned namespaces (packages) and setup the docs job's repository settings so it can pull from the dev feed.#39875
JimSuplizio merged 3 commits into
Azure:mainfrom
JimSuplizio:FixReturnedNamespaces

Conversation

@JimSuplizio

@JimSuplizio JimSuplizio commented Apr 23, 2024

Copy link
Copy Markdown
Contributor

These changes are being pulled from an existing, pending PR because they're more immediate.

There are a couple of things going on here:

  1. After a package has been released, we update the MSDocs metadata. As part of this we grab the javadoc and pull it apart to get the namespaces. The repository settings, to pull from Java's dev feed, were only being set for the nightly builds and actual releases, not having this set, were being pulled from Sonatype. Well, as we all know, Sonatype can have delays, in not only the service but availability, with libraries just published. As such, create a template from the original inline powershell that setup the repository settings on Linux and setup the dev feed settings prior to ANY update-docsms-metadata.yml usage.
  2. Language-Settings.ps1 - Fun fact when computing namespaces, we execute $namespaces = $namespaces | Sort-Object -Unique to 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.
[
  null
]

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.

@github-actions github-actions Bot added the EngSys This issue is impacting the engineering system. label Apr 23, 2024
@JimSuplizio JimSuplizio self-assigned this Apr 23, 2024
@JimSuplizio JimSuplizio added the Central-EngSys This issue is owned by the Engineering System team. label Apr 23, 2024
@JimSuplizio JimSuplizio requested a review from danieljurek April 23, 2024 19:28

@danieljurek danieljurek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks for DRYing up mvn-linux-repository-settings.yml which was on its way to further proliferation.

@JimSuplizio

Copy link
Copy Markdown
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.

@JimSuplizio

Copy link
Copy Markdown
Contributor Author

/check-enforcer override

@JimSuplizio JimSuplizio merged commit abe709e into Azure:main Apr 23, 2024
@JimSuplizio JimSuplizio deleted the FixReturnedNamespaces branch April 23, 2024 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Central-EngSys This issue is owned by the Engineering System team. EngSys This issue is impacting the engineering system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants