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!

    `dotnet nuget push --skip-duplicate` does not work as expected

    Scheduled Pinned Locked Moved Support
    13 Posts 5 Posters 39 Views 2 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.
    • atrippA Offline
      atripp inedo-engineer
      last edited by atripp

      Overwriting packages in NuGet.org is totally impossible, but it's possible in ProGet if you have the correct privileges. This is why ProGet returns a 401 (not authorized). We're a bit skeptical to change, but will consider it in a major release.

      To be honest, this flag on dotnet nuget push doesn't make much sense, even for NuGet.org. What's the usecase? What sort of Build process is used that doesn't generate new package numbers on build?

      We don't like encouraging poor workflows. For example, this is why we don't have a "easy package delete" function; this isn't something you should be doing very often that you'd need a quick-delete, and if you are, your'e probably doing it wrong.

      So hopefully you can help us understand this workflow and why it would make sense to use?

      1 Reply Last reply Reply Quote 0
      • K Offline
        kemeny.attila_7338
        last edited by

        I found this thread while looking for solution of the exact same problem to OP has.
        In our case this feature is not essential but a nice-to-have. For example when the CI pipeline is broken after the nuget artifact was pushed, rerun the build will fail again at the step of nuget push. With this settings all builds could be idempotent and could be run as many times as necessary. Which is a big plus for us.

        I understand you don't want to do changes which are not backward compatible. Isn't it possible to add an option or settings where the user can choose the HTTP response code of the response when the package is already exists? In this case if the default value is 403, the change will be backward compatible and can be release faster.

        1 Reply Last reply Reply Quote 0
        • atrippA Offline
          atripp inedo-engineer
          last edited by

          We have a new major release coming up, 5.3. So perhaps, we'll just change the response there.

          And if it actually makes a problem, and others have a trouble updating their own scripts, then we can consider adding a flag.

          C 1 Reply Last reply Reply Quote 0
          • F Offline
            fool
            last edited by fool

            The use case is quite simply for re-trying a build after a partial (possibly transient) failure, where multiple artifacts are "uploaded", not just NuGet artifacts.

            The point is you still cannot (and must not) overwrite any NuGet artifacts with a given version, but you can skip them, which makes the build much more flexible.

            1 Reply Last reply Reply Quote 0
            • C Offline
              cfrolik_9952 @atripp
              last edited by cfrolik_9952

              @atripp --skip-duplicate is still not working with ProGet 5.3.2. To be clear, the behavior I'm expecting is "publish this package only if this version doesn't exist yet, otherwise do nothing." It appears that even with --skip-duplicate, package versions are overwritten which is not ideal.

              1 Reply Last reply Reply Quote 0
              • atrippA Offline
                atripp inedo-engineer
                last edited by

                In this case, you'll need to remove the Feeds_OverwritePackage privilege from the API Key or User that's doing the push. The behavior you want/expect is not possible otherwise.

                nuget.exe does not send any information to ProGet about whether packages should or shouldn't be overwritten; the --skip-duplication option merely treats certain server errors (i.e. a 409 error) as a warning instead of a failure.

                C 1 Reply Last reply Reply Quote 0
                • C Offline
                  cfrolik_9952 @atripp
                  last edited by

                  @atripp Thank you for the quick response. It's not obvious to me how to change this permission to API Keys, the checkboxes in the web UI are labelled:

                  • Grant access to Native API
                  • Grant access to Package Promotion API
                  • Grant access to Webhooks API
                  • Grant access to Repackaging API
                  • Grant access to Feed Management API
                  • Grant access to Connector Health API
                  • Grant access to Feed API

                  I'm guessing there's another place I need to go to remove the Feeds_OverwritePackage from the API key, but it's not obvious how to do this in the web UI.

                  1 Reply Last reply Reply Quote 0
                  • atrippA Offline
                    atripp inedo-engineer
                    last edited by

                    Ah, I can see that.

                    So, in this case, you'd want to:

                    • Grant access to Feed API
                    • Specify a Username to impersonate with the appropriate access to feeds/tasks
                    C 1 Reply Last reply Reply Quote 0
                    • P Offline
                      prnei_4140
                      last edited by

                      I am having problems configuring a user with the appropriate access. Specifically, I am having problems creating a Task that has the Add Package and View Feed permissions but that does not have the Overwrite Package permission.

                      We are running ProGet Free Edition version 5.3.2 (Build 14). When creating / editing a task, if I check any of the feeds permissions and save the task, the task saves with all of permissions instead of only the ones I checked.
                      7a214616-e7c6-47e4-8858-d85f2336ffd1-image.png

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        prnei_4140
                        last edited by

                        I experimented with the "Administration" and "Credentials" categories, along with the "Feeds" category, in the Edit Task UI.

                        All 3 categories exhibit the bug. If you check any box in the category and save the task, all of the permissions in that category are enabled.

                        It looks like within a category on the Edit Task UI, all of the input check boxes have the same name. e.g. All 8 check boxes in the Feeds category have the name "ah0~ah4~ah2~ah9".

                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          cfrolik_9952 @atripp
                          last edited by

                          @atripp I am having the same problem as @prnei_4140 in that I cannot add only one of the permissions; they all get added automatically. Is this a known issue?

                          1 Reply Last reply Reply Quote 0
                          • atrippA Offline
                            atripp inedo-engineer
                            last edited by

                            Hello; this issue is known now, I've logged an issue and we'll get it fixed in the next release; PG-1727

                            Release is scheduled for Friday, but we may ship it sooner.

                            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