...
...
hideHeader | true |
---|---|
url | https://bitbucket.org/mibexsoftware/codeowners-documentation/src/main/bitbucket-dc/devsensei.md |
syntaxHighlighting | Markdown |
DevSensei: PR Workflow Automation
Workflow Automation for Dev Teams
What is DevSensei?
DevSensei is a new pull request workflow automation solution integrated into the Code Owners App.
...
Here's an example devsensei.yaml
that assigns Code Owners for a pull request introducing a new feature where the pull request is opened from a branch including the prefix feature/
with the destination branch being main
or release
:
Code Block | ||
---|---|---|
| ||
workflows: - name: Add Code Owners conditions: - source~=feature/* - or: - destination=main - destination~=release/* actions: - add-codeowners: rules: | *.js @@frontendDevs devsensei.yaml @@team |
...
Code Owners Settings NOT supported in DevSensei add-codeowners action
Code Owners feature | Why not supported / Alternative? |
---|---|
| May be added later |
| Obsolete with includes |
...
Each workflow is meant to automate specific tasks for the pull requests of your team.
Attributes | Definition | ||||
---|---|---|---|---|---|
name | The name of the workflow. Must be unique in a repository. | ||||
conditions | A set of conditions to be met for the actions of the workflow to be executed for a pull request | ||||
actions | A set of actions to be executed when the conditions are met for a pull request | ||||
overrides | A workflow with the same name can be overridden in the main devsensei.yaml file. If so, the workflow object must have
|
Conditions
Conditions define the criteria that must be met so that the actions of a workflow are executed. They allow you to define which pull requests should be handled by DevSensei based on various criteria like the draft pull request status, source and destination branches, and more.
...
Code Block | ||
---|---|---|
| ||
conditions: - or: - destination=main - destination~=release/* - source~!=hotfix/* |
Condition Attributes | Meaning |
---|---|
| Source branch of pull request |
| Destination branch of pull request |
| Is it a draft pull request |
Conditions Combination Operator | Meaning |
---|---|
| All conditions must be fulfilled |
| At least one of the conditions must be fulfilled |
Conditions Attributes Operator | Meaning |
---|---|
| Glob match |
| Glob negative match |
| Equals |
| Not equals |
| Negate a boolean attribute |
Actions
add-codeowners
Adds Code Owners as reviewers to a pull request.
Attributes | Definition | |||||
---|---|---|---|---|---|---|
assignment-routing |
reduce the number of Code Owners that are automatically assigned to a pull request. (opt-in) Currently, the only available method of assignment is at random.
| |||||
rules | The Code Owners rules and merge checks. For existing
| |||||
custom-groups | Define custom Code Owners groups.
| |||||
auto-unapprove-on-change | Remove approval if owned code changes.
|
Includes
With includes
, common Devsensei workflows can be shared both across repositories as well within projects in a monorepo.
...
The files are read from the latest commit of the default branch
YAML Anchors will be resolved per file.
Only one level of includes are support (no recursion supported)
YAML Anchors
Use YAML Anchors to define reusable content in the same YAML file.
...