Skip to content

Conversation

@JPRuskin
Copy link
Collaborator

@JPRuskin JPRuskin commented Feb 27, 2025

Additionally enhances:

  • Improves error handling in Invoke-Nexus
  • Passes the build version through to the Chocolatey package
  • Adds Remove-NexusRepositoryFolder
  • Captures blank-line output from a bunch of functions
  • Upgrades the upload-artifact action to v4, as v2 is deprecated

Bugfixes:

  • Fixes the SYSTEM user failing to install the package
  • Fixes Get-NexusAsset only returning up to 20 results
  • Fixes the GitVersion task failing the Action

I'm happy to drop the Captures blank-line output from a bunch of functions commit if you'd prefer (though I find the lack of useless output tidier) - when I was analysing things that were different between NexuShell and the functions we had in QSG, I found the following stuff:

  • Invoke-NexusScript -> Set-NexusScript, Start-NexusScript, Remove-NexusScript. No replacement. But actually, unused.
  • Invoke-Nexus -> QSG has $AdditionalHeaders. This seems to be needed for Remove-NexusRepositoryFolder.
  • Get-NexusUserToken -> QSG may not actually work due to the auth header used?
  • Remove-NexusRepository -> Parameter completer has minor differences.
  • Remove-NexusRepositoryFolder -> needs to be brought across.
  • New-NexusNugetHostedRepository -> catches the final output in a $null =
  • New-NexusRawHostedRepository -> catches the final output in a $null =
  • Enable-NexusRealm -> catches the final output in a $null =, minor change to spacing in arg completer
  • Get-NexusNuGetApiKey -> May not work properly in QSG (or rather, won't work for any account other than admin) and doesn't support context path
  • New-NexusRawComponent -> uses Upload-File in NexuShell, so far fewer args. Quite different.
  • Get-NexusRepository -> No changes
  • Get-NexusRealm -> no changes
  • Get-NexusUser -> no change.
  • Get-NexusRole -> no change.
  • New-NexusUser -> no change.
  • New-NexusRole -> no change.
  • Set-NexusAnonymousAuth -> no change.

I brought the changes across where appropriate, though only the $null catching stuff needed changes (beyond the addition of various functions.

I have not migrated the Invoke-NexusScript function, as it's not currently being used in QSG and simply combined the functinality of a few other functions that are already present.

@JPRuskin JPRuskin force-pushed the addConfigurationLookup branch 2 times, most recently from 066f931 to 7d4a946 Compare March 4, 2025 12:09
@steviecoaster steviecoaster self-requested a review March 12, 2025 13:07
@JPRuskin JPRuskin force-pushed the addConfigurationLookup branch from 7d4a946 to 4cde29c Compare March 12, 2025 13:18
This new parameter adds the ability to connect to
a service running on the local machine.

It adds several private functions that look up if a local
service exists, and then a -LocalService switch to the
Connect-NexusServer function that uses the calculated
values.

This should allow people to more reliably connect locally, without forgetting interesting switches.
v2 of the action was deprecated, and now causes build failures.

For further details, see: https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/

Fixes a GitVersion Issue in the build, where the shallow checkout
of the repository was causing GitVersion to fail.

Finally, adds a quick VSCode task to build the module.
Updates Invoke-Nexus to accept additional headers where appropriate.

+semver:feature
Some blank output has been noticed from the responses to Invoke-Nexus.

This change captures that output in a $null=.
Also, skips attempting to push the package if you don't have
a Chocolatey API Key set.
Given the default page size of 10 results, Get-NexusAsset was returning a maximum
of 20 results.

This change fixes that, so it will continue returning matching assets until
it runs out of continuation tokens.
Due to the SYSTEM user not having a profile, splitting the path failed pretty hard.

This change warns the user if they are attempting to install using the system user.
Some errors were bubbling up unacceptably. This adds some handling such that a "correct" error (e.g. a 404, role not found) will respect EAP.
@steviecoaster steviecoaster merged commit 5345e01 into steviecoaster:develop Mar 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants