Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: drop server side handling of package_changes #402

Merged
merged 1 commit into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions asu/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ def validate_packages(req):

req["packages"] = tr

if req.get("diff_packages", False):
for package, change in (
current_app.config["BRANCHES"][req["branch"]]
.get("package_changes", {})
.items()
):
if package in req["packages"]:
current_app.logger.debug("changes to package %s", package)
req["packages"].remove(package)
if isinstance(change, str):
req["packages"].add(change)

# store request packages temporary in Redis and create a diff
temp = str(uuid4())
pipeline = r.pipeline(True)
Expand Down
31 changes: 0 additions & 31 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,22 +475,6 @@ def test_api_build_bad_packages(client):
assert response.json.get("detail") == "Unsupported package(s): test4"
assert response.status == "422 UNPROCESSABLE ENTITY"


def test_api_build_package_to_remove_diff_packages_true(client, upstream):
response = client.post(
"/api/v1/build",
json=dict(
version="TESTVERSION",
target="testtarget/testsubtarget",
profile="testprofile",
packages=["test1", "test2", "package_to_remove"],
diff_packages=True,
),
)
assert response.status == "200 OK"
assert response.json.get("request_hash") == "b7b991edc9a53302df840f842603288e"


def test_api_build_package_to_remove_diff_packages_false(client, upstream):
response = client.post(
"/api/v1/build",
Expand All @@ -505,21 +489,6 @@ def test_api_build_package_to_remove_diff_packages_false(client, upstream):
assert response.status == "422 UNPROCESSABLE ENTITY"


def test_api_build_package_to_replace(client, upstream):
response = client.post(
"/api/v1/build",
json=dict(
version="TESTVERSION",
target="testtarget/testsubtarget",
profile="testprofile",
packages=["test1", "test2", "package_to_replace"],
diff_packages=True,
),
)
assert response.status == "200 OK"
assert response.json.get("request_hash") == "8dd81d51057d322b46aa3739ccf4a8a6"


def test_api_build_cleanup(app, upstream):
client = app.test_client()
response = client.post(
Expand Down