Skip to content
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

Release tools - execute git commit --dry-run to prevent unexpected crashes #17967

Open
pomek opened this issue Feb 20, 2025 · 0 comments
Open
Labels
package:dev squad:platform Issue to be handled by the Platform team. type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@pomek
Copy link
Member

pomek commented Feb 20, 2025

📝 Provide a description of the improvement

Our platform implements custom release tools. It allows for the preparation of the packages to be published on npm but also executes a dry run that produces packages but does not impact the repository (do not create a commit, a tag, etc.).

The dry-run mode is implemented by defining a skip callback:

{
title: 'Commit & tag phase.',
task: ctx => {
return releaseTools.commitAndTag( {
version: latestVersion,
files: [
'package.json',
`${ PACKAGES_DIRECTORY }/*/package.json`,
`${ PACKAGES_DIRECTORY }/ckeditor5-build-*/build/**`,
...ctx.updatedFiles
]
} );
},
skip: () => {
if ( isNonCommittableRelease( cliArguments ) ) {
return true;
}
// When compiling the packages only, do not commit anything.
if ( cliArguments.compileOnly ) {
return true;
}
return false;
}
}

While it worked and works fine in most cases, I think it isn't a proper approach as we miss execution of static analysis tools, like ESLint (attached as a pre-commit hook).

I would like to update our tools and processes:

  • Git allows creating a commit in the dry-run mode. (ref)
  • Verify and implement the dry-run mode in the commitAndTag() function.
  • Update the Commit & tag phase. task in release tools. Instead of skipping it, pass the new flag.

Definition of Done

  • commitAndTag() allows of creation of a new commit using the dry-run mode.
  • The Commit & tag phase. task defines whether a commit should be done using the dry-run mode.
  • All of our repositories using our tools are updated.
@pomek pomek added package:dev squad:platform Issue to be handled by the Platform team. type:improvement This issue reports a possible enhancement of an existing feature. labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:dev squad:platform Issue to be handled by the Platform team. type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests

1 participant