Skip to content

Pull init command's Run method logic into separate method in new file #37327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SarahFrench
Copy link
Member

This PR doesn't change the logic of the Run method on the init command, but it refactors code so that logic is in a separate file.

This is preparation for making non-trivial changes to the init command's Run method for the PSS project. Our intention is to end up with the Run command looking like this:

// internal/command/init.go
func (c *InitCommand) run(args []string) int {
    if c.Meta.AllowExperimentalFeatures {
        // use experimental version of init logic
    } else {
        // use original version of init logic in internal/command/init_run.go
    }
}

There would be the original version of the run logic in internal/command/init_run.go and in future we'd add a newer version of the logic in a yet-to-be-made file. We can then iterate on the newer version of the logic on main branch ok, and when PSS stops being experimental we would update the contents of internal/command/init_run.go.

Target Release

1.14.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@SarahFrench SarahFrench added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Jul 15, 2025
@SarahFrench SarahFrench marked this pull request as ready for review July 15, 2025 15:37
@SarahFrench SarahFrench requested a review from a team as a code owner July 15, 2025 15:37
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog-needed Add this to your PR if the change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants