Branching AIP Logic(分支化 AIP 逻辑(Branching AIP Logic))¶
AIP Logic integrates with Global Branching to enable safe, isolated development of Logic functions. This documentation covers how to work with Logic on branches, including adding and modifying resources, cross-application compatibility, rebasing, and the approval process.
For general information on Global Branching concepts and workflows, refer to the Global Branching documentation.
Adding, removing, and modifying resources¶
Add Logic functions to a branch¶
To add a Logic function to a branch:
- Navigate to the Logic file on a branch or select the designated branch using the branch selector in the top right of the page.
- Make an edit and save the Logic file. The Logic function is now a saved resource on the branch.
Remove Logic functions¶
To remove a Logic function from a branch, use the bottom right sidebar and select Remove from branch.

Modify Logic functions¶
To modify a Logic function on a branch, make any change and save, just as you would on the main branch.
Publish on a branch¶
You can publish a Logic function on a branch by following the same process as on main. Once you have successfully published your function on the branch, you can use the new function version on your branch in Workshop and function-backed actions. This function version is labeled with the Branched pre-release tag. Note that functions published on your branch will not be accessible from other branches, including main.
Cross-application compatibility¶
Using branched Logic functions¶
Branched Logic functions can be used with:
- Ontology objects: Functions can interact with ontology objects on the same branch.
- Other branch-aware applications: Any Foundry application that uses Logic functions and supports branching (for example, Workshop).
Merge requirements¶
Deployability checks¶
Before a Logic function can be deployed, it must:
- Be up to date with main (no rebase required)
- Be published on the branch
- Be in a publishable state (no errors)
- Have no pending approvals
Approvals and reviewer flow¶
Protected main branch¶
You can protect your main branch to disable direct edits to Logic functions on main. When protection is enabled, all changes must be made on a branch, reviewed, and merged through the proposal process.
To protect a branch, navigate to the resource in Compass and select Branch protection > Protect with project policy.

To protect all Logic files in a project by default, enable protection at the project level. Any new Logic file created in that project will automatically be protected.
Reviewer experience¶
Once a proposal is created, reviewers can be added to the Logic file in the Global Branching application. Users who are added as reviewers will get an email requesting their review with a link to the proposal.
From there, reviewers can:
- Access the review page by selecting the Review option at the top right of the file. This option is visible when a Logic function requires review.

- View a side-by-side comparison of
mainvs. branch changes. - See all modifications to Logic functions.
- Approve or reject the changes.
- Edit their review.

Rebasing and conflict resolution¶
Rebasing is required when the main branch has been modified since your branch was created or was last rebased. If your Logic function requires rebasing, you will see a notification at the top of the Logic file.

How to rebase¶
-
Navigate to the Logic function that needs rebasing and select the Rebase option.
-
Review the changes in the split-screen comparison view. The left side shows the current
mainversion, and the right shows your branch version.
-
Make necessary changes to your branch, potentially incorporating changes from
mainif there are merge conflicts. -
Finish rebasing by selecting Finish.
Known limitations¶
- Branches can only be created from
main. You cannot create branches from other branches. - API names cannot be changed on a branch. All Logic functions across branches share the same API name.
- Published Logic functions cannot be deleted while on a branch.
- Merge conflict resolution requires manual intervention. When conflicts occur during rebasing, you must use the split-screen comparison view to manually incorporate changes from
maininto your branch version, resolving any conflicting modifications before completing the rebase.
中文翻译¶
分支化 AIP 逻辑(Branching AIP Logic)¶
AIP Logic 与全局分支化(Global Branching)集成,支持对 Logic 函数进行安全、隔离的开发。本文档涵盖如何在分支上使用 Logic,包括添加和修改资源、跨应用兼容性、变基(rebasing)以及审批流程。
有关全局分支化概念和工作流程的通用信息,请参阅全局分支化文档。
添加、删除和修改资源¶
向分支添加 Logic 函数¶
向分支添加 Logic 函数的步骤如下:
- 导航至分支上的 Logic 文件,或使用页面右上角的分支选择器(branch selector)选择指定分支。
- 进行编辑并保存 Logic 文件。该 Logic 函数现在成为分支上的一个已保存资源。
删除 Logic 函数¶
要从分支中删除 Logic 函数,请使用右下角的侧边栏,选择从分支中移除(Remove from branch)。

修改 Logic 函数¶
要修改分支上的 Logic 函数,进行任何更改并保存,操作方式与在主分支(main branch)上相同。
在分支上发布¶
您可以按照与主分支相同的流程在分支上发布 Logic 函数。在分支上成功发布函数后,您可以在 Workshop 和函数支持的操作(function-backed actions)中使用该分支上的新函数版本。此函数版本会带有分支预发布(Branched pre-release)标签。请注意,在您的分支上发布的函数无法从其他分支(包括 main)访问。
跨应用兼容性¶
使用分支化 Logic 函数¶
分支化 Logic 函数可用于:
- 本体对象(Ontology objects): 函数可以与同一分支上的本体对象进行交互。
- 其他支持分支的应用: 任何使用 Logic 函数并支持分支化的 Foundry 应用(例如 Workshop)。
合并要求¶
可部署性检查¶
Logic 函数在部署前必须满足以下条件:
- 与主分支保持同步(无需变基)
- 已在分支上发布
- 处于可发布状态(无错误)
- 无待处理的审批
审批与审阅者流程¶
受保护的主分支¶
您可以保护主分支,禁止直接编辑 main 上的 Logic 函数。启用保护后,所有更改必须在分支上进行,通过提案流程(proposal process)进行审阅和合并。
要保护分支,请导航至 Compass 中的资源,选择分支保护(Branch protection)> 使用项目策略保护(Protect with project policy)。

要默认保护项目中的所有 Logic 文件,请在项目级别启用保护。在该项目中创建的任何新 Logic 文件将自动受到保护。
审阅者体验¶
创建提案后,可以在全局分支化应用中将审阅者添加到 Logic 文件中。被添加为审阅者的用户将收到一封请求审阅的电子邮件,其中包含指向该提案的链接。
审阅者可以执行以下操作:
- 通过选择文件右上角的审阅(Review)选项访问审阅页面。当 Logic 函数需要审阅时,此选项可见。

- 查看
main与分支更改的并排对比。 - 查看对 Logic 函数的所有修改。
- 批准或拒绝更改。
- 编辑其审阅意见。

变基与冲突解决¶
当主分支在您的分支创建或上次变基之后被修改时,需要进行变基。如果您的 Logic 函数需要变基,您将在 Logic 文件顶部看到一条通知。

如何进行变基¶
-
导航到需要变基的 Logic 函数,选择变基(Rebase)选项。
-
在分屏对比视图中审阅更改。左侧显示当前
main版本,右侧显示您的分支版本。
-
对您的分支进行必要的更改,如果存在合并冲突,可能需要合并来自
main的更改。 -
选择完成(Finish)以完成变基。
已知限制¶
- 分支只能从
main创建。您不能从其他分支创建分支。 - 不能在分支上更改 API 名称。所有分支上的 Logic 函数共享相同的 API 名称。
- 已发布的 Logic 函数在分支上无法删除。
- 合并冲突解决需要手动干预。在变基过程中发生冲突时,您必须使用分屏对比视图手动将
main的更改合并到您的分支版本中,解决所有冲突的修改,然后才能完成变基。