Monday, 2018-04-16

*** caphrim007 has quit IRC04:19
*** caphrim007 has joined #openstack-jjb04:20
*** caphrim007 has quit IRC04:24
openstackgerritAnil Belur proposed openstack-infra/jenkins-job-builder master: Fix view parameters indent for sphinx  https://review.openstack.org/56151406:08
*** hashar has joined #openstack-jjb06:50
*** electrofelix has joined #openstack-jjb08:40
ssbarneazaro__: zxiiro : it seems that only you two can push tags for python-jenkins based on https://review.openstack.org/#/admin/groups/323,members -- can you please add 0.5.0b1 to current tip so we have a prerelease?08:41
*** larainema has joined #openstack-jjb09:02
openstackgerritAnil Belur proposed openstack-infra/jenkins-job-builder master: Add support for fallback Job Filters  https://review.openstack.org/54909109:55
*** caphrim007 has joined #openstack-jjb10:10
*** caphrim007 has quit IRC10:16
*** caphrim007 has joined #openstack-jjb11:07
*** caphrim007 has quit IRC11:11
*** caphrim007 has joined #openstack-jjb11:50
*** caphrim007 has quit IRC11:54
*** caphrim007 has joined #openstack-jjb13:04
*** caphrim007 has quit IRC13:09
*** mnencia_ has joined #openstack-jjb13:27
*** mnencia has quit IRC13:27
*** mnencia_ is now known as mnencia13:27
ssbarneais anyone here that already used jinja2 in jjb?13:43
zxiirossbarnea: I think Odd_Bloke  was the one who submitted that feature.13:47
ssbarneai am trying to build a POC but it seems not to be as easy as using jinja2 in ansible.13:48
Odd_BlokeWe're using it extensively, yeah.13:57
openstackgerritMerged openstack-infra/jenkins-job-builder master: Fix view parameters indent for sphinx  https://review.openstack.org/56151414:00
openstackgerritMerged openstack/python-jenkins master: Adds support for wiping out a job's workspace  https://review.openstack.org/28925814:11
ssbarneaOdd_Bloke: is there a public repo that I can see with them? I am interested about the reusability of the code (jinja include/import)14:29
ssbarneaone thing that i am always facing is that jjb paths are relative to current folder, which is a PITA if you have lots of definitions in multiple folders at multiple depths14:30
ssbarneai would prefer to be relative to the repository root14:30
Odd_Blokessbarnea: There isn't a public repo, I'm afraid.14:34
Odd_BlokeThe Jinja stuff _should_ be using the same import path rules as regular JJB stuff, IIRC.14:34
*** ssbarnea_ has joined #openstack-jjb14:59
electrofelixssbarnea: jjb paths should be able to be relative to the current or the top level folder15:02
electrofelixfor includes15:03
electrofelixbut maybe it's the search order that is the problem?15:03
ssbarneaelectrofelix: not really, how do you define the top-level-folder?15:08
ssbarneai think this is the issue i have15:08
ssbarneabecause I keep my jenkins_jobs.ini file inside ~/.config/...15:08
ssbarneai guess that the trick would to create a symlink inside the repo in order to trick jjb to guess the top-level path.15:09
zxiirossbarnea: you could also use the include_path parameter too https://docs.openstack.org/infra/jenkins-job-builder/execution.html#job-builder-section15:12
zxiiroI've found though that include_path is also recursive in recursive mode.15:12
ssbarneazxiiro: already using this.15:13
zxiiroah ok15:13
ssbarneazxiiro: but my include path is also relative :D15:13
ssbarneamainly I would like to find a way to configure jjb so I can easily rebuild only specific files just by executing them (shebang trick)15:14
ssbarneawhen you have templates and jobs in various paths it seems harder to do this, i always find that in some cases it fails to find the templates.15:15
ssbarneai am not saying is jjb fail, maybe is me15:15
*** hashar is now known as hasharAway15:16
zxiirosounds pretty complicated if you're pulling from lots of places.15:19
zxiiroWe just keep all of our jobs in a single "jjb" directory and allow recursion to pick up anything under it.15:20
zxiiroit's also a way to ensure JJB experts to review jjb related patches that come in.15:20
zxiiroIt's one thing I don't like about the "Jenkinsfile" method that some of our projects want to use. It gives them more control but harder for our ci team to review if things going in that file makes any sense.15:21
ssbarneazxiiro: this was my intent. still it seems that the concept of top-level folder does not work as expected. Just printed the list of paths and it seems that top-level folder = CWD instead of being config colder.15:22
ssbarneaso it does not matter where you put the config file.15:22
zxiirossbarnea: my config goes into ~/.config/jenkins_jobs/jenkins_jobs.ini the jjb repo does not care where that file comes from so no relative paths for it.15:23
ssbarneai remember having a similar problem with ansible in the past, where ansible was using CWD instead of CFG folder to look for files.15:23
zxiirossbarnea: and my include path is "include_path=."15:23
zxiirossbarnea: that makes JJB pick up everything under the jjb directory.15:23
ssbarneazxiiro: yep, but "." in config files usually have different meaning (it means relative to *myself* not to user current directory).15:24
ssbarneaand this is not what jjb thinks15:24
zxiirossbarnea: in jjb "include_path=." means recursively the path under `jenkins-jobs update /path/to/jjb`15:26
zxiirossbarnea: ah maybe that's why. You don't pass the path explicitly on the CLI?15:26
ssbarneazxiiro: in fact I think I am wrong here, "." dot is CWD. but if you would put "xxx" it should be expanded to "config_path/xxx" instead of "cwd/path", agree?15:26
zxiirossbarnea: well in JJB "include_path" is processed at runtime. when it's evaluating  the file or directory you passed it, and it's relative to the path from the CLI. not the config.15:27
*** caphrim007 has joined #openstack-jjb15:27
*** caphrim007 has joined #openstack-jjb15:27
zxiiroand "include_path=." is recursively evaluated for every directory under that path.15:27
zxiiroI don't have an opinion on how it should work, but that's  how it does work right now.15:28
ssbarneazxiiro: but what if I put: include_path=xxx --- how would you expect to be converted to an abs path?15:28
zxiirossbarnea: I would expect it to be relative to that file, or the literal path I put in15:29
zxiirossbarnea: but in reality today it is not as far as I can tell.15:29
ssbarneazxiiro: glad we agree, let me double check if this is happenning or not, even if it doesn't it should be easy to fix.15:29
zxiirossbarnea: yep. I think if you change the code it would be a behaviour change (for better or worse I don't know).  but I know today JJB expects when you say "include_path=." it recursively adds "." as it searches down the tree to add every directory under that path.15:33
zxiiroI thought it was odd when I first realized it myself15:33
zxiiroI tried to add a ".jjb-test" directory to one of my projects and was surprised to see .jjb-test appear N times for every directory that existed in the path.15:34
ssbarneazxiiro: i have no plans to touch behaviour for dot, just the one where user does not mention the dot and where the path is not starting with slash.15:34
ssbarneai would only want to translate include_paths = xxx into  include_path={cfgdir}/xxx15:35
ssbarneain fact if people want, we can even do it like tox does with {toxini} --- we can have {jjbini}.15:36
zxiirohmm that might be a good idea15:37
ssbarneaelectrofelix: zxiiro : my impression is that variable expansion does not work with jinja2 with import/include statements16:40
ssbarneajinja2.exceptions.UndefinedError: 'xxx' is undefined16:41
ssbarneai get this on both import and include, while it works well in the inline script.16:41
ssbarneain fact I found a workaround: adding "with context" after import.16:45
electrofelixssbarnea: at a guess that means the lazy include expansion doesn't work for the j2 tag?16:53
electrofelixor isn't even tried?16:53
ssbarneaelectrofelix: with manual "with context" worked, so is good enough for me.16:54
ssbarneaelectrofelix: but I realised something new: i will never be able to migrate to j2 because I have >100 .inc files used by jjb and people are editing them all the time.16:55
ssbarneathe only chance would be if I could find an intermediary way to migrate them gradually.16:56
electrofelix? is this a case that you have templates that are resolving which inc file to load?17:00
*** electrofelix has quit IRC17:18
*** openstackgerrit has quit IRC19:05
*** hasharAway has quit IRC20:01
*** ssbarnea_ has quit IRC20:44
*** openstackgerrit has joined #openstack-jjb21:43
openstackgerritLuca Pierri proposed openstack-infra/jenkins-job-builder master: fix spelling errors  https://review.openstack.org/56173521:43
openstackgerritLuca Pierri proposed openstack-infra/jenkins-job-builder master: fix spelling errors  https://review.openstack.org/56173522:00
*** smyers has quit IRC22:26
*** smyers has joined #openstack-jjb22:27

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