Skip to content

🔧 Fix repository checkout logic in workflow compiler#15279

Merged
dsyme merged 1 commit intomainfrom
rel
Feb 13, 2026
Merged

🔧 Fix repository checkout logic in workflow compiler#15279
dsyme merged 1 commit intomainfrom
rel

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Feb 13, 2026

Summary

  • Simplified and standardized repository checkout logic in workflow compiler
  • Always add checkout step unless it's already present in custom steps
  • Extracted common action reference generation logic into a separate function

Key Changes

  • Created getActionRef() function to centralize action reference generation
  • Modified shouldAddCheckoutStep() to always add checkout by default
  • Updated related tests to reflect new checkout behavior
  • Removed complex conditional logic for checkout step determination

Copilot AI review requested due to automatic review settings February 13, 2026 03:03

// getActionRef returns the action reference string based on action mode and version
func getActionRef(actionMode workflow.ActionMode, version string) string {
if actionMode.IsRelease() && version != "" && version != "dev" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Dev contains "dirty" sometimes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just factoring out code

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies and standardizes the repository checkout logic in the workflow compiler and extracts common action reference generation logic into a reusable helper function.

Changes:

  • Simplified checkout step logic to always add checkout unless it's already in custom steps (removed complex conditional logic based on action mode and agent files)
  • Extracted common action reference generation pattern into getActionRef() helper function
  • Updated all related tests to reflect the new simplified checkout behavior

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/workflow/compiler_jobs.go Simplified shouldAddCheckoutStep() to always return true unless custom steps contain checkout, removed complex conditional logic for action modes and agent files
pkg/cli/copilot_setup.go Added getActionRef() helper function and refactored four locations to use it instead of duplicating the action reference logic
pkg/workflow/compiler_jobs_test.go Updated test expectation for release mode without agent file to expect checkout (changed from false to true)
pkg/workflow/compiler_yaml_main_job_test.go Updated test name and expectation to reflect that checkout is required in release mode without agent file
pkg/workflow/engine_agent_import_test.go Updated test name, comment, and expectation to reflect that checkout is always added without agent

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dsyme dsyme merged commit a0e753a into main Feb 13, 2026
175 checks passed
@dsyme dsyme deleted the rel branch February 13, 2026 03:16
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.

3 participants