Add a script to create abi.tar.gz for all the libs.
ClosedPublic

Authored by knauss on Mar 14 2018, 8:18 PM.

Diff Detail

Repository
R857 CI System Tooling
Branch
dev/T3689
Lint
No Linters Available
Unit
No Unit Test Coverage
knauss requested review of this revision.Mar 14 2018, 8:18 PM
knauss created this revision.

This looks okay for the most part, mostly just coding style fixes.
Only big question is the one on splitting out the code into a module in helperslib/ as I made in one comment. Thoughts about that?

helpers/create-abi-bump.py
22

Coding style issue: elsewhere i've used descriptive variable names which indicate what it's contents should be.
Can you change this to match?

25

Coding style: please see gather-jobs.py for how braces for maps/arrays are usually formatted.

30

Could you add some comments, indicating what this function expects to receive and what it provides as a result?
Also, should these functions be split off to the module level? (in case somewhere else needs to do something similar later on)

35

Same as above.

47

Coding style: same issue as for line 25.

49

Can we have some descriptive variables here as well please, along with some comments on what we're trying to achieve?

59

Coding style: brackets.

68

Should this class, and perhaps the above function be split off into a module into helperslib/?

79

Please use os.path.join() to ensure all edgecases around paths being merged are handled.

81

Coding style: as we've moved on to the next unit of work there should be a newline to separate the writing of the CMakeLists.txt file and the invocation of CMake.
Can you also please add some comments describing what we're populating the CMakeLists file with and our objective there?

86

Coding style / readability: the formatted version of the regular expression should be stored in a variable then that should be run through re.match

91

Coding style: descriptive variables please

96

As above: should this function perhaps be separated out for ease of readability and future reuse?

106

Coding style: braces

118

Can we get a comment describing why we're ignoring system prefixes and anything relating to KDE Frameworks?

138

Could we get some comments describing what we're trying to achieve and how we're going to do that please?

143

Coding style: can the variable be made more descriptive please?

155

Coding style: please split the generation of the filename and revision identifier out to their own lines for readability.

knauss updated this revision to Diff 29982.Mar 20 2018, 9:57 AM
knauss marked 14 inline comments as done.
  • add documentation & fixups
knauss added inline comments.Mar 20 2018, 9:58 AM
helpers/create-abi-bump.py
22

well match is mostly used for the return value of an re.match. ret is a very clear name -as it is the return variable.

30

no module level do not make sense, as those inner functions use local variables targets/variables. Additional this function depends on the part at line 56.

68

I don't think so as this is clearly not a clean way to parse cmake - as it is only a dirty hackish way to parse. A better start for a good parser would be https://salsa.debian.org/qt-kde-team/pkg-kde-jenkins/blob/master/hooks/prepare/cmake_update_deps

but only if we plan to parse more than this simple two keywords.

231

Don't know if we should implement a propper way to save for data in the metadata file in package.

lbeltrame added inline comments.
helpers/create-abi-bump.py
55

I know it's mostly "nitpicking" but it would be best to assing meaningful names to args[0] and [1] where it makes sense:

if len(_args) == 2:
   variable, value = _args
   variables[variable] = value

and so on.

79

Since pathlib is used below, I would argue to use Path instead, it's much nicer and better than the os.path functions (at the cost of some overhead).

94

Can we compile this just once at the start of the module? I don't think it's going to be much of a problem.

131

What if this fails for some reason? Or is this guaranteed never to?

knauss updated this revision to Diff 31272.Apr 4 2018, 10:20 AM

some more cleanups

knauss updated this revision to Diff 31279.Apr 4 2018, 10:31 AM

cleanups and things mentioned by luca.

knauss marked 4 inline comments as done.

see also D11915 for the metadata extesion.

helpers/create-abi-bump.py
79

use path.write_text()

131

i added check=True, so it fails with a python error.

knauss marked 2 inline comments as done.Apr 5 2018, 7:41 AM
knauss updated this revision to Diff 31370.Apr 5 2018, 10:48 AM

some small fixes and merge.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 6 2018, 9:29 AM
This revision was automatically updated to reflect the committed changes.