#2706 hub: document getNextRelease method
Merged 3 years ago by tkopecek. Opened 3 years ago by ktdreyer.
ktdreyer/koji doc-get-next-release  into  master

file modified
+22 -2
@@ -4227,8 +4227,28 @@ 

  

  

  def get_next_release(build_info):

-     """find the last successful or deleted build of this N-V. If building is

-     specified, skip also builds in progress"""

+     """

+     Find the next release for a package's version.

+ 

+     This method searches the latest building, successful, or deleted build and

+     returns the "next" release value for that version.

+ 

+     Examples:

+ 

+       None becomes "1"

+       "123" becomes "124"

+       "123.el8" becomes "124.el8"

+       "123.snapshot.456" becomes "123.snapshot.457"

+ 

+     All other formats will raise koji.BuildError.

+ 

+     :param dict build_info: a dict with two keys: a package "name" and

+                             "version" of the builds to search. For example,

+                             {"name": "bash", "version": "4.4.19"}

+     :returns: a release string for this package, for example "15.el8".

+     :raises: BuildError if the latest build uses a release value that Koji

+              does not know how to increment.

+     """

      values = {

          'name': build_info['name'],

          'version': build_info['version'],

Update the getNextRelease RPC docstring to describe what this method does and what the parameter and return values are.

I would also expand it a bit on expected release formats.

Metadata Update from @tkopecek:
- Pull-request tagged with: doc

3 years ago

rebased onto 555e647

3 years ago

Thanks! Those regexes are difficult for me to read at a glance. I updated this PR with your human-readable example values. This should make maintenance easier because we won't have to copy-and-paste regexes between the code and the doc, and interested users can read the hub's source code to find out more about the implementation for now.

Commit 808d3ee fixes this pull-request

Pull-Request has been merged by tkopecek

3 years ago
Metadata