)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"d26558867c7f3014ee6b62b34267b4d862b04951","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"3a38d97e_19e5dee2","updated":"2023-04-04 13:39:49.000000000","message":"Thanks Hervé for working on this! I have one question inline, as I\u0027m not sure that the package is installed during the script run.","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"5ff11d6da62d64ed266097d42fe847204b0cb0fa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"1cfe42d8_b426c89b","updated":"2023-06-01 13:00:24.000000000","message":"Thanks for the update Hervé. I fear a bit that the install can cause issues in some cases, but anyway, if there will be any issue then we can fall back to the workaround. So let\u0027s merge this.","commit_id":"2b46589cc395062e328a204e33ebd0c8b49bac56"}],"tools/announce.sh":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"e0e938a1a8c9d66f912d25d78fab85012663c206","unresolved":true,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"relnotes_file\u003d\"$RELNOTESDIR/$SHORTNAME-$VERSION\""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"if [ -e setup.py ] ; then"},{"line_number":172,"context_line":"    echo \"Priming setup_requires packages\""},{"line_number":173,"context_line":"    # As we use importlib to retrieve information we have to pass the"},{"line_number":174,"context_line":"    # importable name of the module, example: oslo.messaging \u003d\u003e oslo_messaging"}],"source_content_type":"text/x-sh","patch_set":1,"id":"4155e0d8_fcec117b","line":171,"range":{"start_line":171,"start_character":8,"end_line":171,"end_character":13},"updated":"2023-04-03 08:43:58.000000000","message":"I wonder if we should remove this condition","commit_id":"559d3f6291e4c02b561644bdd4295b4d6dda017e"},{"author":{"_account_id":13252,"name":"Dr. Jens Harbott","display_name":"Jens Harbott (frickler)","email":"frickler@offenerstapel.de","username":"jrosenboom"},"change_message_id":"bdf13c84fea27fa98ee903efa3819b8ae0d289eb","unresolved":true,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"relnotes_file\u003d\"$RELNOTESDIR/$SHORTNAME-$VERSION\""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"if [ -e setup.py ] ; then"},{"line_number":172,"context_line":"    echo \"Priming setup_requires packages\""},{"line_number":173,"context_line":"    # As we use importlib to retrieve information we have to pass the"},{"line_number":174,"context_line":"    # importable name of the module, example: oslo.messaging \u003d\u003e oslo_messaging"}],"source_content_type":"text/x-sh","patch_set":1,"id":"7b035d83_862f3245","line":171,"range":{"start_line":171,"start_character":8,"end_line":171,"end_character":13},"in_reply_to":"4155e0d8_fcec117b","updated":"2023-04-03 08:57:21.000000000","message":"Well you still need some kind of condition to termine whether we are working on a valid python project or not. Likely the most straightforward check would be to check\n\nimportlib.metadata.metadata(\u0027${modified_shortname}\u0027)\n\nalready here and see whether it is defined and possibly whether the fields that are referenced below are present.","commit_id":"559d3f6291e4c02b561644bdd4295b4d6dda017e"},{"author":{"_account_id":13252,"name":"Dr. Jens Harbott","display_name":"Jens Harbott (frickler)","email":"frickler@offenerstapel.de","username":"jrosenboom"},"change_message_id":"bdf13c84fea27fa98ee903efa3819b8ae0d289eb","unresolved":true,"context_lines":[{"line_number":169,"context_line":"relnotes_file\u003d\"$RELNOTESDIR/$SHORTNAME-$VERSION\""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"if [ -e setup.py ] ; then"},{"line_number":172,"context_line":"    echo \"Priming setup_requires packages\""},{"line_number":173,"context_line":"    # As we use importlib to retrieve information we have to pass the"},{"line_number":174,"context_line":"    # importable name of the module, example: oslo.messaging \u003d\u003e oslo_messaging"},{"line_number":175,"context_line":"    modified_shortname\u003d${SHORTNAME//\\./_}"}],"source_content_type":"text/x-sh","patch_set":1,"id":"9ca8b0ac_d51140cb","line":172,"updated":"2023-04-03 08:57:21.000000000","message":"IIUC this line belonged to the next one, so it is obsolete now, too","commit_id":"559d3f6291e4c02b561644bdd4295b4d6dda017e"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"d26558867c7f3014ee6b62b34267b4d862b04951","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"# ensure that the package is a valid package that can be imported by"},{"line_number":176,"context_line":"# importlib.metadata"},{"line_number":177,"context_line":"python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027))\""},{"line_number":178,"context_line":"exit_code\u003d$?"},{"line_number":179,"context_line":"if [ ${exit_code} -eq 0 ] ; then"},{"line_number":180,"context_line":"    project_name\u003d$(python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027)[\u0027Name\u0027])\")"}],"source_content_type":"text/x-sh","patch_set":2,"id":"adc8d417_80887e6f","line":177,"updated":"2023-04-04 13:39:49.000000000","message":"note, that for this to work we need the package to be installed, or am I wrong with this assumption?","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"4d7ebb7cd75c1183b551f91f3cafaba4f2289749","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"# ensure that the package is a valid package that can be imported by"},{"line_number":176,"context_line":"# importlib.metadata"},{"line_number":177,"context_line":"python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027))\""},{"line_number":178,"context_line":"exit_code\u003d$?"},{"line_number":179,"context_line":"if [ ${exit_code} -eq 0 ] ; then"},{"line_number":180,"context_line":"    project_name\u003d$(python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027)[\u0027Name\u0027])\")"}],"source_content_type":"text/x-sh","patch_set":2,"id":"cb91b15a_16742f70","line":177,"in_reply_to":"783c0a26_c81dba0f","updated":"2023-04-06 12:57:47.000000000","message":"modified_shortname is a variable declared at line 173.","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"1db58bf62d2ce8d283e749f622ae1579b4f49dfe","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"# ensure that the package is a valid package that can be imported by"},{"line_number":176,"context_line":"# importlib.metadata"},{"line_number":177,"context_line":"python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027))\""},{"line_number":178,"context_line":"exit_code\u003d$?"},{"line_number":179,"context_line":"if [ ${exit_code} -eq 0 ] ; then"},{"line_number":180,"context_line":"    project_name\u003d$(python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027)[\u0027Name\u0027])\")"}],"source_content_type":"text/x-sh","patch_set":2,"id":"783c0a26_c81dba0f","line":177,"in_reply_to":"7cbe01b7_8c7c42ae","updated":"2023-04-06 10:13:08.000000000","message":"Sorry, i was not clear, what i meant is we probably need $modified_shortname pkg to be installed for the code to work, not importlib o:)","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"3af9eb41fe36b6fe7549f9fcc6a2f8d4cb578a88","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"# ensure that the package is a valid package that can be imported by"},{"line_number":176,"context_line":"# importlib.metadata"},{"line_number":177,"context_line":"python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027))\""},{"line_number":178,"context_line":"exit_code\u003d$?"},{"line_number":179,"context_line":"if [ ${exit_code} -eq 0 ] ; then"},{"line_number":180,"context_line":"    project_name\u003d$(python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027)[\u0027Name\u0027])\")"}],"source_content_type":"text/x-sh","patch_set":2,"id":"2bf6d060_634ce899","line":177,"in_reply_to":"9dcae87e_6cd20ce0","updated":"2023-04-11 10:28:22.000000000","message":"I suspect that in most of the cases the \u0027else\u0027 condition will be executed and project $description won\u0027t exist for the announce mail, so it should be easy to spot. i\u0027m OK to test this with a follow up.","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"3de0473f199936f4cf9baf271ad1a4bb79c08e89","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"# ensure that the package is a valid package that can be imported by"},{"line_number":176,"context_line":"# importlib.metadata"},{"line_number":177,"context_line":"python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027))\""},{"line_number":178,"context_line":"exit_code\u003d$?"},{"line_number":179,"context_line":"if [ ${exit_code} -eq 0 ] ; then"},{"line_number":180,"context_line":"    project_name\u003d$(python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027)[\u0027Name\u0027])\")"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7cbe01b7_8c7c42ae","line":177,"in_reply_to":"adc8d417_80887e6f","updated":"2023-04-05 07:02:08.000000000","message":"importlib.metadata is a module of the standard library since python3.8 \nhttps://docs.python.org/3/library/importlib.metadata.html\n\nSo I\u0027d argue that we haven\u0027t to install it as our actual python runtimes are 3.9 and 3.10.","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"f6687726ada1b353516783d28792cf96560962ef","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"# ensure that the package is a valid package that can be imported by"},{"line_number":176,"context_line":"# importlib.metadata"},{"line_number":177,"context_line":"python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027))\""},{"line_number":178,"context_line":"exit_code\u003d$?"},{"line_number":179,"context_line":"if [ ${exit_code} -eq 0 ] ; then"},{"line_number":180,"context_line":"    project_name\u003d$(python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027)[\u0027Name\u0027])\")"}],"source_content_type":"text/x-sh","patch_set":2,"id":"f2bbc30b_050c561c","line":177,"in_reply_to":"cb91b15a_16742f70","updated":"2023-04-11 13:16:10.000000000","message":"Well, after a couple of checks the package seems not installed, here is an example with an old build of the announce job for designate: \n\nhttps://zuul.opendev.org/t/openstack/build/0f82488211134f9b82f9ae00ef6c8f5d/log/job-output.txt\n\nSo either we add changes to install the \"package\" and we can continue with that patch or we should abandon it.\n\nThoughts?","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"efa9751a09456c1baebf08d9af9bae77f90e84fc","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"# ensure that the package is a valid package that can be imported by"},{"line_number":176,"context_line":"# importlib.metadata"},{"line_number":177,"context_line":"python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027))\""},{"line_number":178,"context_line":"exit_code\u003d$?"},{"line_number":179,"context_line":"if [ ${exit_code} -eq 0 ] ; then"},{"line_number":180,"context_line":"    project_name\u003d$(python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027)[\u0027Name\u0027])\")"}],"source_content_type":"text/x-sh","patch_set":2,"id":"f83253f3_bd73b0c5","line":177,"in_reply_to":"cb91b15a_16742f70","updated":"2023-04-06 13:45:59.000000000","message":"i mean, for example we want to announce validations-common 1.9.0 version, then we validations-common has to be installed otherwise importlib.metadata.metadata(\u0027validations-common\u0027)[\u0027Name\u0027] will raise an Exception:\n\nimportlib.metadata.PackageNotFoundError: No package metadata was found for validations-common\n\nSo my question wanted to be: does the zuul job install the package that we want to announce before the script run? (i.e. validations-common in my example)","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"50d4e6d1975cc5e880b4b86d746be1c12e5a13ad","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"# ensure that the package is a valid package that can be imported by"},{"line_number":176,"context_line":"# importlib.metadata"},{"line_number":177,"context_line":"python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027))\""},{"line_number":178,"context_line":"exit_code\u003d$?"},{"line_number":179,"context_line":"if [ ${exit_code} -eq 0 ] ; then"},{"line_number":180,"context_line":"    project_name\u003d$(python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027)[\u0027Name\u0027])\")"}],"source_content_type":"text/x-sh","patch_set":2,"id":"f72e9635_af6b223f","line":177,"in_reply_to":"f2bbc30b_050c561c","updated":"2023-04-12 09:39:48.000000000","message":"I don\u0027t have strong opinions here, but if we want to use the importlib version (at first glance i liked the idea better than the workaround we have now), then I guess we have to use \u0027python -m pip install .\u0027, but that is a bit more than we had with \u0027python setup.py --name\u0027 previously (as it only installed some dependency in case it was listed in setup.py).\nSo I\u0027m not sure what is the best / least error-prone... :/","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"7b20a558d6ddf2fb34ff48aded2f8c7010a49734","unresolved":true,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"# ensure that the package is a valid package that can be imported by"},{"line_number":176,"context_line":"# importlib.metadata"},{"line_number":177,"context_line":"python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027))\""},{"line_number":178,"context_line":"exit_code\u003d$?"},{"line_number":179,"context_line":"if [ ${exit_code} -eq 0 ] ; then"},{"line_number":180,"context_line":"    project_name\u003d$(python -c \"import importlib.metadata; print(importlib.metadata.metadata(\u0027${modified_shortname}\u0027)[\u0027Name\u0027])\")"}],"source_content_type":"text/x-sh","patch_set":2,"id":"9dcae87e_6cd20ce0","line":177,"in_reply_to":"f83253f3_bd73b0c5","updated":"2023-04-07 13:53:01.000000000","message":"No problem, sorry for my previous dumb response, now I see the point.\n\nI think the response is yes, the package needs to be installed to become importable from the local python environment.\n\nYou are right that\u0027s a significant change compared to the previous version of this script, however, during my local checks I never faced issue even without installing the package before.\n\nThe goal of the line 179 is to check if the package is installed if it is not installed then we will execute the else condition where info seems retrieved from local working directory.\n\nI don\u0027t know if zull install the package or not, but I think we should test it with an other follow up patch to see how it react. \n\nThoughts?","commit_id":"fd6d5b78d68d30f87c25057b5182074c5cd6dc78"}]}
