Remove drop of staging repos on release 48/16448/4 v0.25.4
authorAric Gardner <agardner@linuxfoundation.org>
Mon, 5 Aug 2019 22:35:34 +0000 (18:35 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Mon, 5 Aug 2019 23:37:01 +0000 (19:37 -0400)
The api returns that the relese is completed.
in the background java threads are still running.

Then we call drop and nexus has threads promoting and dropping
at the same time.

In this way we lose data.

Something else needs to drop, the api does not correctly
handle this.

Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I3ad52502d6ac44960f697561eb82e2b6896ac781

lftools/nexus/cmd.py
releasenotes/notes/nexus-release-4e9aed6e9bc1a389.yaml [new file with mode: 0644]
tests/test_nexus.py

index 377bfed..0424ce2 100644 (file)
@@ -324,14 +324,3 @@ def release_staging_repos(repos, nexus_url=""):
                                                        response.text))
         else:
             log.debug("Successfully released {}".format(str(repo)))
-
-        request_url = "{}/staging/bulk/drop".format(_nexus.baseurl)
-        log.debug("Request URL: {}".format(request_url))
-        response = requests.post(request_url, json=data, auth=_nexus.auth)
-
-        if response.status_code != 201:
-            raise requests.HTTPError("Drop failed with the following error:"
-                                     "\n{}: {}".format(response.status_code,
-                                                       response.text))
-        else:
-            log.debug("Successfully dropped {}".format(str(repo)))
diff --git a/releasenotes/notes/nexus-release-4e9aed6e9bc1a389.yaml b/releasenotes/notes/nexus-release-4e9aed6e9bc1a389.yaml
new file mode 100644 (file)
index 0000000..6b25102
--- /dev/null
@@ -0,0 +1,11 @@
+---
+fixes:
+   |
+   Remove drop of staging repos on release
+   The api returns that the relese is completed.
+   in the background java threads are still running.
+   Then we call drop and nexus has threads promoting and dropping
+   at the same time.
+   In this way we lose data.
+   Something else needs to drop, the api does not correctly
+   handle this.
index 7d51fa6..38dda2f 100644 (file)
@@ -64,8 +64,6 @@ def test_release_staging_repos(responses):
     # The responses provide implicit assertions.
     responses.add(responses.POST, "{}/service/local/staging/bulk/promote".format(good_url),
                   json=None, status=201)
-    responses.add(responses.POST, "{}/service/local/staging/bulk/drop".format(good_url),
-                  json=None, status=201)
 
     # Test successful single release.
     cmd.release_staging_repos(("release-1",), good_url)
@@ -84,17 +82,3 @@ def test_release_staging_repos(responses):
                   status=401)
     with pytest.raises(requests.HTTPError):
         cmd.release_staging_repos(("release-1",), bad_url1)
-
-    # Test drop failure
-    bad_url2 = "https://nexus-fail2.example.org"
-    responses.add(responses.GET,
-                  "{}/service/local/repo_targets".format(bad_url2),
-                  json=None, status=200)
-    responses.add(responses.POST,
-                  "{}/service/local/staging/bulk/promote".format(bad_url2),
-                  status=201)
-    responses.add(responses.POST,
-                  "{}/service/local/staging/bulk/drop".format(bad_url2),
-                  status=403)
-    with pytest.raises(requests.HTTPError):
-        cmd.release_staging_repos(("release-1",), bad_url2)