Skip to content

Backport and project card logic - #376

Merged
lykimq merged 6 commits into
masterfrom
quyen@bot_general_pr2
Aug 4, 2026
Merged

Backport and project card logic#376
lykimq merged 6 commits into
masterfrom
quyen@bot_general_pr2

Conversation

@lykimq

@lykimq lykimq commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
  • Rename rocq_push_action to push_action and drive owner/repo/project/org from repo_config
  • Parameterize add_to_column with organization and project number
  • Skip backport on push when github_project_number is absent; match PullRequestCardEdited via install id + project number from config
  • Add tests for backport helpers with and without github_project_number

Remaining Rocq hardcodes for follow-up PRs.

Comment thread src/actions/backport.ml
Comment on lines +39 to 43
else if String.equal base_ref "refs/heads/master" then
(* For now, we hard code that PRs are only backported
from master. In the future, we could make this
configurable in the milestone description or in
some configuration file. *)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess this is going to be the opportunity to move this to the configuration file (can be in a followup PR).

Comment thread src/webhooks/github.ml Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since this call starts to be generic, I think the project_action function also needs to be made generic (currently, it still hardcodes Rocq in one place).

By the way, I believe that project_action was moved to bot-components/github/GitHub_automation.ml by mistake (in a previous PR) and it should probably appear in src/actions/ instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have moved the function project_action to src/action and fix the missing hardcode Rocq in this commit: be7b2af

@lykimq
lykimq requested a review from Zimmi48 August 3, 2026 14:18

@Zimmi48 Zimmi48 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nits to (optionally) address before merging.

Comment thread src/webhooks/github.ml Outdated
with
| None ->
Server.respond_string ~status:`OK
~body:"Unsupported pull request card edition." ()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suggest making the message a little different from the standard case, because here it looks like a backporting project, but we just don't have the project configured.

Comment thread src/webhooks/github.ml
Server.respond_string ~status:`OK
~body:"Unsupported pull request card edition." ()
| Some repo_config ->
let backport_to = String.drop_suffix field 7 in

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In passing: we drop a 7-character suffix because we expect the field to be called <branchname> status, which we checked above. This might be worth detailing in a comment here, and (later) in documentation.

@lykimq
lykimq merged commit 8bf5476 into master Aug 4, 2026
1 check passed
@lykimq
lykimq deleted the quyen@bot_general_pr2 branch August 4, 2026 07:10
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.

2 participants