)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"a69796fb1d64e482b6cbd267c56ce2e095b9b58c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"22bebb47_00b90103","updated":"2024-12-19 13:07:38.000000000","message":"recheck","commit_id":"ab489a27d8439df2cb356d7e2682a196e270392d"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"8efb453bb660a70ddda103fff9405390b1f91a34","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"91a16bf0_aa608b57","updated":"2024-12-18 20:17:30.000000000","message":"recheck\nunrelated ci errors","commit_id":"ab489a27d8439df2cb356d7e2682a196e270392d"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"cba8004780eb3181f559e3ba96e7251cf56ebb9b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"240c1d1a_6778854d","updated":"2024-12-19 15:11:22.000000000","message":"recheck\nunrelated flakiness","commit_id":"ab489a27d8439df2cb356d7e2682a196e270392d"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"1627df993d4f3f5b84bd95eed7b816bdd174fea2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"4c6979ed_def058a7","updated":"2024-12-19 00:15:24.000000000","message":"recheck\nunrelated issue","commit_id":"ab489a27d8439df2cb356d7e2682a196e270392d"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"a705b5ceb556ce14363510be28ab09d28aac859f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"b0cb6bec_9a995ed1","updated":"2025-01-15 19:11:57.000000000","message":"recheck\nnot sure if related","commit_id":"8bca0e8805427ef9503b19b13794fbe5007c97ed"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"1b93adf433be68e5da33e814d81a735835eeadf8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"cc5a8584_83c739b8","updated":"2025-01-17 07:11:42.000000000","message":"recheck\nunrelated","commit_id":"e6c71c20728ca4a557c4c0e3f43881305886794a"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"d0330c0f1f73b5309a838d9ef7fac90e82f30232","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"fdbd708e_cbf3200d","updated":"2025-01-17 09:33:35.000000000","message":"recheck\nunrelated","commit_id":"e6c71c20728ca4a557c4c0e3f43881305886794a"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"5fdc5afdeac4547989f76bf7afadf235a493ec0c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"fde3b2ff_3aa39156","updated":"2025-01-16 20:53:05.000000000","message":"recheck\nunrelated error","commit_id":"e6c71c20728ca4a557c4c0e3f43881305886794a"}],"doc/source/job-content.rst":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"c64d763c3e64bd0673c7bd9366acd128c92b8683","unresolved":true,"context_lines":[{"line_number":1047,"context_line":""},{"line_number":1048,"context_line":"   .. var:: autohold_if_failure"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"      True if this job will trigger a autohold of its nodes on failure."},{"line_number":1051,"context_line":""},{"line_number":1052,"context_line":"   .. var:: build"},{"line_number":1053,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"be4bfd9d_27d5d680","line":1050,"updated":"2025-01-07 18:17:19.000000000","message":"Maybe note that the value will be None if no determination could be made?\n\nAlso, it is possible for a job to autohold when autohold_if_failure is False. The reason for this is we prepare the job vars before the job starts but we evaluate autoholds when the job completes. This means there is a period of time where a job can start and set autohold_if_failure to False then an autohold is added, then the job fails and is held. I don\u0027t think there is a good solution to this maybe the best thing is simply to document that possibility here?","commit_id":"564289b5be0349d6ff76d7edb3c6da17288536ce"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"773c11b02c6e075420f57c64cd7ecbab8a967c20","unresolved":true,"context_lines":[{"line_number":1047,"context_line":""},{"line_number":1048,"context_line":"   .. var:: autohold_if_failure"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"      True if this job will trigger a autohold of its nodes on failure."},{"line_number":1051,"context_line":""},{"line_number":1052,"context_line":"   .. var:: build"},{"line_number":1053,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"d030f9de_5f527b8a","line":1050,"in_reply_to":"73427406_7722bb75","updated":"2025-01-08 15:17:26.000000000","message":"Okay, I see now how that variable would end up being inaccurate in many cases. It\u0027s worth noting that it means that depending on when the call to the REST API is made, the REST API result is also susceptible to this issue.\n\nHow about providing instead a \"autohold_id_matches\" variable that would be a list of autoholds (their ids) that *could potentially* trigger for the current build?\n\nThis would spare our users a call to the REST API with a reasonable trade-off. The users are expected to be disciplined enough that it can be assumed from \"autohold_id_matches\" not being empty, that the job will hold eventually if the right conditions are fulfilled (failure for now, systematically eventually in the future). With a precise enough ref filter, a large enough autohold max value, and control over what jobs are being run concurrently, this can be achieved.\n\nWould that work for you?","commit_id":"564289b5be0349d6ff76d7edb3c6da17288536ce"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"5eb7f3e07a553dcba891710f5998a426460c5cf1","unresolved":true,"context_lines":[{"line_number":1047,"context_line":""},{"line_number":1048,"context_line":"   .. var:: autohold_if_failure"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"      True if this job will trigger a autohold of its nodes on failure."},{"line_number":1051,"context_line":""},{"line_number":1052,"context_line":"   .. var:: build"},{"line_number":1053,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"73427406_7722bb75","line":1050,"in_reply_to":"be4bfd9d_27d5d680","updated":"2025-01-07 18:41:17.000000000","message":"Matthieu mentioned that they currently use the API to achieve this result.  Doing that is more reliable than this variable for the reason you mention.\n\nIn addition to the example Clark cited, there\u0027s also meeting the autohold max.  We might start 10 jobs that fail and hold 1.\n\nAlso, it\u0027s very much expected that we may autohold on non-failure states in the future; adding this variable now with this name makes future changes ambiguous if we autohold on success.\n\nThis idea is problematic, and I\u0027m not enthusiastic about it.  I would prefer you explore other approaches.","commit_id":"564289b5be0349d6ff76d7edb3c6da17288536ce"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"6595988615d56dd7c0d49fd0a8f707ef95bcf0f1","unresolved":true,"context_lines":[{"line_number":1048,"context_line":"   .. var:: autohold_matches"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"      A list of IDs of autohold requests that match the current build. Note that"},{"line_number":1051,"context_line":"      this doesn\u0027t guarantee that an autohold will be triggered under the right"},{"line_number":1052,"context_line":"      circumstances, as this variable is evaluated at build startup, whereas the"},{"line_number":1053,"context_line":"      actual autohold is handled at the end of the build. Enough time might have"},{"line_number":1054,"context_line":"      passed for an autohold request to have expired or been used up by a different"}],"source_content_type":"text/x-rst","patch_set":12,"id":"9836ccd5_20fae409","line":1051,"updated":"2025-01-17 14:58:27.000000000","message":"That makes it hard for a job to do something accurately. In the changelog you indicate that this can be used to setup a debug environment, so could this setup be performed when the hold is actually happening? Perhaps this could be an extra playbook that the executor would perform before handing over the held node?","commit_id":"e6c71c20728ca4a557c4c0e3f43881305886794a"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"7686250b864db35d81c4dcb00f110127b2eeb4a8","unresolved":true,"context_lines":[{"line_number":1048,"context_line":"   .. var:: autohold_matches"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"      A list of IDs of autohold requests that match the current build. Note that"},{"line_number":1051,"context_line":"      this doesn\u0027t guarantee that an autohold will be triggered under the right"},{"line_number":1052,"context_line":"      circumstances, as this variable is evaluated at build startup, whereas the"},{"line_number":1053,"context_line":"      actual autohold is handled at the end of the build. Enough time might have"},{"line_number":1054,"context_line":"      passed for an autohold request to have expired or been used up by a different"}],"source_content_type":"text/x-rst","patch_set":12,"id":"55aa0be3_859417bb","line":1051,"in_reply_to":"9836ccd5_20fae409","updated":"2025-01-17 19:42:44.000000000","message":"The issue is that the check is done by the executor after the playbook\u0027s execution (it\u0027s in the completeBuild method). So there are two ways we could ensure accuracy:\n\n1. Add some kind of lock on an autohold request at the beginning of a build, ensuring that the build will consume that autohold if it needs to be held\n2. Add a job property defining a playbook to run after the post playbook, in case a autohold triggers.\n\nI think 2 is much harder to implement and would probably require a spec first. 1 is not trivial and would change the behavior of autoholds a bit (all the autoholds might get locked on passing builds and prevent failures to be held).\n\nFor the issue I\u0027d like to solve, knowing the job might autohold (and doing so from the playbook instead of querying the REST API) is good enough.","commit_id":"e6c71c20728ca4a557c4c0e3f43881305886794a"}],"zuul/executor/server.py":[{"author":{"_account_id":27582,"name":"Simon Westphahl","email":"simon.westphahl@bmw.de","username":"simon.westphahl"},"change_message_id":"0554d88202c222151948237afa5403777e17e661","unresolved":true,"context_lines":[{"line_number":2803,"context_line":""},{"line_number":2804,"context_line":"        # Add autohold info"},{"line_number":2805,"context_line":"        autohold_if_failure \u003d ("},{"line_number":2806,"context_line":"            self.executor_server._getAutoholdRequest(args) is not None"},{"line_number":2807,"context_line":"        )"},{"line_number":2808,"context_line":"        zuul_vars[\u0027autohold_if_failure\u0027] \u003d autohold_if_failure"},{"line_number":2809,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ec117800_442c0102","line":2806,"updated":"2024-12-20 06:11:42.000000000","message":"I think this should be in a try/except block. We currently don\u0027t validate autohold requests properly. E.g. it\u0027s possible to add a autohold with an invalid regex which would make all builds fail.","commit_id":"7d78db3b5271292032d089e1618ad115596622cf"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"3f2dab4a855d00494fd29ad4e0d6ac1ec2e7f03e","unresolved":false,"context_lines":[{"line_number":2803,"context_line":""},{"line_number":2804,"context_line":"        # Add autohold info"},{"line_number":2805,"context_line":"        autohold_if_failure \u003d ("},{"line_number":2806,"context_line":"            self.executor_server._getAutoholdRequest(args) is not None"},{"line_number":2807,"context_line":"        )"},{"line_number":2808,"context_line":"        zuul_vars[\u0027autohold_if_failure\u0027] \u003d autohold_if_failure"},{"line_number":2809,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7c089c3f_1752cb68","line":2806,"in_reply_to":"ec117800_442c0102","updated":"2024-12-20 12:04:45.000000000","message":"Done\n\nI\u0027ll provide a followup to perform a basic verification in the REST API.","commit_id":"7d78db3b5271292032d089e1618ad115596622cf"}]}
