Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    [ProGet/PGUtil] Bug: When setting feed property only the last one will be retained.

    Scheduled Pinned Locked Moved Support
    1 Posts 1 Posters 1 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      Nils Nilsson
      last edited by

      Hi again!

      I'm setting properties for feeds using

      pgutil feeds properties set --api-key=$APIKey --source="$ServerUrl" `
              --feed="$feedName" --property="$propertyName" --value="$propertyValue"
      

      However only the last property that I set will retain the enabled setting.

      This is with pgutil version 2.4.2 targeting ProGet version 2026.8

      Here is the relevant snippet from my code (Not complete)

      Function Set-FeedProperty{
          param (
              [Parameter(Mandatory=$true)][string]$feedName,
              [Parameter(Mandatory=$true)][string]$propertyName,
              [Parameter(Mandatory=$true)][string]$propertyValue
          )
      
          $output = pgutil feeds properties set `
              --api-key=$APIKey `
              --source="$ServerUrl" `
              --feed="$feedName" `
              --property="$propertyName" `
              --value="$propertyValue" 2>&1
          if($output -match "error"){
              Write-Host "##[error] Property '$propertyName': $output"
          } else {
              Write-Debug "##[debug] Property '$propertyName': $output"
          }
      }
      
      # Enable tracking package usage
      Set-FeedProperty $feedName "packageStatisticsEnabled" $true
      Set-FeedProperty $feedName "restrictPackageStatistics" $true
      Set-FeedProperty $feedName "deploymentRecordsEnabled" $true
      Set-FeedProperty $feedName "usageRecordsEnabled" $true
      # Display vulnerability information and enforce vulnerability compliance rules
      Set-FeedProperty $feedName "vulnerabilitiesEnabled" $true
      # Display license information and enforce license compliance rules
      Set-FeedProperty $feedName "licensesEnabled" $true
      # Show package usage in Projects & Builds (SCA)
      Set-FeedProperty $feedName "useWithProjects" $true
      

      If I run it as is, only useWithProjects will be enabled
      ec0201cc-6c46-4697-9ecb-dd4f3da6546b-image.jpeg
      If I comment out the final command, licensesEnabled will be enabled instead.
      aed1a9f8-1b66-4ae9-828b-c79181a44816-image.jpeg

      If I try to manually set a single property from the CLI afterwards, instead only that property will be set to enabled, resetting the previously enabled property to disabled.

      P.S Regarding my previous thread where we discussed the implementation of more settable properties, I apologize for any potential confusion caused by my last message. I had messed up the casing on the property names (Uppercase first letter instead of lowercase).

      Best regards
      Nils Nilsson

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post
      Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation