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)))
--- /dev/null
+---
+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.
# 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)
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)