Repository navigation
Move generateGitConfigurationSteps from git.go to yaml_generation.go - #2286
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Move generateGitConfigurationSteps function to yaml_generation.go
Move generateGitConfigurationSteps from git.go to yaml_generation.go
Oct 24, 2025
pelikhan
marked this pull request as ready for review
October 24, 2025 12:04
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
This changeset documents the internal code organization improvement where generateGitConfigurationSteps was moved from git.go to yaml_generation.go for better separation of concerns. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR addresses issue #2273 by moving the
generateGitConfigurationSteps()function frompkg/workflow/git.goto the newly createdpkg/workflow/yaml_generation.gofile. This change improves code organization by ensuring generation logic is properly separated from utility functions.Problem
The
generateGitConfigurationSteps()function was misplaced ingit.go, which should contain git utility logic, not YAML generation logic. This is an example of an "outlier function" that was in the wrong file, making the codebase harder to maintain and understand.Solution
pkg/workflow/yaml_generation.goto house YAML generation functionsgenerateGitConfigurationSteps()fromgit.gotoyaml_generation.gogit.goas it became empty after the move (it contained no utility functions)Changes
Created:
pkg/workflow/yaml_generation.go- New file containing the YAML generation functionDeleted:
pkg/workflow/git.go- Removed as it became empty after moving the functionFunction Details
The
generateGitConfigurationSteps()function generates standardized git credential setup steps for GitHub Actions workflows. It's called by:compiler.go- Main workflow compilationpublish_assets.go- Asset publishing workflowscreate_pull_request.go- PR creation workflowspush_to_pull_request_branch.go- PR branch push workflowsTesting
All existing tests continue to pass:
TestGitConfigurationInMainJob- Verifies git config is included in compiled workflowsTestGitConfigurationStepsHelper- Tests the function directlymake test-unit)make build)Related Issues
Closes #2273 (part of the larger code organization effort)
Original prompt
Fixes #2279
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.