#1165 cli: Don't spam when downloading build
Merged 10 months ago by praiskup. Opened 10 months ago by netvor.
copr/ netvor/copr nowgetspam  into  master

cli: Don't spam when downloading build
Alois Mahdal • 10 months ago  
file modified
+1 -1
@@ -481,7 +481,7 @@ 

                  sys.stderr.write("No data for build id: {} and chroot: {}.\n".format(args.build_id, chroot.name))

                  continue

  

-             cmd = ['wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"', '-e', 'robots=off']

+             cmd = ['wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"', '-e', 'robots=off', '--no-verbose']

              cmd.extend(['-P', os.path.join(args.dest, chroot.name)])

              cmd.extend(['--cut-dirs', str(base_len + 4)])

              cmd.append(chroot.result_url)

file modified
+6 -3
@@ -289,12 +289,14 @@ 

      expected_sp_call_args = [

          mock.call([

              'wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"',

-             '-e', 'robots=off', '-P', './epel-6-x86_64', '--cut-dirs', '6',

+             '-e', 'robots=off', '--no-verbose', '-P', './epel-6-x86_64',

+             '--cut-dirs', '6',

              'http://example.com/results/epel-6-x86_64/python-copr-1.50-1.fc20'

          ]),

          mock.call([

              'wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"',

-             '-e', 'robots=off', '-P', './epel-6-i386', '--cut-dirs', '6',

+             '-e', 'robots=off', '--no-verbose', '-P', './epel-6-i386',

+             '--cut-dirs', '6',

              'http://example.com/results/epel-6-i386/python-copr-1.50-1.fc20'

          ])

      ]
@@ -328,7 +330,8 @@ 

      expected_sp_call_args = [

          mock.call([

              'wget', '-r', '-nH', '--no-parent', '--reject', '"index.html*"',

-             '-e', 'robots=off', '-P', u'./epel-6-x86_64', '--cut-dirs', '6',

+             '-e', 'robots=off', '--no-verbose', '-P', u'./epel-6-x86_64',

+             '--cut-dirs', '6',

              'http://example.com/results/epel-6-x86_64/python-copr-1.50-1.fc20'

          ]),

      ]

copr-cli download build uses wget without any verbosity control, which
generates roughly 10 lines per file. --no-verbose should suppress most
of the verbosity while still reporting basics and errors.

For example, my simple build 1128860 of single noarch rpm on 7 chroots,
it will generate 1834 lines. (In my simple build pipeline, this means
that the download just takes over the whole build log.) I've tested the
option (injecting wget wrapper in path) on Fedora 30 and in my case the
number of lines went down from 1834 to 182.

rebased onto 092c681dae1c5a89da07edeb025ee6bd66e7d1a0

10 months ago

I've fixed the build failure caused by not updating tests, but there are some remaining on rhel-7 and rhel-6 which don't seem relevant. Please advise how to fix them if I'm wrong.

rebased onto 4b53b6b

10 months ago

+1, thank you.

Please advise how to fix them if I'm wrong.

The other PR should fix that; I rebased tihs PR, we'll see.

Commit 60a0c1c fixes this pull-request

Pull-Request has been merged by praiskup

10 months ago