Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-21273

param :source_url not working with the sync API

XMLWordPrintable

    • Sprint 126, Sprint 127, Sprint 128, Sprint 129, Sprint 130, Sprint 131
    • Low
    • None

      Description of problem:

      • When using Hammer to sync a repository, the option --source-url is not used for the sync, it will use existing url.
      • However, when I pass --source-url on a repo with no existing url, it will try and sync, not giving a hammer error,
        and will fail with HTTP 400: Server Error for no remote.

      Version-Release number of selected component (if applicable):
      6.10 and up
      Reproduced on 6.15.0 snap 36.0

      How reproducible:
      Every time

      Steps to Reproduce:
      1. Create some repository with no upstream_url defined. (--url in hammer).
      2. >> hammer repository synchronize --id

      {repo_id} --source-url {valid_source_url}
      3. Add a valid url to the repository field upstream_url (--url in hammer).
      4. >> hammer repository synchronize --id {repo_id}

      --source-url

      {some_other_valid_url}

      Actual results:
      2: Unsuccessful sync, does not use --source_url, gives 400 error that there is no remote (See Additional details).
      4: The repository is synced to the existing url, instead of respecting the temporary --source-url passed.

      Expected results:
      Successful sync to the temporary '--source-url' passed in 'hammer repository synchronize'.
      Or we can drop references to '--source-url', if we do not plan to support it.

      Additional details:

          • When synchronizing a repository that has no existing url, and passed --source-url:

      [root@HOST ~]# hammer repository synchronize --id 362 --source-url "https://partha.fedorapeople.org/test-repos/pteradactyl/"
      [................................................................................................................] [100%]
      Error: Error message: the server returns an error
      HTTP status code: 400
      Response headers:

      {"Date"=>"Fri, 10 Nov 2023 16:02:17 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"POST, OPTIONS", "X-Frame-Options"=>"DENY", "Content-Length"=>"82", "X-Content-Type-Options"=>"nosniff", "Referrer-Policy"=>"same-origin", "Cross-Origin-Opener-Policy"=>"same-origin", "Correlation-ID"=>"***", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 HOSTNAME.redhat.com", "Connection"=>"close"}

      Response body:

      {"remote":["This field is required since a remote is not set on the repository."]}

      ^^ Instead, would expect source_url to be used for sync, or a hammer error like-
      """ Could not synchronize the repository:
      attempted to sync without a feed URL. """

          • When synchronizing a repository that has an existing url that was already synced,
            perform sync again passing a different --source-url:

      [root@HOST ~]# hammer repository synchronize --id 363 --source-url "https://partha.fedorapeople.org/test-repos/pteradactyl/"
      [................................................................................................................] [100%]
      No content added.
      Total steps: 1/1
      --------------------------------
      Skipping Sync (no change from previous sync): 1/1

            jira-bugzilla-migration RH Bugzilla Integration
            jira-bugzilla-migration RH Bugzilla Integration
            Sam Bible Sam Bible
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: