Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ push.self-hosted-rolling:
docker push ${DOCKERHUB_REPO}:rolling_no_dependencies
docker push ${DOCKERHUB_REPO}:rolling

shell:
docker-compose exec api bash

test_env.up:
env | grep GITHUB > .testenv; true
TIMESERIES_ENABLED=${TIMESERIES_ENABLED} docker-compose up -d
Expand Down
14 changes: 0 additions & 14 deletions upload/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,20 +495,6 @@ def insert_commit(commitid, branch, pr, repository, owner, parent_commit_id=None
"state": "pending",
},
)

edited = False
if commit.state != "pending":
commit.state = "pending"
edited = True
if parent_commit_id and commit.parent_commit_id is None:
commit.parent_commit_id = parent_commit_id
edited = True
if branch and commit.branch != branch:
# A branch head may have been moved; this allows commits to be "moved"
commit.branch = branch
edited = True
if edited:
commit.save(update_fields=["parent_commit_id", "state", "branch"])
return commit


Expand Down
50 changes: 0 additions & 50 deletions upload/tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,56 +627,6 @@ def test_insert_commit(self):
assert commit.merged == False
assert commit.parent_commit_id is None

with self.subTest("commit already in database"):
G(
Commit,
commitid="1c78206f1a46dc6db8412a491fc770eb7d0f8a47",
branch="apples",
pullid="456",
repository=repo,
parent_commit_id=None,
)
# parent_commit_id, state, and branch should be updated
insert_commit(
"1c78206f1a46dc6db8412a491fc770eb7d0f8a47",
"oranges",
"123",
repo,
org,
parent_commit_id="different_parent_commit",
)

commit = Commit.objects.get(
commitid="1c78206f1a46dc6db8412a491fc770eb7d0f8a47"
)
assert commit.repository == repo
assert commit.state == "pending"
assert commit.branch == "oranges"
assert commit.pullid == 456
assert commit.merged is None
assert commit.parent_commit_id == "different_parent_commit"

with self.subTest("parent provided"):
parent = G(Commit)
insert_commit(
"8458a8c72aafb5fb4c5cd58f467a2f71298f1b61",
"test",
None,
repo,
org,
parent_commit_id=parent.commitid,
)

commit = Commit.objects.get(
commitid="8458a8c72aafb5fb4c5cd58f467a2f71298f1b61"
)
assert commit.repository == repo
assert commit.state == "pending"
assert commit.branch == "test"
assert commit.pullid is None
assert commit.merged is None
assert commit.parent_commit_id == parent.commitid

def test_parse_request_headers(self):
with self.subTest("Invalid content disposition"):
with self.assertRaises(ValidationError):
Expand Down
Loading