Skip to main content

Step Priority and Ordering

Step Priority and Ordering

28 Ordered Steps

Understand Custy's 28 priority entries and how they normalize a merged profile sequence.

CommandSTEP_ORDER

Category

Pipeline Reference

Quick Command

lower priority number -> earlier merged-profile position

phase prioritydeduplicationstable sorting

Overview​

STEP_ORDER is a global sort-key map used when Custy merges two or more profiles. Lower values are placed earlier. The gaps between phases leave room for future steps without renumbering the entire pipeline.


When Sorting Applies

Resolver Rules

Single Profile

Expand nested profile references and preserve the profile's declared order. STEP_ORDER is not applied again.

Multiple Profiles

Expand every profile, combine the results, remove repeated names, then sort the unique steps by priority.

Repeated Step

Keep only the first occurrence before sorting. This prevents shared validation or preparation from executing twice.

Unknown Priority

A step missing from STEP_ORDER receives priority 999 and sorts after known steps during composition.

Merged-Profile Algorithm

Normalization Order

1
Validate each profile name
Reject an unknown resolver profile before execution begins.
completed
2
Expand nested profiles
Replace validation subprofiles and other nested references with concrete step definitions.
completed
3
Append expanded definitions
Collect steps from the selected profiles in input order.
completed
4
Deduplicate by step name
Keep the first definition for each unique name.
completed
5
Sort by STEP_ORDER
Apply the numeric priorities with a stable sort, using 999 for missing names.
current

Complete Priority Reference

STEP_ORDER

Lower values sort earlier when several profiles are combined.

0 — Initialization_custy_stepInitialization. Create or refresh project-owned Custy resources.
10 — ensure_git_repo_stepValidation. Require execution inside a Git repository.
11 — ensure_staged_changes_stepValidation. Check the staged-change requirement for commit work.
12 — ensure_commit_validation_provider_stepValidation. Resolve built-in, Commitizen, or Git-policy message validation.
13 — ensure_commit_hook_policy_stepValidation. Resolve native or safe direct pre-commit hook execution.
14 — ensure_commit_message_file_stepValidation. Validate the configured commit-message file setting.
15 — ensure_commit_message_file_exists_stepValidation. Require the commit-message file to exist.
16 — ensure_version_file_stepValidation. Validate the configured version file.
17 — ensure_tag_message_file_stepValidation. Validate the configured tag-message file setting.
18 — ensure_tag_message_file_exists_stepValidation. Require the tag-message file to exist.
19 — ensure_remote_exists_stepValidation. Require the resolved Git remote destinations.
30 — prepare_version_stepPreparation. Resolve the version and tag context used by later stages.
31 — workflow_init_stepPreparation. Initialize branch workflow state and services.
32 — prepare_tag_message_stepPreparation. Prepare tag-message content for the resolved version.
40 — generate_artifacts_stepGeneration and editing. Generate configured release artifacts.
41 — edit_files_stepGeneration and editing. Open generated files for user review and editing.
42 — validate_edited_stepGeneration and editing. Validate files after the editing stage.
43 — apply_version_stepGeneration and editing. Apply the resolved version to configured project files.
44 — generate_changelog_stepGeneration and editing. Run conditional changelog generation.
50 — backup_commit_message_files_stepBackup and cleanup. Back up commit-message content.
51 — backup_tag_message_files_stepBackup and cleanup. Back up tag-message content.
52 — cleanup_backup_stepBackup and cleanup. Apply configured backup retention cleanup.
70 — stage_stepGit execution. Stage the files selected by the workflow.
71 — commit_stepGit execution. Create the local Git commit.
72 — tag_stepGit execution. Create the local Git tag.
73 — push_stepGit execution. Push HEAD and an eligible tag to resolved remotes.
80 — cleanup_branches_stepBranch cleanup. Run configured branch cleanup behavior.
90 — finalize_stepFinalization. Invoke experimental post-release workflow transitions.

Worked Example: push + commit

Both custy run push commit and custy run commit push currently normalize to the same 19 steps. The CLI input order does not move push_step ahead of validation, preparation, or commit_step.

Normalized merged order
text
01  ensure_git_repo_step                  priority 10
02  ensure_staged_changes_step            priority 11
03  ensure_commit_validation_provider_step priority 12
04  ensure_commit_hook_policy_step         priority 13
05  ensure_commit_message_file_step        priority 14
06  ensure_commit_message_file_exists_step priority 15
07  ensure_remote_exists_step              priority 19
08  prepare_version_step                   priority 30
09  workflow_init_step                     priority 31
10  generate_artifacts_step                priority 40
11  edit_files_step                        priority 41
12  validate_edited_step                   priority 42
13  apply_version_step                     priority 43
14  generate_changelog_step                priority 44
15  backup_commit_message_files_step       priority 50
16  cleanup_backup_step                    priority 52
17  stage_step                             priority 70
18  commit_step                            priority 71
19  push_step                              priority 73


Continue