#1149 hub: new addArchiveType RPC
Merged 4 years ago by tkopecek. Opened 5 years ago by ktdreyer.
ktdreyer/koji add-archive-type  into  master

No commits found

Add a new hub method for inserting new archivetype records.

This closely matches addBType.

The purpose of this change is to make it easier to permit content generators to import files with extensions that we have not defined in the upstream packaged koji SQL file.

This might also require duplicate checking for 'extensions'

rebased onto 0daa145a2d0b8bd8ff50a3111be705f551eb7bb3

5 years ago

Thanks @julian8628 . I've added checks for duplicate extensions.

@ktdreyer One test failure:

======================================================================
ERROR: test_add_archive_type (tests.test_hub.test_add_archivetype.TestAddArchiveType)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/srv/jenkins/workspace/koji/label/F26/kojienv/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/srv/jenkins/workspace/koji/label/F26/tests/test_hub/test_add_archivetype.py", line 29, in test_add_archive_type
    kojihub.add_archive_type('deb', 'Debian package', 'deb')
  File "/srv/jenkins/workspace/koji/label/F26/hub/kojihub.py", line 6241, in add_archive_type
    results = _multiRow(select, {}, ('id',))
  File "/srv/jenkins/workspace/koji/label/F26/hub/kojihub.py", line 4568, in _multiRow
    return [dict(zip(fields, row)) for row in _fetchMulti(query, values)]
  File "/srv/jenkins/workspace/koji/label/F26/hub/kojihub.py", line 4539, in _fetchMulti
    c = context.cnx.cursor()
  File "/srv/jenkins/workspace/koji/label/F26/koji/context.py", line 46, in __getattr__
    return object.__getattribute__(data, key)
AttributeError: '_data' object has no attribute 'cnx'

The tests pass for me on Fedora 29... Koji developers, any clue what I've done wrong?

I don't see how this test could pass anywhere. You haven't mocked _multiRow().

rebased onto 69de58e1042ec1ce3180015291d3e9cb91cf1ac5

5 years ago

Sorry Mike, and thank you for pointing to my mistake there.

I've re-pushed a new version that mocks _multiRow().

rebased onto 2e65624a26eb40d3a0c7e4fdcbf6b3bb2e2018d5

5 years ago

rebased onto 05b6b00d8c1eb14a4d12af55d106ce81ba15a86c

4 years ago

rebased onto 85afbbe514c518802b349dcb78728eafcda509b4

4 years ago

rebased onto 6256d7f

4 years ago

Commit de15f88 fixes this pull-request

Pull-Request has been merged by tkopecek

4 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

4 years ago