Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
af52580
github: add GitHubAPI, GitHubAPIClient classes (bug 1989637)
zzzeid Sep 19, 2025
456ba02
github: add pull request view, url, template (bug 1989963)
zzzeid Sep 26, 2025
9e76920
github: add pull request endpoint (bug 1991125)
zzzeid Oct 6, 2025
1c63a7a
pull_request: add more functionality to end points and ui (bug 1991125)
zzzeid Oct 14, 2025
dea1b83
github: add write methods (bug 1989960)
zzzeid Oct 15, 2025
5f9c40d
landing_worker: add comment + close pr functionality (bug 1994736)
zzzeid Oct 17, 2025
a54f526
github: add GitHubAPI, GitHubAPIClient classes (bug 1989637) (#536)
zzzeid Oct 22, 2025
f9cc520
github: add pull request view, url, template (bug 1989963) (#553)
zzzeid Oct 22, 2025
46cc0be
github: add pull request endpoint (bug 1991125) (#582)
zzzeid Oct 22, 2025
d5de18f
pull_request: add more functionality to end points and ui (bug 1991125)
zzzeid Oct 14, 2025
dfc7be3
Merge branch 'zeid/bug-1991125-landing-job-backend-frontend' of githu…
zzzeid Oct 22, 2025
1446cb0
code review feedback
zzzeid Oct 22, 2025
5fc249b
code review feedback
zzzeid Oct 24, 2025
c5303a7
clean up
zzzeid Oct 27, 2025
18b2b88
more clean up
zzzeid Oct 27, 2025
f0dc67a
minor change
zzzeid Oct 27, 2025
1652ee6
minor change
zzzeid Oct 27, 2025
850827c
clean up
zzzeid Oct 27, 2025
e22d561
small refactor
zzzeid Oct 27, 2025
e957288
fixes
zzzeid Oct 27, 2025
138326c
small fix
zzzeid Oct 27, 2025
d9651bd
Merge branch 'zeid/bug-1991125-landing-job-backend-frontend' into zei…
zzzeid Oct 27, 2025
0ba490c
Merge branch 'zeid/bug-1989960-modify-pr-api' into zeid/bug-1994736-c…
zzzeid Oct 27, 2025
4daf7dd
fix error
zzzeid Oct 27, 2025
d2cf002
pull_request: add more functionality to end points and ui (bug 199112…
zzzeid Oct 28, 2025
a9a01e9
github: add write methods (bug 1989960) (#611)
zzzeid Oct 28, 2025
30969da
Merge branch 'zeid/bug-1989635-github-pr-pilot' into zeid/bug-1994736…
zzzeid Oct 28, 2025
34074e5
merge fixups
zzzeid Oct 28, 2025
fbd254f
Merge branch 'zeid/bug-1989635-github-pr-pilot' into zeid/bug-1994736…
zzzeid Oct 28, 2025
5b15cc7
merge fixes
zzzeid Oct 28, 2025
7bb963d
Revert "merge fixes"
zzzeid Oct 28, 2025
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
10 changes: 10 additions & 0 deletions src/lando/api/legacy/workers/landing_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
)
from lando.pushlog.pushlog import PushLog, PushLogForRepo
from lando.utils.config import read_lando_config
from lando.utils.github import GitHubAPIClient
from lando.utils.tasks import phab_trigger_repo_update

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -144,6 +145,15 @@ def run_job(self, job: LandingJob) -> bool:
job.set_landed_commit_ids()
job.transition_status(JobAction.LAND, commit_id=commit_id)

if job.is_pull_request_job:
# TODO: move this to different method, and retry if needed.
Comment thread
zzzeid marked this conversation as resolved.
# NOTE: This may need to happen on the revision-level when stack support is added.
pull_number = job.revisions.first().pull_number
message = f"Pull request closed by commit {commit_id}"
client = GitHubAPIClient(job.target_repo)
Comment thread
zzzeid marked this conversation as resolved.
client.add_comment_to_pull_request(pull_number, message)
client.close_pull_request(pull_number)

mots_path = Path(repo.path) / "mots.yaml"
if mots_path.exists():
logger.info(f"{mots_path} found, setting reviewer data.")
Expand Down
5 changes: 5 additions & 0 deletions src/lando/main/models/landing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ 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()

@property
def landed_phabricator_revisions(self) -> dict:
"""Return a mapping associating Phabricator revision IDs with the ID of the landed Diff."""
Expand Down