#2620 "--write" option for koji import-sig has no effect
Closed: Fixed 3 years ago by tkopecek. Opened 3 years ago by ktdreyer.

The import-sig sub-command always calls the writeSignedRPM RPC (if the user does not specify --test). Nothing checks whether the user has specified the --write option, and it's effectively always true. There's no way to run import-sig without writing the signed copies.

This behavior is almost certainly what users want anyway, so we might as well deprecate the --write flag and then remove it from the CLI.

Steps to reproduce:

  1. Do a build in Koji
  2. Download the build
  3. GPG-sign it with a key
  4. Use the import-sig command, eg. koji -p kojidev import-sig bash-5.0.17-2.fc33.src.rpm . Note the output.
  5. Review the command options withkoji import-sig --help

Actual results:
koji import-sig unconditionally writes the signed copies. The koji CLI shows the following output:

Importing signature [key 782096ac] from bash-5.0.17-2.fc33.src.rpm...
Writing signed copy

The --help text incorrectly indicates that Koji will only write the signed copies if the user specifies the --write flag.

Expected results
koji import-sig should unconditionally write the signed copies, and the --help text should mention that --write has no effect and is deprecated. Running import-sig with --write should print a DeprecationWarning.


Looks like it's been this way since we introduced this flag in f570704

The unit tests actually do verify that session.writeSignedRPM.assert_has_calls(write_sig_calls)

We could update the help text to indicate this as well.

 def handle_import_sig(goptions, session, args):
-    "[admin] Import signatures into the database"
+    "[admin] Import signatures into the database and write signed RPMs"

Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue set to the milestone: 1.24

3 years ago

I would prefer to not break working command lines. I would suggest making the option hidden in the help, but still accept it for compatibility. I don't know if we need to actually deprecate it. Many Unix commands accept such historical options for compatibility.

Ok. Looks like the way to do this in optparse is help=SUPPRESS_HELP.

Metadata Update from @jcupova:
- Issue tagged with: testing-ready

3 years ago

Metadata Update from @jcupova:
- Issue tagged with: testing-done

3 years ago

Commit 72cf4a0 relates to this ticket

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #2674 Merged 3 years ago
  • #2654 Merged 3 years ago