diff --git a/docs/user/automation-rules.rst b/docs/user/automation-rules.rst index c00f716b51e..e52be336613 100644 --- a/docs/user/automation-rules.rst +++ b/docs/user/automation-rules.rst @@ -28,7 +28,7 @@ All enabled automation rules are evaluated for that version, in the order they are listed. A rule has three groups of conditions, which are checked in order: -1. The version **type** must be one of the version types selected in the rule (tag, branch, or external). +1. The version **type** must be one of the version types selected in the rule (tag, branch, or pull request). 2. The version **name** must match the version pattern in the rule. 3. If any **webhook filter** is configured, the data from the webhook event (changed files, commit message, or pull request labels) must also match. @@ -49,7 +49,7 @@ Each rule applies to one or more version types: - **Tag** — Git tags pushed to the repository. - **Branch** — Git branches pushed to the repository. -- **External** — pull/merge requests opened against the repository. +- **Pull request** — pull/merge requests opened against the repository. You can select any combination of types in a single rule. @@ -259,7 +259,7 @@ Only build when documentation files change ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Match: ``Any version`` -- Version types: ``Tag``, ``Branch``, ``External`` +- Version types: ``Tag``, ``Branch``, ``Pull request`` - Changed files: .. code-block:: text @@ -277,7 +277,7 @@ Configure a single rule that triggers a build only when the commit message does *not* contain ``[skip ci]``: - Match: ``Any version`` -- Version types: ``Tag``, ``Branch``, ``External`` +- Version types: ``Tag``, ``Branch``, ``Pull request`` - Commit message: ``^(?!.*\[skip ci\]).*`` - Action: ``Trigger build for version`` @@ -285,6 +285,6 @@ Only build pull requests labeled with ``documentation`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Match: ``Any version`` -- Version type: ``External`` +- Version type: ``Pull request`` - Pull request labels: ``^documentation$`` - Action: ``Trigger build for version`` diff --git a/readthedocs/builds/constants.py b/readthedocs/builds/constants.py index 3597085abf7..1a76583566e 100644 --- a/readthedocs/builds/constants.py +++ b/readthedocs/builds/constants.py @@ -47,7 +47,7 @@ # Manager name for External Versions or Builds. # ie: Only pull request/merge request Versions and Builds. EXTERNAL = "external" -EXTERNAL_TEXT = _("External") +EXTERNAL_TEXT = _("Pull request") BRANCH = "branch" BRANCH_TEXT = _("Branch") diff --git a/readthedocs/builds/migrations/0073_alter_automationrulematch_version_type_and_more.py b/readthedocs/builds/migrations/0073_alter_automationrulematch_version_type_and_more.py new file mode 100644 index 00000000000..6765cc54c33 --- /dev/null +++ b/readthedocs/builds/migrations/0073_alter_automationrulematch_version_type_and_more.py @@ -0,0 +1,76 @@ +# Generated by Django 5.2.13 on 2026-06-03 09:38 + +from django.db import migrations +from django.db import models +from django_safemigrate import Safe + + +class Migration(migrations.Migration): + safe = Safe.before_deploy() + + dependencies = [ + ("builds", "0072_remove_deprecated_build_fields"), + ] + + operations = [ + migrations.AlterField( + model_name="automationrulematch", + name="version_type", + field=models.CharField( + choices=[ + ("branch", "Branch"), + ("tag", "Tag"), + ("external", "Pull request"), + ("unknown", "Unknown"), + ], + max_length=32, + ), + ), + migrations.AlterField( + model_name="build", + name="version_type", + field=models.CharField( + blank=True, + choices=[ + ("branch", "Branch"), + ("tag", "Tag"), + ("external", "Pull request"), + ("unknown", "Unknown"), + ], + max_length=32, + null=True, + verbose_name="Version type", + ), + ), + migrations.AlterField( + model_name="version", + name="type", + field=models.CharField( + choices=[ + ("branch", "Branch"), + ("tag", "Tag"), + ("external", "Pull request"), + ("unknown", "Unknown"), + ], + db_index=True, + default="unknown", + max_length=20, + verbose_name="Type", + ), + ), + migrations.AlterField( + model_name="versionautomationrule", + name="version_type", + field=models.CharField( + choices=[ + ("branch", "Branch"), + ("tag", "Tag"), + ("external", "Pull request"), + ("unknown", "Unknown"), + ], + help_text="Type of version the rule should be applied to", + max_length=32, + verbose_name="Version type", + ), + ), + ] diff --git a/readthedocs/projects/migrations/0165_alter_automationrulematch_version_type.py b/readthedocs/projects/migrations/0165_alter_automationrulematch_version_type.py new file mode 100644 index 00000000000..981ec4013ef --- /dev/null +++ b/readthedocs/projects/migrations/0165_alter_automationrulematch_version_type.py @@ -0,0 +1,29 @@ +# Generated by Django 5.2.13 on 2026-06-03 09:38 + +from django.db import migrations +from django.db import models +from django_safemigrate import Safe + + +class Migration(migrations.Migration): + safe = Safe.before_deploy() + + dependencies = [ + ("projects", "0164_show_build_overview_in_comment_default_true"), + ] + + operations = [ + migrations.AlterField( + model_name="automationrulematch", + name="version_type", + field=models.CharField( + choices=[ + ("branch", "Branch"), + ("tag", "Tag"), + ("external", "Pull request"), + ("unknown", "Unknown"), + ], + max_length=32, + ), + ), + ]