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

(GH-808) Implement pdk release subcommand #809

Merged
merged 2 commits into from
Dec 4, 2019

Conversation

glennsarti
Copy link
Contributor

RFC 003 [1] defines the experience and behavior of the new pdk release sub
command. This commit:

  • Adds the root subcommand release with all of the available skip options.
    This will allow the later release build and so on sub-sub-commands to be
    implemented much easier. Future commits will add these sub-sub commands.

  • Adds a PDK::Module::Release class which does all of the release process

  • Adds tests for Release process

[1] https://github.com/puppetlabs/pdk-planning/blob/master/RFCs/0003-add-pdk-release.md

@glennsarti glennsarti requested a review from a team as a code owner November 25, 2019 07:55
@glennsarti glennsarti added this to the December 2019 milestone Nov 25, 2019
@glennsarti glennsarti self-assigned this Nov 25, 2019
@glennsarti glennsarti requested review from rodjek and carabasdaniel and removed request for a team November 25, 2019 07:56
@glennsarti
Copy link
Contributor Author

Note that this does not implement the sub-sub commands e.g. pdk release build. That will come in later PRs. This is quite a big PR already so no need to add more.

@coveralls
Copy link

coveralls commented Nov 25, 2019

Coverage Status

Coverage decreased (-0.7%) to 91.209% when pulling f0a8453 on glennsarti:daniel_release_command into 08187eb on puppetlabs:master.

@glennsarti glennsarti force-pushed the daniel_release_command branch from edae59c to 5085cbc Compare November 26, 2019 01:27
@glennsarti
Copy link
Contributor Author

Marked this as (Experimental) as well.

lib/pdk/cli/release.rb Outdated Show resolved Hide resolved
lib/pdk/cli/release.rb Outdated Show resolved Hide resolved
lib/pdk/cli/release.rb Outdated Show resolved Hide resolved
lib/pdk/module/release.rb Outdated Show resolved Hide resolved
lib/pdk/module/release.rb Show resolved Hide resolved
lib/pdk/util/changelog_generator.rb Outdated Show resolved Hide resolved
@glennsarti glennsarti force-pushed the daniel_release_command branch 2 times, most recently from a1864bc to dff56ab Compare November 28, 2019 01:21
lib/pdk/module/release.rb Show resolved Hide resolved
end
new_version = module_metadata.data['version'] if new_version.nil?

if new_version != module_metadata.data['version']
Copy link

Choose a reason for hiding this comment

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

Could this be tied to a --force type flag? It seems more likely that someone typos the version (1.0.1 instead of 1.1.0) and automatically changing it without specific acknowledgement of the difference could lead to undesired results.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is an implicit force in play here. The user has to specify --version <...> on the command line in order for that to happen. Adding a requirement for --force as well seems unnecessary as this 2nd command line argument is not intuitive and gives no extra safety.

Daniel Carabas and others added 2 commits December 4, 2019 11:14
RFC 003 [1] defines the experience and behavior of the new pdk release sub
command.  This commit:

* Adds the root subcommand `release` with all of the available skip options.
  This will allow the later `release build` and so on sub-sub-commands to be
  implemented much easier. Future commits will add these sub-sub commands.

* Adds a PDK::Module::Release class which does all of the release process

* Adds tests for Release process

[1] https://github.com/puppetlabs/pdk-planning/blob/master/RFCs/0003-add-pdk-release.md
Previously the changelog file was hardcoded to CHANGELOG.MD however this is not
the default filename.  This commit updates the changelog_file method to search
for different file extensions for the Changelog.  Typically this would only
affect case-sensitive file systems.

This commit also updates the changelog_content to return an empty string if the
changelog file could not be found.  This helps modules which are being released
for the first time, that may not have a changelog file yet.
@glennsarti glennsarti force-pushed the daniel_release_command branch from dff56ab to f0a8453 Compare December 4, 2019 03:15
@glennsarti glennsarti merged commit 33a1b0d into puppetlabs:master Dec 4, 2019
@glennsarti glennsarti deleted the daniel_release_command branch December 5, 2019 03:22
@rodjek rodjek added the feature label Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants