Skip to content

Conversation

@Adam-S-Daniel
Copy link
Contributor

@Adam-S-Daniel Adam-S-Daniel commented Nov 6, 2023

Remove-PackageVersionsNotUsedByOctopus.ps1 replaces PurgeNugetFeeds.ps1. It is safer with regard to your packages that are unrelated to Octopus deployments, because:

  • It only considers those package IDs that are in use by your Octopus instance.
  • It only considers package feeds you explicitly include via argument.
  • It only runs if it can verify it is running with Octopus Deploy privileges sufficient to enumerate every package ID and version referenced by every Release across every Space.
  • It does not rely on information from its previous run.
  • It checks for packages used by runbook snapshots in addition to releases.

…edByOctopus.ps1

`Remove-PackageVersionsNotUsedByOctopus.ps1` replaces `PurgeNugetFeeds.ps1`. It is safer with regard to your packages that are unrelated to Octopus deployments, because:
 - It only considers those package IDs that are in use by your Octopus instance.
 - It only considers package feeds you explicitly include via argument.
 - It only runs if it can verify it is running with Octopus Deploy privileges sufficient to enumerate every package ID and version referenced by every Release across every Space.
- It does not rely on information from its previous run.
@Adam-S-Daniel
Copy link
Contributor Author

@harrisonmeister or @patrick-smergut-octopus - Could you review this PR when you are able? I see you have both worked on REST/PowerShell/Feeds/SyncPackages.ps1, the innards of which do some similar things. I contributed PurgeNugetFeeds.ps1 but now realize its design made it too easy for the user to remove packages they did not intend. As described above, this PR replaces it with the intrinsically much saferRemove-PackageVersionsNotUsedByOctopus.ps1.

@Adam-S-Daniel
Copy link
Contributor Author

Please review. The existing script is not safe

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.

1 participant