Skip to content

api.views: add try push handover functionality (bug 2002566)#748

Closed
zzzeid wants to merge 1 commit intomainfrom
zeid/bug-2002566-try-push-lando-github
Closed

api.views: add try push handover functionality (bug 2002566)#748
zzzeid wants to merge 1 commit intomainfrom
zeid/bug-2002566-try-push-lando-github

Conversation

@zzzeid
Copy link
Contributor

@zzzeid zzzeid commented Dec 5, 2025

  • add functionality that adds try_task_config.json file
  • update landing worker to process handover jobs
  • add PullRequestTryLintAPIView
  • add LandingJob.handover_repo field and migrations
  • add LandingJob.is_handed_over field and migrations
  • add Repo.is_try helper method

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

View this pull request in Lando to land it once approved.

@zzzeid zzzeid force-pushed the zeid/bug-2002566-try-push-lando-github branch from 6c48e2b to 9af2c90 Compare December 5, 2025 20:10
@zzzeid zzzeid force-pushed the zeid/bug-2002566-try-push-lando-github branch 2 times, most recently from 57bb01e to 717edd9 Compare December 8, 2025 19:50
@zzzeid zzzeid changed the base branch from main to zeid/bug-2004764-pull-request-job December 8, 2025 19:51
@zzzeid zzzeid force-pushed the zeid/bug-2002566-try-push-lando-github branch 2 times, most recently from b2e9d18 to 6c55a61 Compare December 8, 2025 19:55
@zzzeid zzzeid force-pushed the zeid/bug-2004764-pull-request-job branch from 52b5e9a to 6f7a47b Compare December 12, 2025 19:12
@zzzeid zzzeid force-pushed the zeid/bug-2002566-try-push-lando-github branch 2 times, most recently from 851f024 to 04b776f Compare December 12, 2025 19:21
@zzzeid zzzeid changed the base branch from zeid/bug-2004764-pull-request-job to zeid/bug-2005795-pr-head-sha December 12, 2025 19:22
@zzzeid zzzeid force-pushed the zeid/bug-2002566-try-push-lando-github branch 3 times, most recently from 10cb656 to dca860f Compare December 12, 2025 20:06
@zzzeid zzzeid force-pushed the zeid/bug-2005795-pr-head-sha branch from 589ca64 to dfc58bd Compare December 12, 2025 20:50
@zzzeid zzzeid force-pushed the zeid/bug-2002566-try-push-lando-github branch from dca860f to 5c08094 Compare December 12, 2025 20:52
Copy link
Member

@shtrom shtrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of small nits, but this is looking good to me.

Comment on lines +332 to +337
patch_data = {
"author_name": author_name,
"author_email": author_email,
"commit_message": pull_request.commit_message,
"timestamp": int(datetime.now().timestamp()),
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note for later: We've been building this often enough, we should make it a method of the PullRequest.

@zzzeid zzzeid force-pushed the zeid/bug-2005795-pr-head-sha branch from dfc58bd to 8b10be0 Compare December 16, 2025 17:19
@zzzeid zzzeid marked this pull request as ready for review December 16, 2025 19:56
@zzzeid zzzeid requested a review from a team as a code owner December 16, 2025 19:56
Copy link
Member

@shtrom shtrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. As a nit, I'd rather not change the name of scm.get_diff_from_patches, but we're good to go in otherwise.


@detect_patch_conflict
def get_diff_from_patches(self, patches: str) -> str:
def add_diff_from_patches(self, patches: str) -> str:
Copy link
Member

@shtrom shtrom Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What motivates the change in name? We do a git add in the working directory, but ultimately this is transient, as it's only for the purpose of returning a diff string to the caller.

@zzzeid zzzeid force-pushed the zeid/bug-2005795-pr-head-sha branch from 8b10be0 to dc151a8 Compare December 17, 2025 19:09
@zzzeid zzzeid changed the base branch from zeid/bug-2005795-pr-head-sha to main December 17, 2025 19:25
data = {
"parameters": {
"optimize_target_tasks": True,
"target_tasks_method": "codereview",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this firefox patch is approved, you'll be able to pass all the kwargs in try_task_config parameter.

Your payload should look like:

data {
    "parameters": {
        "optimize_target_tasks": true,
        "target_tasks_method": "codereview",
        "try_mode": "try_task_config",
        "try_task_config": { f"github_{k}": v for k, v in kwargs.items()}
        }
    },
    "version": 2
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I am going to move these changes to their own PR so that this one can be merged before the schema is finalized. Will update with your suggestion in that other PR.

- add functionality that adds try_task_config.json file
- update landing worker to process handover jobs
- add PullRequestTryLintAPIView
- add LandingJob.handover_repo field and migrations
- add LandingJob.is_handed_over field and migrations
- add Repo.is_try helper method
@zzzeid zzzeid force-pushed the zeid/bug-2002566-try-push-lando-github branch from 537201b to f194760 Compare December 18, 2025 17:03
lando-prod-mozilla bot pushed a commit that referenced this pull request Dec 18, 2025
- add functionality that adds try_task_config.json file
- update landing worker to process handover jobs
- add PullRequestTryLintAPIView
- add LandingJob.handover_repo field and migrations
- add LandingJob.is_handed_over field and migrations
- add Repo.is_try helper method

Pull request: #748
@lando-prod-mozilla
Copy link

Pull request closed by commit f8c53f3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants