)]}'
{".zuul.yaml":[{"author":{"_account_id":13294,"name":"Javier Peña","email":"jpena@redhat.com","username":"jpena"},"change_message_id":"a9dc2cbfd8ae09767eca5b86fce426c3210d2ce1","unresolved":false,"context_lines":[{"line_number":1,"context_line":"- job:"},{"line_number":2,"context_line":"    name: rpm-packaging-check-reqs"},{"line_number":3,"context_line":"    parent: openstack-tox"},{"line_number":4,"context_line":"    vars:"},{"line_number":5,"context_line":"      tox_envlist: check-reqs"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"- project:"},{"line_number":8,"context_line":"    check:"}],"source_content_type":"text/x-yaml","patch_set":15,"id":"5f681702_2f4a8226","line":5,"range":{"start_line":1,"start_character":0,"end_line":5,"end_character":29},"updated":"2020-10-19 13:27:00.000000000","message":"I would initially make the job non-voting. We might have false positives, and I\u0027d prefer to adjust the tool first instead of failing the CI job.","commit_id":"f4975732e12b2df76e21977015f7430aa6358d51"}],"tools/check-requirements.sh":[{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f00774db793762097ee93bfa9901048e78ddcb3c","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Check requirements deltas"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Arguments:"},{"line_number":11,"context_line":"    --pkg               the package and is version to check"},{"line_number":12,"context_line":"    -d, --debug         Turn on the debug mode"},{"line_number":13,"context_line":"    -h, --help          show this help message and exit"},{"line_number":14,"context_line":"examples:"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_a2cd7f5f","line":11,"range":{"start_line":11,"start_character":24,"end_line":11,"end_character":59},"updated":"2020-10-09 08:45:25.000000000","message":"I do not understand why we should precise a version and indeed a \"pkgname\" (which to be strict is not the pypi name)\n\nThe pypi name and version can directly be retrieve from specfile like that as example:\npypi_name\u003d\"$(sed -n \"/set[[:space:]]*pypi_name/s/.*\u0027\\([^\u0027]*\\)\u0027.*/\\1/p\" ${spec})\"\n\nupstream_version\u003d\"$(sed -n \"/set[[:space:]]*upstream_version/s/.*\u0027\\([^\u0027]*\\)\u0027.*/\\1/p\" ${spec})\"\n\nMy feeling is that we more want to validate one (if specified) or all requirements from a spec file to ensure it is coherent than ensuring the specfile will be good for a specific version.\n\n\nMaybe you should use a --spec (or --pkg) optional arg which will focus on a precise specfile, otherwhise you may can run it against all specs.\n\nyou can use it as example to perform the loop: \nwhile read spec; do all the stuff; done \u003c \u003c(find . -iname \u0027*.spec.j2\u0027)","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f00774db793762097ee93bfa9901048e78ddcb3c","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Check requirements deltas"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Arguments:"},{"line_number":11,"context_line":"    --pkg               the package and is version to check"},{"line_number":12,"context_line":"    -d, --debug         Turn on the debug mode"},{"line_number":13,"context_line":"    -h, --help          show this help message and exit"},{"line_number":14,"context_line":"examples:"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_0f33b414","line":11,"range":{"start_line":11,"start_character":40,"end_line":11,"end_character":42},"updated":"2020-10-09 08:45:25.000000000","message":"its version","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"25742b0acebdaec5a9beac02acc22b0ad78271d3","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Check requirements deltas"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Arguments:"},{"line_number":11,"context_line":"    --pkg               the package and is version to check"},{"line_number":12,"context_line":"    -d, --debug         Turn on the debug mode"},{"line_number":13,"context_line":"    -h, --help          show this help message and exit"},{"line_number":14,"context_line":"examples:"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_fbe9dee3","line":11,"range":{"start_line":11,"start_character":24,"end_line":11,"end_character":59},"in_reply_to":"9f560f44_6566d12a","updated":"2020-10-09 12:11:26.000000000","message":"Great. \n\nI think this could be used in several conditions :\n\n1. during dev on a spec: so a --dev option or a default comportement checking local not-yet committed changes to establish the list of .spec to check could be a good option; if no local modif, check the files modified by the latest commit. \n\n2. For cleaning purpose: In this case a --all option should be good to check all the .spec of the repo and generate a global report (in a first time or performing the actions in a second time)\n\n3. Regarding the maturity it can be maybe used as pre-commit script: in this case local changes have to be checked. \n\n4. Maybe one day it could be used as a CI check, in this case, specs modified by latest commit should be the target.\n\nI think a reasonable way of work could be the following : \n- treat all spec files if --all/-a is passed\n- checking local change to establish the list of specs\n- having a look on latest commit\n- if latest commit does not touch any .spec.j2 file, treat nothing. \n\nI do not really understand what you wanna do with the --sha option.","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"d9ecd1792c880521432b1770ef75eda64de4550b","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Check requirements deltas"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Arguments:"},{"line_number":11,"context_line":"    --pkg               the package and is version to check"},{"line_number":12,"context_line":"    -d, --debug         Turn on the debug mode"},{"line_number":13,"context_line":"    -h, --help          show this help message and exit"},{"line_number":14,"context_line":"examples:"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_6566d12a","line":11,"range":{"start_line":11,"start_character":24,"end_line":11,"end_character":59},"in_reply_to":"9f560f44_a2cd7f5f","updated":"2020-10-09 10:14:49.000000000","message":"I firstly designed this tools to check things manually and locally, but in my previous comment I said that I\u0027ll turn these changes as WIP.\n\nI plan to rewrite the logic to retrieve the latest commit changes and compare only files on a git history perspective (by sha), so yes in this case we can retrieve the version directly from the spec file.\n\nNormally the --pkg params will be dropped and I will provid the --sha params which will be the HEAD if not given by user (CI context).","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"7c850ef386056ce9426a3a1ef7d2ab3f46f142b4","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Check requirements deltas"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Arguments:"},{"line_number":11,"context_line":"    --pkg               the package and is version to check"},{"line_number":12,"context_line":"    -d, --debug         Turn on the debug mode"},{"line_number":13,"context_line":"    -h, --help          show this help message and exit"},{"line_number":14,"context_line":"examples:"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_c969afc0","line":11,"range":{"start_line":11,"start_character":24,"end_line":11,"end_character":59},"in_reply_to":"9f560f44_fbe9dee3","updated":"2020-10-09 20:33:48.000000000","message":"\u003e Great.\n \u003e \n \u003e I think this could be used in several conditions :\n \u003e \n \u003e 1. during dev on a spec: so a --dev option or a default\n \u003e comportement checking local not-yet committed changes to establish\n \u003e the list of .spec to check could be a good option; if no local\n \u003e modif, check the files modified by the latest commit.\n \u003e \n\nThis is that I was planed, but we don\u0027t need the --dev option, the script will simply check if no staged exist and then scan over unstaged file.\n\n \u003e 2. For cleaning purpose: In this case a --all option should be good\n \u003e to check all the .spec of the repo and generate a global report (in\n \u003e a first time or performing the actions in a second time)\n \u003e \n\nYep it could be useful\n\n \u003e 3. Regarding the maturity it can be maybe used as pre-commit\n \u003e script: in this case local changes have to be checked.\n \u003e \n\nYeah I also planed to trigger this with pre-commit but we need a dedicated plugin first so it will be in a near future.\n\n \u003e 4. Maybe one day it could be used as a CI check, in this case,\n \u003e specs modified by latest commit should be the target.\n \u003e \n\nYes this is what I was thinking, I already started to rewrite a new patch set (mostly finished I will submit it soon) where I add a new zuul job who trigger a check against the latest commit.\n\n \u003e I think a reasonable way of work could be the following :\n \u003e - treat all spec files if --all/-a is passed\n \u003e - checking local change to establish the list of specs\n \u003e - having a look on latest commit\n \u003e - if latest commit does not touch any .spec.j2 file, treat nothing.\n\nIn my latest PS I skip all files who are not jinja template and all dirs who not contains template files.\n\n \u003e \n \u003e I do not really understand what you wanna do with the --sha option.\n\nJust passing a specific sha to analyze, mostly for debug/testing purpose.","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f00774db793762097ee93bfa9901048e78ddcb3c","unresolved":false,"context_lines":[{"line_number":48,"context_line":"rc\u003d0"},{"line_number":49,"context_line":"pip install ${PKG} \u0026\u003e/dev/null"},{"line_number":50,"context_line":"pkg_name\u003d${PKG/\u003d\u003d*/}"},{"line_number":51,"context_line":"reqs\u003d$(pip show ${pkg_name} | grep \"Requires:\")"},{"line_number":52,"context_line":"spec\u003dopenstack/${pkg_name}/${pkg_name}.spec.j2"},{"line_number":53,"context_line":"echo ${reqs/Requires:/Looking for:}"},{"line_number":54,"context_line":"echo \"Compare with content of ${spec}\""}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_82631bdd","line":51,"range":{"start_line":51,"start_character":5,"end_line":51,"end_character":47},"updated":"2020-10-09 08:45:25.000000000","message":"With this you keep the \"Requires:\" word in your reqs var.\nMaybe doing this is more relevant:\nreqs\u003d$(pip show ${pkg_name} | sed  -n \u0027s/^Requires://p\u0027)","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"d9ecd1792c880521432b1770ef75eda64de4550b","unresolved":false,"context_lines":[{"line_number":48,"context_line":"rc\u003d0"},{"line_number":49,"context_line":"pip install ${PKG} \u0026\u003e/dev/null"},{"line_number":50,"context_line":"pkg_name\u003d${PKG/\u003d\u003d*/}"},{"line_number":51,"context_line":"reqs\u003d$(pip show ${pkg_name} | grep \"Requires:\")"},{"line_number":52,"context_line":"spec\u003dopenstack/${pkg_name}/${pkg_name}.spec.j2"},{"line_number":53,"context_line":"echo ${reqs/Requires:/Looking for:}"},{"line_number":54,"context_line":"echo \"Compare with content of ${spec}\""}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_2549798d","line":51,"range":{"start_line":51,"start_character":5,"end_line":51,"end_character":47},"in_reply_to":"9f560f44_82631bdd","updated":"2020-10-09 10:14:49.000000000","message":"Indeed, it could be an option","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f00774db793762097ee93bfa9901048e78ddcb3c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"pkg_name\u003d${PKG/\u003d\u003d*/}"},{"line_number":51,"context_line":"reqs\u003d$(pip show ${pkg_name} | grep \"Requires:\")"},{"line_number":52,"context_line":"spec\u003dopenstack/${pkg_name}/${pkg_name}.spec.j2"},{"line_number":53,"context_line":"echo ${reqs/Requires:/Looking for:}"},{"line_number":54,"context_line":"echo \"Compare with content of ${spec}\""},{"line_number":55,"context_line":"for el in ${reqs}"},{"line_number":56,"context_line":"do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_629ec7b7","line":53,"updated":"2020-10-09 08:45:25.000000000","message":"If you remove Requires: from $reqs\nyou just have to do : \necho \"Looking for: $reqs\"\nwhich is more easy to read.","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"d9ecd1792c880521432b1770ef75eda64de4550b","unresolved":false,"context_lines":[{"line_number":50,"context_line":"pkg_name\u003d${PKG/\u003d\u003d*/}"},{"line_number":51,"context_line":"reqs\u003d$(pip show ${pkg_name} | grep \"Requires:\")"},{"line_number":52,"context_line":"spec\u003dopenstack/${pkg_name}/${pkg_name}.spec.j2"},{"line_number":53,"context_line":"echo ${reqs/Requires:/Looking for:}"},{"line_number":54,"context_line":"echo \"Compare with content of ${spec}\""},{"line_number":55,"context_line":"for el in ${reqs}"},{"line_number":56,"context_line":"do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_054ef594","line":53,"in_reply_to":"9f560f44_629ec7b7","updated":"2020-10-09 10:14:49.000000000","message":"Agreed","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f00774db793762097ee93bfa9901048e78ddcb3c","unresolved":false,"context_lines":[{"line_number":52,"context_line":"spec\u003dopenstack/${pkg_name}/${pkg_name}.spec.j2"},{"line_number":53,"context_line":"echo ${reqs/Requires:/Looking for:}"},{"line_number":54,"context_line":"echo \"Compare with content of ${spec}\""},{"line_number":55,"context_line":"for el in ${reqs}"},{"line_number":56,"context_line":"do"},{"line_number":57,"context_line":"    el\u003d${el/,/}"},{"line_number":58,"context_line":"    grep -ri ${spec} -e ${el} \u0026\u003e/dev/null"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_0286eb65","line":55,"updated":"2020-10-09 08:45:25.000000000","message":"Since you did not removed \"Requires:\" from reqs, you are searching it into the spec file.\nMy feeling is that this is not really a good idea.","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"d9ecd1792c880521432b1770ef75eda64de4550b","unresolved":false,"context_lines":[{"line_number":52,"context_line":"spec\u003dopenstack/${pkg_name}/${pkg_name}.spec.j2"},{"line_number":53,"context_line":"echo ${reqs/Requires:/Looking for:}"},{"line_number":54,"context_line":"echo \"Compare with content of ${spec}\""},{"line_number":55,"context_line":"for el in ${reqs}"},{"line_number":56,"context_line":"do"},{"line_number":57,"context_line":"    el\u003d${el/,/}"},{"line_number":58,"context_line":"    grep -ri ${spec} -e ${el} \u0026\u003e/dev/null"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_8559655c","line":55,"in_reply_to":"9f560f44_0286eb65","updated":"2020-10-09 10:14:49.000000000","message":"Ah yes good point","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f00774db793762097ee93bfa9901048e78ddcb3c","unresolved":false,"context_lines":[{"line_number":55,"context_line":"for el in ${reqs}"},{"line_number":56,"context_line":"do"},{"line_number":57,"context_line":"    el\u003d${el/,/}"},{"line_number":58,"context_line":"    grep -ri ${spec} -e ${el} \u0026\u003e/dev/null"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    if [ $? -eq 0 ]; then"},{"line_number":61,"context_line":"        continue"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_623a4797","line":58,"updated":"2020-10-09 08:45:25.000000000","message":"doing this grep will return true if the spec match el even if it is part of a word. you do not ensure matching the right requirements (eg: grep tripleo will return true even if there is only python-tripleoclient required)\nYou should perform a :\n\ngrep -i \"\\\u003c${el}\\\u003e\" ${spec}\n\nThis will force checking the word $el.\nSince in your example you are using oslo.privsep, it you want to be precise you should replace the \u0027.\u0027 which is matching all char by a \\. to force checking a dot.\nso maybe a : \n\ngrep -i \"\\\u003c${el/./\\\\\\.}\\\u003e\" ${spec}}","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"472255089f636d4f75c546ad0e563c18c99cae24","unresolved":false,"context_lines":[{"line_number":55,"context_line":"for el in ${reqs}"},{"line_number":56,"context_line":"do"},{"line_number":57,"context_line":"    el\u003d${el/,/}"},{"line_number":58,"context_line":"    grep -ri ${spec} -e ${el} \u0026\u003e/dev/null"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    if [ $? -eq 0 ]; then"},{"line_number":61,"context_line":"        continue"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_a570e974","line":58,"in_reply_to":"9f560f44_623a4797","updated":"2020-10-09 09:35:51.000000000","message":"Indeed you should even perform this :\n\ngrep -i \"^[[:space:]]*Requirements:[[:space:]]*\\\u003c${el/./\\\\\\.}\\\u003e\" $spec\n\nto ensure it is a Requirements spec and not a BuildRequirement or a comment.\n\nYou may can replace some [[:space:]] from the regex if we have some linting on it to simplify the readability of it in the future. I did not really check what is really checked on linting on this part.\n\nThis can be peformed with BuilRequirements as well of course.","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"d9ecd1792c880521432b1770ef75eda64de4550b","unresolved":false,"context_lines":[{"line_number":55,"context_line":"for el in ${reqs}"},{"line_number":56,"context_line":"do"},{"line_number":57,"context_line":"    el\u003d${el/,/}"},{"line_number":58,"context_line":"    grep -ri ${spec} -e ${el} \u0026\u003e/dev/null"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    if [ $? -eq 0 ]; then"},{"line_number":61,"context_line":"        continue"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_e552e135","line":58,"in_reply_to":"9f560f44_a570e974","updated":"2020-10-09 10:14:49.000000000","message":"Awesome thanks I\u0027ll update this search","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f00774db793762097ee93bfa9901048e78ddcb3c","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        continue"},{"line_number":62,"context_line":"    fi"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    echo \"${el} not found. Requirement should be added.\""},{"line_number":65,"context_line":"    if [ ${rc} -eq 0 ]; then"},{"line_number":66,"context_line":"        rc\u003d1"},{"line_number":67,"context_line":"    fi"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_4258e3f7","line":64,"updated":"2020-10-09 08:45:25.000000000","message":"Maybe storing the list of requirements not present in the spec file during the loop will allow to print all missing requirement at the end of the loop to avoid adding it and running the script for each missing req.","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"d9ecd1792c880521432b1770ef75eda64de4550b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        continue"},{"line_number":62,"context_line":"    fi"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    echo \"${el} not found. Requirement should be added.\""},{"line_number":65,"context_line":"    if [ ${rc} -eq 0 ]; then"},{"line_number":66,"context_line":"        rc\u003d1"},{"line_number":67,"context_line":"    fi"}],"source_content_type":"text/x-sh","patch_set":3,"id":"9f560f44_252e99aa","line":64,"in_reply_to":"9f560f44_4258e3f7","updated":"2020-10-09 10:14:49.000000000","message":"Why not","commit_id":"35e3269093005738d5ea14307612c02c2774e78d"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"80ccc81d8c327da11ce43e14acf0b5f658567fdb","unresolved":false,"context_lines":[{"line_number":60,"context_line":"unstagged\u003d$(git status -s)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"if [ ! -z \"${unstagged}\" ]; then"},{"line_number":63,"context_line":"    FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":64,"context_line":"else"},{"line_number":65,"context_line":"    FILES\u003d$(git show --pretty\u003d\"\" --name-only ${SHA})"},{"line_number":66,"context_line":"fi"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_78cadd4e","line":63,"updated":"2020-10-12 07:58:25.000000000","message":"This does not work I think, since you are storing git status -s output in a var you lost return carriage, then getting the second column with awk will return you only the first modified file.\n\nyou should use directly :\nfile\u003d\"$(git status -s | awk \u0027{print $2}\u0027)\"","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f36b6cdc782b26c0a30815b090e358313899db83","unresolved":false,"context_lines":[{"line_number":60,"context_line":"unstagged\u003d$(git status -s)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"if [ ! -z \"${unstagged}\" ]; then"},{"line_number":63,"context_line":"    FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":64,"context_line":"else"},{"line_number":65,"context_line":"    FILES\u003d$(git show --pretty\u003d\"\" --name-only ${SHA})"},{"line_number":66,"context_line":"fi"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_acf712d4","line":63,"in_reply_to":"9f560f44_03625616","updated":"2020-10-12 14:57:00.000000000","message":"Yes, I understood your point, (by the way, I am not sure we should test a deleted file ;) )\n\nThis does not work on my environment: \n[sboyron@rhlaptop openstack]$ git status \nOn branch review/hervé_beraud/756383\nYour branch and \u0027gerrit/master\u0027 have diverged,\nand have 1 and 892 different commits each, respectively.\n  (use \"git pull\" to merge the remote branch into yours)\n\nChanges not staged for commit:\n  (use \"git add \u003cfile\u003e...\" to update what will be committed)\n  (use \"git restore \u003cfile\u003e...\" to discard changes in working directory)\n\tmodified:   aodhclient/aodhclient.spec.j2\n\tmodified:   automaton/automaton.spec.j2\n\tmodified:   barbican/barbican.spec.j2\n\nUntracked files:\n  (use \"git add \u003cfile\u003e...\" to include in what will be committed)\n\ttest\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n[sboyron@rhlaptop openstack]$ unstagged\u003d$(git status -s)\n[sboyron@rhlaptop openstack]$ echo $unstagged\nM aodhclient/aodhclient.spec.j2 M automaton/automaton.spec.j2 M barbican/barbican.spec.j2 ?? test\n[sboyron@rhlaptop openstack]$ FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)\n[sboyron@rhlaptop openstack]$ echo $FILES\naodhclient/aodhclient.spec.j2\n\n\n\u003d\u003e your solution is putting everything on a same line and getting the $2 column, so you\u0027re just getting the first edited file.\n\n[sboyron@rhlaptop openstack]$ file\u003d\"$(git status -s | awk \u0027{print $2}\u0027)\"\n[sboyron@rhlaptop openstack]$ echo $file\naodhclient/aodhclient.spec.j2 automaton/automaton.spec.j2 barbican/barbican.spec.j2 test","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"c95ff5cf7da7b8ed4168a6db16264c8815ddf851","unresolved":false,"context_lines":[{"line_number":60,"context_line":"unstagged\u003d$(git status -s)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"if [ ! -z \"${unstagged}\" ]; then"},{"line_number":63,"context_line":"    FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":64,"context_line":"else"},{"line_number":65,"context_line":"    FILES\u003d$(git show --pretty\u003d\"\" --name-only ${SHA})"},{"line_number":66,"context_line":"fi"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_62098382","line":63,"in_reply_to":"9f560f44_676b55b8","updated":"2020-10-12 16:25:13.000000000","message":"I can propose this command which is working on bash and remove Deleted files from the list.\n\nFILES\u003d\"$(git status -s | grep -v \"^ D \" | awk -F \" \" \u0027{print $2}\u0027)\"","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"f7df336ee8377f30af2f9658edb6e71d7fb6b48a","unresolved":false,"context_lines":[{"line_number":60,"context_line":"unstagged\u003d$(git status -s)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"if [ ! -z \"${unstagged}\" ]; then"},{"line_number":63,"context_line":"    FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":64,"context_line":"else"},{"line_number":65,"context_line":"    FILES\u003d$(git show --pretty\u003d\"\" --name-only ${SHA})"},{"line_number":66,"context_line":"fi"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_03625616","line":63,"in_reply_to":"9f560f44_78cadd4e","updated":"2020-10-12 08:49:21.000000000","message":"Sorry but it works fine, here I simply want to delete the prefix (\u0027M\u0027, \u0027D\u0027, \u0027A\u0027) on each file","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"4e47c1154b0a351599bbac155854c2989e20120f","unresolved":false,"context_lines":[{"line_number":60,"context_line":"unstagged\u003d$(git status -s)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"if [ ! -z \"${unstagged}\" ]; then"},{"line_number":63,"context_line":"    FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":64,"context_line":"else"},{"line_number":65,"context_line":"    FILES\u003d$(git show --pretty\u003d\"\" --name-only ${SHA})"},{"line_number":66,"context_line":"fi"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_676b55b8","line":63,"in_reply_to":"9f560f44_acf712d4","updated":"2020-10-12 15:14:53.000000000","message":"By the way, IIRC you are running zsh on you laptop, you won\u0027t have this comportement with zsh, zsh vars can be on several lines. The shebang here is /bin/bash, and this code is not bash compatible.\nMaybe the difference of comportment you can see comes from here.","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"80ccc81d8c327da11ce43e14acf0b5f658567fdb","unresolved":false,"context_lines":[{"line_number":62,"context_line":"if [ ! -z \"${unstagged}\" ]; then"},{"line_number":63,"context_line":"    FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":64,"context_line":"else"},{"line_number":65,"context_line":"    FILES\u003d$(git show --pretty\u003d\"\" --name-only ${SHA})"},{"line_number":66,"context_line":"fi"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"rc\u003d0"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_f829cdf1","line":65,"updated":"2020-10-12 07:58:25.000000000","message":"This does not answer anything if latest commit is a merge commit, So if you had two commit in the same review for example.\n\nYou can get latest non-merged commit using this command : \ngit rev-list --no-merges -n 1 HEAD\nbut I do not know if this is what you want, since in case of a merge commit, my understanding is that you want to check all commits included in the merge ...","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"0cc995d2190017233acd66c717d241ec77a9e609","unresolved":false,"context_lines":[{"line_number":62,"context_line":"if [ ! -z \"${unstagged}\" ]; then"},{"line_number":63,"context_line":"    FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":64,"context_line":"else"},{"line_number":65,"context_line":"    FILES\u003d$(git show --pretty\u003d\"\" --name-only ${SHA})"},{"line_number":66,"context_line":"fi"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"rc\u003d0"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_67ad1583","line":65,"in_reply_to":"9f560f44_2c194287","updated":"2020-10-12 15:37:32.000000000","message":"For more context on my example : \n\n[sboyron@rhlaptop rpm-packaging]$ git log --graph\n* commit 35e3269093005738d5ea14307612c02c2774e78d (HEAD -\u003e review/hervé_beraud/756383)\n| Author: Hervé Beraud \u003chberaud@redhat.com\u003e\n| Date:   Tue Oct 6 21:34:16 2020 +0200\n| \n|     Adding tool to compare requirements\n|     \n|     Adding a new tool to allow us to compare package requirements.\n|     \n|     For now it will only check for runtime requirements but we could easily\n|     add testing requirements checks in a second time.\n|     \n|     Example:\n|     \n|     ```\n|     tox -e check-reqs -- --pkg\u003doslo.privsep\u003d\u003d1.33.4\n|     /home/hberaud/dev/redhat/upstream/openstack/rpm-packaging/tools/check-requirements.sh\n|     --pkg\u003doslo.privsep\u003d\u003d1.33.4\n|     Looking for: greenlet, oslo.utils, eventlet, oslo.config, cffi,\n|     oslo.log, msgpack, oslo.i18n\n|     Compare with content of openstack/oslo.privsep/oslo.privsep.spec.j2\n|     Package\u0027s requirements seems up-to-date\n|     ___ summary ____\n|       check-reqs: commands succeeded\n|         congratulations :)\n|     ```\n|     \n|     Change-Id: I3c5984ddee9609024b73f6362bb969e90d64c5f2\n|     Co-authored-by: Sébastien Boyron \u003csboyron@redhat.com\u003e\n|   \n*   commit d17869e6e2ce04ce4708feb7e24b8fc7e007e623\n|\\  Merge: 4507e718 5265b69d\n| | Author: Zuul \u003czuul@review.opendev.org\u003e\n| | Date:   Wed Jan 15 09:08:58 2020 +0000\n| | \n| |     Merge \"microversion_parse: convert to python3\"\n| | \n| * commit 5265b69da1659d4d685c3619cf444a15b4cc514e\n| | Author: Javier Pena \u003cjpena@redhat.com\u003e\n| | Date:   Tue Jan 14 12:45:20 2020 +0100\n| | \n| |     microversion_parse: convert to python3\n| |     \n| |     Change-Id: Ie42291cc4817ac506be04ff5bb73e5843d717d00\n| |   \n| | Date:   Tue Jan 14 12:45:20 2020 +0100\n| | \n| |     microversion_parse: convert to python3\n| |     \n| |     Change-Id: Ie42291cc4817ac506be04ff5bb73e5843d717d00\n| |   \n* |   commit 4507e718fc0136e63a9113816e33290cd7a772f3\n|\\ \\  Merge: 484daee8 87bcc8f1\n| | | Author: Zuul \u003czuul@review.opendev.org\u003e\n| | | Date:   Tue Jan 14 19:47:29 2020 +0000\n| | | \n| | |     Merge \"Update to initial ussuri release\"\n| | | \n| * | commit 87bcc8f1cf62f23beb79120c51373837896e5855\n| | | Author: Dirk Mueller \u003cdirk@dmllr.de\u003e\n| | | Date:   Mon Dec 2 14:18:22 2019 +0100\n| | | \n| | |     Update to initial ussuri release\n| | |     \n| | |     Change-Id: I5774e62003403001b7447192427868c191807442\n| | |   \n* | |   commit 484daee891bc67acde729b713408ad0007f74788\n|\\ \\ \\  Merge: 5ff3938a b947cf3f\n| |/ /  Author: Zuul \u003czuul@review.opendev.org\u003e\n|/| |   Date:   Tue Jan 14 19:46:08 2020 +0000\n| | |   \n| | |       Merge \"metalsmith: convert to python3\"\n| | | \n| * | commit b947cf3f54c7b89c7d851aca2ff347e3465bfb9b\n| |/  Author: Javier Pena \u003cjpena@redhat.com\u003e\n| |   Date:   Tue Jan 14 12:19:25 2020 +0100\n| |   \n| |       metalsmith: convert to python3\n| |       \n| |       Change-Id: I0e0dfe8fc048ac0c979d5f2fc33f7ad62ca0ae29\n| | \n\n\n\u003d\u003e We can see that applying the script on commit 4507e718fc0136e63a9113816e33290cd7a772f3, should results in applying on the commits brings by this one, so the 87bcc8f1cf62f23beb79120c51373837896e5855 and the b947cf3f54c7b89c7d851aca2ff347e3465bfb9b.","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"f7df336ee8377f30af2f9658edb6e71d7fb6b48a","unresolved":false,"context_lines":[{"line_number":62,"context_line":"if [ ! -z \"${unstagged}\" ]; then"},{"line_number":63,"context_line":"    FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":64,"context_line":"else"},{"line_number":65,"context_line":"    FILES\u003d$(git show --pretty\u003d\"\" --name-only ${SHA})"},{"line_number":66,"context_line":"fi"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"rc\u003d0"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_fe74159e","line":65,"in_reply_to":"9f560f44_f829cdf1","updated":"2020-10-12 08:49:21.000000000","message":"No you are wrong, I only want to capture files related to one commit (either specified by the given sha or the HEAD of the current branch if no sha is given).\n\nMy goal is not to parse all our files or all our commits, my goal is only to analyze delta on a specific commit to allow us to:\n1. analyze changes landed by the last commit (head)\n    1.a on CI\n    1.b with pre-commit\n    1.c locally by calling this script without params\n2. analyze unstagged changes to help us during versions updates\n\nSo normally we don\u0027t have scenario where a merge commit will be analyzed except if you pass a related sha to the tool but in this case it wouldn\u0027t loop over files, in other words in this scenario nothing will happen.\n\nOn CI we need to pass the sha by using zuul.\n\nLocally we haven\u0027t to pass something, if unstagged changes exist it will analyze them, else it will analyze the last commit, no matter if this last commit is a merge commit or not.","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f36b6cdc782b26c0a30815b090e358313899db83","unresolved":false,"context_lines":[{"line_number":62,"context_line":"if [ ! -z \"${unstagged}\" ]; then"},{"line_number":63,"context_line":"    FILES\u003d$(echo ${unstagged} | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":64,"context_line":"else"},{"line_number":65,"context_line":"    FILES\u003d$(git show --pretty\u003d\"\" --name-only ${SHA})"},{"line_number":66,"context_line":"fi"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"rc\u003d0"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_2c194287","line":65,"in_reply_to":"9f560f44_fe74159e","updated":"2020-10-12 14:57:00.000000000","message":"\u003e No you are wrong, I only want to capture files related to one\n \u003e commit (either specified by the given sha or the HEAD of the\n \u003e current branch if no sha is given).\n\nThis is working well when it is a regular commit : \n\n\n [sboyron@rhlaptop rpm-packaging]$ git log  | head \ncommit 35e3269093005738d5ea14307612c02c2774e78d\nAuthor: Hervé Beraud \u003chberaud@redhat.com\u003e\nDate:   Tue Oct 6 21:34:16 2020 +0200\n\n    Adding tool to compare requirements\n    \n    Adding a new tool to allow us to compare package requirements.\n    \n    For now it will only check for runtime requirements but we could easily\n    add testing requirements checks in a second time.\n[sboyron@rhlaptop rpm-packaging]$ git show --pretty\u003d\"\" --name-only HEAD\ntools/check-requirements.sh\ntox.ini\n\nBut when it is a merge commit :\n\n[sboyron@rhlaptop bashate]$ git log | head\ncommit a883b9c0ee028a47cdf3ad9881fdc28d425e0b82\nMerge: b920900 4ef452b\nAuthor: Zuul \u003czuul@review.opendev.org\u003e\nDate:   Fri Jul 10 13:36:06 2020 +0000\n\n    Merge \"drop mock from lower-constraints and requirements\"\n\ncommit b920900b1bc2be83741a1fd26338f3dbf306561d\nAuthor: Andreas Jaeger \u003caj@suse.com\u003e\nDate:   Tue Jun 9 10:29:49 2020 +0200\n[sboyron@rhlaptop bashate]$ git show --pretty\u003d\"\" --name-only HEAD\n[sboyron@rhlaptop bashate]$ \n\n\u003d\u003e this does not return anything since it is a merge commit howerver this merge commit brings one or several commits which are bringing some code.\n\n \u003e My goal is not to parse all our files or all our commits, my goal\n \u003e is only to analyze delta on a specific commit to allow us to:\n\nYep sure, only the required stuff to do.\n\n \u003e 1. analyze changes landed by the last commit (head)\n \u003e 1.a on CI\n \u003e 1.b with pre-commit\n \u003e 1.c locally by calling this script without params\n\nYes, that\u0027s the precise point, if the latest commit is a merge of several commit what do you want to check ?\n\n \u003e 2. analyze unstagged changes to help us during versions updates\n\nAs I said on this point, for now you\u0027re just taking the first modified file (as explained previously)\n\n \u003e So normally we don\u0027t have scenario where a merge commit will be\n\nI do not understand why ? \nZuul is always performing some merge commits.\n\nIf we have a look on rpm-packaging git logs : \n\n[sboyron@rhlaptop rpm-packaging]$ git log --pretty\u003doneline\n35e3269093005738d5ea14307612c02c2774e78d (HEAD -\u003e review/hervé_beraud/756383) Adding tool to compare requirements\nd17869e6e2ce04ce4708feb7e24b8fc7e007e623 Merge \"microversion_parse: convert to python3\"\n4507e718fc0136e63a9113816e33290cd7a772f3 Merge \"Update to initial ussuri release\"\n484daee891bc67acde729b713408ad0007f74788 Merge \"metalsmith: convert to python3\"\n87bcc8f1cf62f23beb79120c51373837896e5855 Update to initial ussuri release\n5ff3938ad48eac7526ec27ad4157cd81db2942d4 glance: generate sample policy\nf4a377e2367bbb3b2f0cbef84c6c0f9dbcbb25ef Merge \"cinder: add SQLAlchemy-Utils\"\nf29fce294ff9ce10b0a59727afdf1485b8a686db cinder: add SQLAlchemy-Utils\n5265b69da1659d4d685c3619cf444a15b4cc514e microversion_parse: convert to python3\nb947cf3f54c7b89c7d851aca2ff347e3465bfb9b metalsmith: convert to python3\nf89ac281fdc302f329c1556851278767154c5439 Merge \"castellan: convert to python3\"\n731ce2b59d82a6098741a20ad7923028e0e038bf Merge \"ironic-python-agent: Address review feedback\"\n46190838aa71ea7ebfdb0092b35515990a861ca4 Merge \"nova: Remove xvpvncproxy\"\n\n\u003d\u003e My understanding is that there is a huge amount of  Merge commit doing some stuff on some .spec files that won\u0027t be tested with your code.\n\n \u003e analyzed except if you pass a related sha to the tool but in this\n \u003e case it wouldn\u0027t loop over files, in other words in this scenario\n \u003e nothing will happen.\n \u003e \n \u003e On CI we need to pass the sha by using zuul.\n\n \u003e Locally we haven\u0027t to pass something, if unstagged changes exist it\n \u003e will analyze them, else it will analyze the last commit, no matter\n \u003e if this last commit is a merge commit or not.\n\n\u003d\u003e My understanding is that we may should use : \na git log -m -1 --name-only --pretty\u003d\"format:\"  $SHA\nwhich will return all modified files bring by latest commit (or merged commit) regardless if it is in a Zuul CI context or not. \n\neg: \n\n[sboyron@rhlaptop rpm-packaging]$ git show --pretty\u003d\"\" --name-only 4507e718fc0136e63a9113816e33290cd7a772f3\n[sboyron@rhlaptop rpm-packaging]$ git log -m -1 --name-only --pretty\u003d\"format:\" 4507e718fc0136e63a9113816e33290cd7a772f3\nopenstack/castellan/castellan.spec.j2\nopenstack/futurist/futurist.spec.j2\nopenstack/mistral-lib/mistral-lib.spec.j2\nopenstack/openstacksdk/0001-Increase-test-timeout-for-2-tests-in-TestImageProxy-.patch\nopenstack/openstacksdk/openstacksdk.spec.j2\nopenstack/oslo.cache/oslo.cache.spec.j2\nopenstack/oslo.concurrency/oslo.concurrency.spec.j2\nopenstack/oslo.config/oslo.config.spec.j2\nopenstack/oslo.db/oslo.db.spec.j2\nopenstack/oslo.i18n/oslo.i18n.spec.j2\nopenstack/oslo.log/oslo.log.spec.j2\nopenstack/oslo.messaging/oslo.messaging.spec.j2\nopenstack/oslo.policy/oslo.policy.spec.j2\nopenstack/oslo.reports/oslo.reports.spec.j2\nopenstack/oslo.rootwrap/oslo.rootwrap.spec.j2\nopenstack/oslo.service/oslo.service.spec.j2\nopenstack/oslo.utils/oslo.utils.spec.j2\nopenstack/osprofiler/osprofiler.spec.j2\nopenstack/sphinx-feature-classification/0001-make-sure-destination-dir-exist-before-copying-files.patch\nopenstack/sphinx-feature-classification/sphinx-feature-classification.spec.j2\n\nopenstack/metalsmith/metalsmith.spec.j2\n[sboyron@rhlaptop rpm-packaging]$ git show --pretty\u003d\"\" --name-only HEAD\ntools/check-requirements.sh\ntox.ini\n[sboyron@rhlaptop rpm-packaging]$ git log -m -1 --name-only --pretty\u003d\"format:\" HEAD\ntools/check-requirements.sh\ntox.ini","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"80ccc81d8c327da11ce43e14acf0b5f658567fdb","unresolved":false,"context_lines":[{"line_number":69,"context_line":"for file in ${FILES}"},{"line_number":70,"context_line":"do"},{"line_number":71,"context_line":"    case \"${file}\" in"},{"line_number":72,"context_line":"        openstack/*.j2)"},{"line_number":73,"context_line":"            echo \"Verifying ${file}\""},{"line_number":74,"context_line":"            project\u003d$(basename ${file/.spec.j2//})"},{"line_number":75,"context_line":"            version\u003d$("}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_18cf6128","line":72,"updated":"2020-10-12 07:58:25.000000000","message":"Why don\u0027t you want to test spec under other folders, like x/ folder which is supposed to be bring with https://review.opendev.org/#/c/677808/ ?\n\nAnd more than checking it is a j2 file, I would have check if it is a *.spec.j2 file to ensure you are on a spec template file, if in the future we have some templates files for other things you will catch them.","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"f7df336ee8377f30af2f9658edb6e71d7fb6b48a","unresolved":false,"context_lines":[{"line_number":69,"context_line":"for file in ${FILES}"},{"line_number":70,"context_line":"do"},{"line_number":71,"context_line":"    case \"${file}\" in"},{"line_number":72,"context_line":"        openstack/*.j2)"},{"line_number":73,"context_line":"            echo \"Verifying ${file}\""},{"line_number":74,"context_line":"            project\u003d$(basename ${file/.spec.j2//})"},{"line_number":75,"context_line":"            version\u003d$("}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_7e6805b9","line":72,"in_reply_to":"9f560f44_18cf6128","updated":"2020-10-12 08:49:21.000000000","message":"- Airship dir seems empty\n- x dir doesn\u0027t exist or I missed something\n\nYou\u0027re right about the spec prefix, I\u0027ll add it it\u0027s a good idea.","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f36b6cdc782b26c0a30815b090e358313899db83","unresolved":false,"context_lines":[{"line_number":69,"context_line":"for file in ${FILES}"},{"line_number":70,"context_line":"do"},{"line_number":71,"context_line":"    case \"${file}\" in"},{"line_number":72,"context_line":"        openstack/*.j2)"},{"line_number":73,"context_line":"            echo \"Verifying ${file}\""},{"line_number":74,"context_line":"            project\u003d$(basename ${file/.spec.j2//})"},{"line_number":75,"context_line":"            version\u003d$("}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_2ca022a5","line":72,"in_reply_to":"9f560f44_7e6805b9","updated":"2020-10-12 14:57:00.000000000","message":"x dir should not be empty, a merge request is on-going, and I do not really understand why limiting this only to openstack folder.","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"80ccc81d8c327da11ce43e14acf0b5f658567fdb","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            echo \"Verifying ${file}\""},{"line_number":74,"context_line":"            project\u003d$(basename ${file/.spec.j2//})"},{"line_number":75,"context_line":"            version\u003d$("},{"line_number":76,"context_line":"                grep -i \"set upstream_version\" ${file} | \\"},{"line_number":77,"context_line":"                sed \"/set[[:space:]]*upstream_version/s/.*\u0027\\([^\u0027]*\\)\u0027.*/\\1/\")"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"            pip install ${project}\u003d\u003d${version} \u0026\u003e/dev/null"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_f861cd12","line":76,"range":{"start_line":76,"start_character":16,"end_line":76,"end_character":58},"updated":"2020-10-12 07:58:25.000000000","message":"This is useless; your sed command already doing it (better) in the first part of the regex : \n/ is for searching a pattern, next operation will be done only on this line .\n\n  /set[[:space:]]*upstream_version/\n\nthis is looking for the line set with some spaces or tab then upstream_version keyword. \n\nIndeed while reviewving it, I can propose to use : \n\n  /^[[:space:]]*set[[:space:]]*upstream_version/\n\ninstead to ensure you are not using a commented ligne.\n\nThen you removed the -n and p from my latest proposition. \n-n will change sed to output nothing\np command will print only the treated line\n\u003d\u003e it will so act like a grep.\n\nGlobal command is so : \n\nsed -n \"/^[[:space:]]*set[[:space:]]*upstream_version/s/.*\u0027\\([^\u0027]*\\)\u0027.*/\\1/\" ${file}","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"f7df336ee8377f30af2f9658edb6e71d7fb6b48a","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            echo \"Verifying ${file}\""},{"line_number":74,"context_line":"            project\u003d$(basename ${file/.spec.j2//})"},{"line_number":75,"context_line":"            version\u003d$("},{"line_number":76,"context_line":"                grep -i \"set upstream_version\" ${file} | \\"},{"line_number":77,"context_line":"                sed \"/set[[:space:]]*upstream_version/s/.*\u0027\\([^\u0027]*\\)\u0027.*/\\1/\")"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"            pip install ${project}\u003d\u003d${version} \u0026\u003e/dev/null"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_be5e1d10","line":76,"range":{"start_line":76,"start_character":16,"end_line":76,"end_character":58},"in_reply_to":"9f560f44_f861cd12","updated":"2020-10-12 08:49:21.000000000","message":"Ack I will rework this part","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"80ccc81d8c327da11ce43e14acf0b5f658567fdb","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            for el in ${reqs}"},{"line_number":82,"context_line":"            do"},{"line_number":83,"context_line":"                el\u003d${el/,/}"},{"line_number":84,"context_line":"                grep -i \"^[[:space:]]*Requires:[[:space:]].*${el}.*\" \\"},{"line_number":85,"context_line":"                    ${file} \u0026\u003e/dev/null"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"                if [ $? -eq 0 ]; then"},{"line_number":88,"context_line":"                    continue"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_6391929a","line":85,"range":{"start_line":84,"start_character":0,"end_line":85,"end_character":39},"updated":"2020-10-12 07:58:25.000000000","message":"This method with grep and a loop doesn\u0027t allow to list removed dependencies.\nIt doesn\u0027t matter for a first version but may can be highlighted in a comment at the beginning of the file to understand quickly the scope of the test. Only new deps will be checked, no clean on old requires.","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"f7df336ee8377f30af2f9658edb6e71d7fb6b48a","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            for el in ${reqs}"},{"line_number":82,"context_line":"            do"},{"line_number":83,"context_line":"                el\u003d${el/,/}"},{"line_number":84,"context_line":"                grep -i \"^[[:space:]]*Requires:[[:space:]].*${el}.*\" \\"},{"line_number":85,"context_line":"                    ${file} \u0026\u003e/dev/null"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"                if [ $? -eq 0 ]; then"},{"line_number":88,"context_line":"                    continue"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_9edcf971","line":85,"range":{"start_line":84,"start_character":0,"end_line":85,"end_character":39},"in_reply_to":"9f560f44_6391929a","updated":"2020-10-12 08:49:21.000000000","message":"Here I compare project\u0027s requirements with req in spec, but I need to add another test which compare req in spec with project\u0027s requirements (flip the test) normally it will allow us to catch removed things.\n\nAs I said in my commit message, these changes are WIP so many parts are missing for now.","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"f36b6cdc782b26c0a30815b090e358313899db83","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            for el in ${reqs}"},{"line_number":82,"context_line":"            do"},{"line_number":83,"context_line":"                el\u003d${el/,/}"},{"line_number":84,"context_line":"                grep -i \"^[[:space:]]*Requires:[[:space:]].*${el}.*\" \\"},{"line_number":85,"context_line":"                    ${file} \u0026\u003e/dev/null"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"                if [ $? -eq 0 ]; then"},{"line_number":88,"context_line":"                    continue"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_0ca39eb2","line":85,"range":{"start_line":84,"start_character":0,"end_line":85,"end_character":39},"in_reply_to":"9f560f44_9edcf971","updated":"2020-10-12 14:57:00.000000000","message":"Yes, got it, I was just saying that having a comment word explaining what to attend from this test could be more explicit. This test is not yet complete and we can not relay only on it to ensure reqs are well defined.","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":27380,"name":"Boyron Sébastien","email":"sboyron@redhat.com","username":"sboyron"},"change_message_id":"80ccc81d8c327da11ce43e14acf0b5f658567fdb","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                    continue"},{"line_number":89,"context_line":"                fi"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"                echo -e \"- ${el} not found.\""},{"line_number":92,"context_line":"                if [ ${rc} -eq 0 ]; then"},{"line_number":93,"context_line":"                    rc\u003d1"},{"line_number":94,"context_line":"                fi"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_a359ea29","line":91,"updated":"2020-10-12 07:58:25.000000000","message":"Just a stupid question, but shouldn\u0027t we print this on stderr to have it on CI and being able to extract it ? \necho -e \"- ${el} not found.\" \u003e\u00262","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"f7df336ee8377f30af2f9658edb6e71d7fb6b48a","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                    continue"},{"line_number":89,"context_line":"                fi"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"                echo -e \"- ${el} not found.\""},{"line_number":92,"context_line":"                if [ ${rc} -eq 0 ]; then"},{"line_number":93,"context_line":"                    rc\u003d1"},{"line_number":94,"context_line":"                fi"}],"source_content_type":"text/x-sh","patch_set":13,"id":"9f560f44_deeaf10b","line":91,"in_reply_to":"9f560f44_a359ea29","updated":"2020-10-12 08:49:21.000000000","message":"Good idea","commit_id":"b3c9f5fea40411826d1823cf56506bc622897cf8"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"dd028e4cc67c25ed67ae8831dcc4ad020e4920a0","unresolved":false,"context_lines":[{"line_number":59,"context_line":"FILES\u003d$(git status -s | grep -v \"^ D \" | awk -F \" \" \u0027{print $2}\u0027)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"if [ -z \"${FILES}\" ]; then"},{"line_number":62,"context_line":"    FILES\u003d$(git log -m -1 --max-parents\u003d1 --pretty\u003d\"format:\" --name-only ${SHA})"},{"line_number":63,"context_line":"fi"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"rc\u003d0"}],"source_content_type":"text/x-sh","patch_set":15,"id":"9f560f44_e4fd9e6d","line":62,"range":{"start_line":62,"start_character":26,"end_line":62,"end_character":44},"updated":"2020-10-12 19:46:20.000000000","message":"Congrats it works well with CI and locally (with HEAD, merge commit, and specific sha)","commit_id":"f4975732e12b2df76e21977015f7430aa6358d51"},{"author":{"_account_id":13294,"name":"Javier Peña","email":"jpena@redhat.com","username":"jpena"},"change_message_id":"a9dc2cbfd8ae09767eca5b86fce426c3210d2ce1","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                grep -i \"set upstream_version\" ${file} | \\"},{"line_number":74,"context_line":"                sed \"/set[[:space:]]*upstream_version/s/.*\u0027\\([^\u0027]*\\)\u0027.*/\\1/\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"            pip install ${project}\u003d\u003d${version} \u0026\u003e/dev/null"},{"line_number":77,"context_line":"            reqs\u003d$(pip show ${project} | sed -n \u0027s/^Requires://p\u0027)"},{"line_number":78,"context_line":"            for el in ${reqs}"},{"line_number":79,"context_line":"            do"}],"source_content_type":"text/x-sh","patch_set":15,"id":"5f681702_8f3bd69a","line":76,"range":{"start_line":76,"start_character":12,"end_line":76,"end_character":58},"updated":"2020-10-19 13:27:00.000000000","message":"Running this without a virtualenv looks like a bad idea.\nMaybe we could create it before starting the loop?","commit_id":"f4975732e12b2df76e21977015f7430aa6358d51"}]}
