Skip to content
Closed
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
1 change: 1 addition & 0 deletions src/lando/api/tests/test_landings.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ def test_integrated_execute_job_pull_request(
"requester_email": "test@example.com",
"target_repo": repo,
"attempts": 1,
"is_pull_request_job": True,
}
job = make_landing_job(revisions=revisions, **job_params)

Expand Down
4 changes: 3 additions & 1 deletion src/lando/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ class Form(forms.Form):
return JsonResponse(form.errors, 400)

job = LandingJob.objects.create(
target_repo=target_repo, requester_email=ldap_username
target_repo=target_repo,
requester_email=ldap_username,
is_pull_request_job=True,
)
author_name, author_email = pull_request.author

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.2.8 on 2025-12-08 19:30

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("main", "0039_alter_repo_hooks_PreventDotGithubCheck"),
]

operations = [
migrations.AddField(
model_name="landingjob",
name="is_pull_request_job",
field=models.BooleanField(blank=True, default=False),
),
]
5 changes: 1 addition & 4 deletions src/lando/main/models/landing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ class LandingJob(BaseJob):
Revision, through="RevisionLandingJob", related_name="landing_jobs"
)

@property
def is_pull_request_job(self) -> bool:
"""Return True if all revisions in the landing job have a pull_number set."""
return not self.revisions.filter(pull_number__isnull=True).exists()
is_pull_request_job = models.BooleanField(default=False, blank=True)

@property
def landed_phabricator_revisions(self) -> dict:
Expand Down