Skip to content

feat(treescript): Bug 2015581 Add github create branch action#1341

Merged
hneiva merged 1 commit intomasterfrom
hneiva/ios-merge-automation
Feb 12, 2026
Merged

feat(treescript): Bug 2015581 Add github create branch action#1341
hneiva merged 1 commit intomasterfrom
hneiva/ios-merge-automation

Conversation

@hneiva
Copy link
Contributor

@hneiva hneiva commented Feb 9, 2026

No description provided.

@hneiva hneiva requested a review from a team as a code owner February 9, 2026 19:06
@hneiva hneiva marked this pull request as draft February 9, 2026 19:07
@hneiva hneiva force-pushed the hneiva/ios-merge-automation branch 2 times, most recently from 9b3ef08 to 302b928 Compare February 9, 2026 21:01
@hneiva hneiva requested a review from Eijebong February 9, 2026 21:05
@hneiva hneiva marked this pull request as ready for review February 9, 2026 21:13
Copy link
Contributor

@Eijebong Eijebong left a comment

Choose a reason for hiding this comment

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

A bunch of minor things. Also I would've preferred if this had been split in 2 commits (I'm not even sure submitting the whole thing was intentional), the version bump in xcconfig and the branch creation since they're completely unrelated in code. Neither the commit nor the bug even mentions that version bump semantic change.

repo = (await self._client.execute(str_info_query))["repository"]

if repo.get("object") is None:
raise UnknownBranchError(f"branch '{source_branch}' not found in repo!")
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should also check if the branch already exists and bail early? I'm seeing the "branch creation passed but version bump got 500s" already...

Although there's an argument for saying that if the branch already exists it could've been created by mistake by a human and shouldn't be used and thus failing here is the right thing to do...

@hneiva hneiva force-pushed the hneiva/ios-merge-automation branch 2 times, most recently from 65e421a to 0340d98 Compare February 10, 2026 17:12
TreeScriptError: If branch_name is not specified in the task.
"""
create_branch_info = get_create_branch_info(task)
if "branch_name" not in create_branch_info:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I don't think this can happen? I'd expect schema validation to fail it early

"create_branch_info": {
    "type": "object",
    "properties": {
        "branch_name": {
            "type": "string"
        }
    },
    "required": [
        "branch_name"
    ]
},

Copy link
Contributor Author

Choose a reason for hiding this comment

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

create_branch_info can be None

Copy link
Contributor

Choose a reason for hiding this comment

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

But then we have another problem?

>>> "branch_name" not in None
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    "branch_name" not in None
TypeError: argument of type 'NoneType' is not a container or iterable

Copy link
Contributor

Choose a reason for hiding this comment

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

Also it can't be None at that point

create_branch_info = task.get("payload", {}).get("create_branch_info")
if not create_branch_info:
    raise TaskVerificationError("Requested create branch but no create_branch_info in payload")

@hneiva hneiva enabled auto-merge (rebase) February 12, 2026 16:12
@hneiva hneiva force-pushed the hneiva/ios-merge-automation branch from 0340d98 to 0ca95c6 Compare February 12, 2026 16:12
@hneiva hneiva merged commit f723d6e into master Feb 12, 2026
27 checks passed
@hneiva hneiva deleted the hneiva/ios-merge-automation branch February 12, 2026 16:19
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