From: Aric Gardner Date: Mon, 5 Aug 2019 22:35:34 +0000 (-0400) Subject: Remove drop of staging repos on release X-Git-Tag: v0.25.4^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F16448%2F4;p=releng%2Flftools.git 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. Signed-off-by: Aric Gardner Change-Id: I3ad52502d6ac44960f697561eb82e2b6896ac781 --- diff --git a/lftools/nexus/cmd.py b/lftools/nexus/cmd.py index 377bfed6..0424ce27 100644 --- a/lftools/nexus/cmd.py +++ b/lftools/nexus/cmd.py @@ -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 index 00000000..6b25102a --- /dev/null +++ b/releasenotes/notes/nexus-release-4e9aed6e9bc1a389.yaml @@ -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. diff --git a/tests/test_nexus.py b/tests/test_nexus.py index 7d51fa63..38dda2fa 100644 --- a/tests/test_nexus.py +++ b/tests/test_nexus.py @@ -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)