Tuesday, 2018-06-19

openstackgerritAnish Mukherjee proposed openstack-infra/jenkins-job-builder master: Improve support for rvm plugin  https://review.openstack.org/57621606:30
alphadose[m]zxiiro: I have done the changes you requested to https://review.openstack.org/#/c/576216/ :)07:07
*** hashar has joined #openstack-jjb07:14
*** electrofelix has joined #openstack-jjb10:42
openstackgerrithimanshu chhabra proposed openstack-infra/jenkins-job-builder master: Removing 1 of 2 description tags in hudson list view  https://review.openstack.org/57648711:22
ssbarneaelectrofelix: let me know when you are back11:49
openstackgerritMerged openstack-infra/jenkins-job-builder master: Improve unicode support  https://review.openstack.org/57598312:06
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Allow jjb to be called as a module  https://review.openstack.org/57650412:33
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Allow jjb to be called as a module  https://review.openstack.org/57650412:39
ssbarneazxiiro: ^ if you do not mind.12:49
ssbarneaelectrofelix: zxiiro : i have one dilema, how do I detect job type from inside a jjb plugin? Example, I have ownership one which needs to behave different if is used inside a normal job than in case of a folder one.12:55
ssbarneaapparently its signature is def ownership(registry, xml_parent, data):12:55
ssbarneadata contains only his own data, xml_parent is useless, and registry also the same.12:56
ssbarneanone of them gives context informaiton12:56
ssbarneaand by context, i mean: to be able to figureout what was the job-type value.12:56
electrofelixssbarnea: does xml_parent not contain something that can be searched a bit like how we search for an existing properties task at - https://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/tree/jenkins_jobs/modules/properties.py?id=9d12c31f8ef8bfac07babec821bc5157d0134720#n1098 ?13:09
ssbarneaelectrofelix: nope, it contains only its first parent, meaning an empty properties tag.13:10
ssbarneazero use on it13:11
ssbarneathe only place where I found the job-type was inside the registry but inside _ModuleRegistry__parser_data which is also useless as it is a disctionary with all jobs defined, not only current one.13:12
electrofelixssbarnea: do you have a copy of an example job definition?13:15
ssbarneasure, I have a very simple example to test with, let me paste it13:16
ssbarneasee https://gist.github.com/ssbarnea/8b2b9de7394b2b99e803833282e9970013:17
ssbarneathese two would have to generate different xml13:17
ssbarneai was able to find some useful data two levels up on the stack, so i could attempt to pass them down.13:18
ssbarneabut even so we have another issue: testing!13:18
ssbarneaall the tests are using partial snippets which do not include the job type! making impossible to test them13:18
electrofelixssbarnea: we could add a hidden attribute from the gen_xml method in the properties module that added a '_root' attribute containing the parent xml passed to gen_xml which in turn is the job definition itself. Not sure what other methods are available to use13:34
electrofelixto keep it tidy, could always wrap the Element node with a custom JJB class that by default passes through calls to the underlying class but contains the extra attributes for data we want to include? In this case including the job type13:35
ssbarneai am still trying to find a way to get that info passed but...13:54
*** rberg has joined #openstack-jjb14:00
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Enable folder support for ownership property  https://review.openstack.org/57366914:08
ssbarneaelectrofelix: please have a look at ^^ and comment on it, i find it really ugly so if you have better ideas feel free to tell, or even to update the CR.14:09
zxiirossbarnea: looks fine to me but it fails Zuul15:17
ssbarneai am not surprised, didn't test locally. also don't know how to test for different job types, I created the test files but I am sure that test suite is unable to use them15:18
ssbarneabecause our fixtures are not full job definitions, that the issue, more of a design issue15:18
zxiiroI think it just failed on pep8 actually15:28
zxiirodid we merge something that broke pep8? I saw a few unrelated patches fail now15:41
zxiiro./jenkins_jobs/cli/entry.py:149:5: F821 undefined name 'reload'15:41
ssbarneazxiiro: thanks for the feedback, i am implementing changes now, probably i will also split few of them.16:00
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Allow jjb to be called as a module  https://review.openstack.org/57650416:05
ssbarneazxiiro: I think i know what could have happened, the switch to default python316:15
zxiirossbarnea: I think that patch failed to merge16:19
zxiirothis one right? https://review.openstack.org/#/c/574334/16:19
zxiiroit didn't mege16:19
ssbarneaok, these are easy to fix.16:20
ssbarnea... as long there is someone here to review the fix.16:21
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: upgrade hacking module  https://review.openstack.org/57657616:24
ssbarneathere is something important to note: py2 flake is not able to find all issues noted by py3 version. not sure if both are needed but clearly py3 one seems better.16:26
zxiirossbarnea: +2'd it, thanks for looking into it16:27
openstackgerritMerged openstack-infra/jenkins-job-builder master: Improve support for rvm plugin  https://review.openstack.org/57621616:30
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: upgrade hacking module  https://review.openstack.org/57657616:33
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: upgrade hacking module and defaults to py3 linting  https://review.openstack.org/57657616:42
ssbarneazxiiro: now i need your vote on https://review.openstack.org/#/c/576576/ -- passed16:57
zxiirossbarnea: I think you shouldn't have abandon'd qingszhao's change16:59
zxiirossbarnea: can you change yours to exclude qingszhao's change and we'll merge yours, then the other one after.16:59
ssbarneatoo many changes and they are interlinked17:00
zxiirossbarnea: It might not mean a lot to you but I believe qingszhao's a student and getting commits into open source projects and getting credit for it is very good for students.17:00
zxiiroI think ti's bad faith for us to be dismissing their work17:00
ssbarnea..ahh, well, in this case ok.17:00
ssbarneain fact I was considering putting my changes on top of his, ....17:01
ssbarneajust to minimize the CI load, and get over it sooner but I will do it your way.17:01
zxiirossbarnea: if it's not too much a pain that would be good imo17:01
zxiirossbarnea: FYI we've been getting a lot of student contributions lately because LF is looking for an intern and one of the projects is JJB.17:02
ssbarneai imagined that based on the new changes17:03
zxiiroyeah, a lot of student level work but contributions are contributions :)17:03
ssbarneai hope one of them will attempt to create some functional testing, using a docker container with jenkins would be really nice work item.17:04
zxiirossbarnea: you should discuss with abelur  and whoever he eventually picks as his intern (he's the mentor this time). Maybe that could be a project whoever gets chosen can work on.17:04
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: upgrade hacking module  https://review.openstack.org/57657617:04
ssbarneazxiiro: ^^ without tox.ini changes, reviving his CR now...17:05
zxiirossbarnea: cool thanks so much. I'll merge it as soon as it passes verify17:05
openstackgerritMerged openstack-infra/jenkins-job-builder master: upgrade hacking module  https://review.openstack.org/57657617:19
*** rberg has quit IRC17:20
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: fix tox python3 overrides  https://review.openstack.org/57433417:26
*** beiske has quit IRC17:32
openstackgerritMerged openstack-infra/jenkins-job-builder master: fix tox python3 overrides  https://review.openstack.org/57433417:44
*** rberg has joined #openstack-jjb17:52
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: adoping pre-commit hooks  https://review.openstack.org/57659817:54
ssbarneazxiiro: check https://review.openstack.org/#/c/575817/17:55
zxiirossbarnea: I already +2'd that one17:56
zxiirossbarnea: I still think electrofelix's vote there would be more valuable than mine though.17:56
*** rberg has quit IRC17:56
ssbarneaoopst, this was for electrofelix ^^17:56
ssbarneai recently discovered the pre-commit tool and I am instigatings its potential benefits for us17:57
ssbarneaapparently it does fix an old git issue related to how to "deploy" and manage pre-commit hooks.17:57
ssbarneaaparently it has support for almost all linters and it is quite smart, as it does check only changes, so is quick.17:58
ssbarneait is too soon to say if is great or not really.17:58
zxiirointeresting, thanks for linking it. If it's good I might deploy to some of my projects17:58
ssbarneai was thinking about the same thing, i have few python projects I nurture17:59
ssbarneaits potential is huge as it lowers the CI load, considerably.18:00
electrofelixinteresting about that tox python3 override, I specifically blocked that from git-upstream because if someone needs to run tox with a specific version of python they can already do that by using that version of python to run tox and it will automatically use that as the basepython18:07
*** rberg has joined #openstack-jjb18:20
zxiiroelectrofelix: still works the reverse direction right?18:24
zxiiroI think as long as it still works with py27 in the reverse direction I don't see a reason not to do it. considering py27 is EOL anyway.18:24
electrofelixzxiiro: I don't think it does work in the reverse though, you can't force tox back to python2 if basepython is python318:25
zxiirolet me try...18:25
zxiiroI usually test with tox -e py27 because my default python on arch linux is py318:26
electrofelixtox will default to using the version of python it was launched with unless explicitly requested with such ones as py27 or py35, but if you've set python3 as the basepython for any env you can't run those envs with python2 without editing the tox file18:26
Odd_Blokessbarnea: sys.setdefaultencoding doesn't exist in Python 3.6.18:27
Odd_BlokeSo I'm seeing issues in my test-against-trunk jenkins-job-linter tests: https://travis-ci.org/OddBloke/jenkins-job-linter/jobs/39423035818:27
*** electrofelix has quit IRC18:27
zxiiro$ ./.tox/py27/bin/python --version18:28
zxiiroPython 2.7.1518:28
zxiirooh he left18:28
zxiirooh wait I see what he mains18:28
Odd_Blokessbarnea: Or 3.4 or 3.5 for that matter.18:30
zxiirossbarnea: electrofelix has a point, we no longer support python 2 to run the environments18:30
*** caphrim007 has joined #openstack-jjb18:30
zxiirosomeone who only has python 2 installed will now fail to run for example "tox -e pep8"18:30
Odd_BlokeSomeone who only has Python 2 installed has failed in a more fundamental way. ;)18:32
Odd_BlokeDo we not actually hit our entrypoint in tests?18:32
Odd_BlokeI can't see how https://review.openstack.org/#/c/575983/ could have passed if we do.18:33
openstackgerritThanh Ha proposed openstack-infra/jenkins-job-builder master: Revert "fix tox python3 overrides"  https://review.openstack.org/57660318:39
*** rberg has quit IRC18:42
*** hashar has quit IRC20:36
ssbarneaOdd_Bloke: zxiiro : we  what should we do? as far as I am concerned I don't mind including pep8 in each py* target and dropping one gate.20:59
ssbarneai do want to avoid having two pep8 gates, i prefer having none (including in unit)20:59
ssbarneai still use py27 as default python and will do so for foreseable future.21:00
zxiiroI think it's fine to have the one run in Zuul, it's not like it takes very long to run anyway21:00
zxiirossbarnea: right, so if that's the case I don't think we should be forcing everyone to have basepython = python3 just yet21:01
ssbarneathe issue is that it is not enough, i would include include running flake8 before runningunit.21:01
ssbarneazxiiro: you don't force user, only developers, which is not an issue.21:01
Odd_BlokeI'm not sure I saw the reason for the change happening in the first place, so I'm not really in a position to have an opinion. :p21:01
zxiironow that I understand it a bit more. I think it's better no explicitly call out basepython and let the developer choose themselves what they want then forcing it with the property21:02
ssbarneai think we need to run both, only by running both we will know it worked. doing only one of them proved not to be enough.21:02
zxiirodevs are usually smarter than the average user, we don't need to hold their hand.21:03
zxiiroif the issue is flake8 / pep8 then maybe we can run basepython only for the pep8 check and assume python 3 style for that21:03
zxiirobut for the rest of the envs we can allow python 221:03
ssbarneai doubt flake8 can detect those py3 specific problems in py2, do you know a switch?21:12
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Allow jjb to be called as a module  https://review.openstack.org/57650421:13
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Allow jjb to be called as a module  https://review.openstack.org/57650421:30
zxiirossbarnea: i mean for only the pep8 / flake8 environment we set basepython = python321:34
zxiirossbarnea: all the other envs we shouldn't explicitly set that setting imo21:34
zxiirossbarnea: then I think that will satisfy your requirement that we run flake8 python3 version.21:35
ssbarneanot againt the idea21:35
ssbarneanow i am trying to improve the testing to be sure we would catch errors like the recent one with zuul testing21:35
zxiirossbarnea: let me update the revert patch to make sure pep8 runs with py3 then21:36
ssbarneathat's my no1 concern, that we avoid future failures to catch such bugs. we need to be sure that the library works well with both 2/321:36
zxiiroright. I think it's a fair assumption to say we want code style to be py3 but we want to make sure we test running the code with all versions we support21:37
openstackgerritThanh Ha proposed openstack-infra/jenkins-job-builder master: Revert "fix tox python3 overrides"  https://review.openstack.org/57660321:38
*** caphrim007_ has joined #openstack-jjb21:58
*** caphrim007 has quit IRC22:01
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Allow jjb to be called as a module  https://review.openstack.org/57650422:25
openstackgerritKien Ha proposed openstack-infra/jenkins-job-builder master: Add publishers related to GitLab Plugin  https://review.openstack.org/51861822:41
*** caphrim007_ has quit IRC22:46
*** caphrim007 has joined #openstack-jjb22:46
*** caphrim007 has quit IRC23:03

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!