)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"f1db9c02ef4fcc6abd853cdd121364edbaf4a4b9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"1d719ae9_1cd0ca06","updated":"2022-02-16 23:55:33.000000000","message":"For reference, \n\nhttps://paste.opendev.org/show/bz0PcBh3lo8EE88XRRwD/\n\nis the full exception we saw from this error","commit_id":"97ae09d4c75bc8f0a209af1d463c5d7f899ae8d8"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"3726f13b52fe558beec144e8511c2db37b691b6f","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"089e6246_53b7ecf7","updated":"2022-02-17 06:36:04.000000000","message":"\u003e Patch Set 2: Code-Review-1\n\u003e \n\u003e This looks good, but it would be good to have a test for this.\n\u003e \n\u003e I think this process should work:\n\u003e * hold jobs in queue\n\u003e * create a branch\n\u003e * open a fake PR\n\u003e * release jobs\n\u003e * wait to settle\n\u003e * delete branch from upstream repo\n\u003e * release jobs\n\u003e \n\u003e Then check that we get the desired outcome.\n\nI\u0027ve tried to implement that with https://review.opendev.org/c/zuul/zuul/+/829617/3/tests/unit/test_cross_crd.py but it is not failing, and I think I\u0027m misunderstanding how to do this.\n\nI\u0027ll need a little more help to get that going because I\u0027m at about the extent of my knowledge on how the merging, scheduling and unit-tests all come together here","commit_id":"b46f449a60f28fcd7b5fa7e5d203f43660b1488b"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"41ce1479c567f5b049c080a7798745aeab8131b0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"928d0a00_67232c29","updated":"2022-02-18 00:17:48.000000000","message":"\u003e Patch Set 2: Code-Review-1\n\u003e \n\u003e This looks good, but it would be good to have a test for this.\n\u003e \n\u003e I think this process should work:\n\u003e * hold jobs in queue\n\u003e * create a branch\n\u003e * open a fake PR\n\u003e * release jobs\n\u003e * wait to settle\n\u003e * delete branch from upstream repo\n\u003e * release jobs\n\u003e \n\u003e Then check that we get the desired outcome.\n\nI\u0027ve split this into https://review.opendev.org/c/zuul/zuul/+/829842 , but it\u0027s not yet working","commit_id":"bbb6bcb0069172ca2513f2f375d35cad59968640"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"e8aaaed7c0c2558d0a26dff49787236a28021ccc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"f563d8fb_bd37b810","updated":"2022-02-18 00:29:57.000000000","message":"This looks right to me but not +2 until I\u0027m out of ideas for the test.","commit_id":"5d62adc5a401dc29c274bc6a31edad0ce3d23f3c"}],"tests/unit/test_cross_crd.py":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"5629e25f0cea48fe632dff16d02f29053bed807c","unresolved":true,"context_lines":[{"line_number":283,"context_line":"        # Create a branch in the upstream github project"},{"line_number":284,"context_line":"        github \u003d self.fake_github.getGithubClient()"},{"line_number":285,"context_line":"        repo \u003d github.repo_from_project(\u0027github/project2\u0027)"},{"line_number":286,"context_line":"        repo._create_branch(\u0027pull-request-branch\u0027)"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"        A \u003d self.fake_gerrit.addFakeChange(\u0027gerrit/project1\u0027, \u0027master\u0027, \u0027A\u0027)"},{"line_number":289,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"35470432_fdd72911","line":286,"updated":"2022-02-17 17:21:17.000000000","message":"This _create_branch() method and the _delete_branch() method below seem to only operate on a github api level and not a git repo level. There are no objects with shas created from what I can tell which is part of the reason why this test fails as is.\n\nThe other reason (which may be related to the above issue) is that repo_state is empty when merging:\n\n\u003e 2022-02-17 07:01:31,440 zuul.MergeClient                 DEBUG    [e: 548e182f1ea3466f9cef6d02369c2aa3] Submitting job 4bf09d50d04a4626b8680266042770e7 with data {\u0027items\u0027: [{\u0027project\u0027: \u0027github/project2\u0027, \u0027connection\u0027: \u0027github\u0027, \u0027merge_mode\u0027: 2, \u0027ref\u0027: \u0027refs/pull/1/head\u0027, \u0027branch\u0027: \u0027master\u0027, \u0027buildset_uuid\u0027: \u002723fe2bb1ffa247ba911b3261025cd081\u0027, \u0027number\u0027: 1, \u0027patchset\u0027: \u0027c18b757348272bb5b4d73ddf60b53a598fb03d83\u0027, \u0027oldrev\u0027: None, \u0027newrev\u0027: None}, {\u0027project\u0027: \u0027gerrit/project1\u0027, \u0027connection\u0027: \u0027gerrit\u0027, \u0027merge_mode\u0027: 2, \u0027ref\u0027: \u0027refs/changes/01/1/1\u0027, \u0027branch\u0027: \u0027master\u0027, \u0027buildset_uuid\u0027: \u0027937f5e64e0664cae9cca7c888b42d9ec\u0027, \u0027number\u0027: \u00271\u0027, \u0027patchset\u0027: \u00271\u0027, \u0027oldrev\u0027: None, \u0027newrev\u0027: None}], \u0027files\u0027: [\u0027zuul.yaml\u0027, \u0027.zuul.yaml\u0027], \u0027dirs\u0027: [\u0027zuul.d\u0027, \u0027.zuul.d\u0027], \u0027repo_state\u0027: None, \u0027branches\u0027: None}\n\nThe repo_state not being none is how we tripped this before. We need that to contain the branch that is being deleted so that it tries to configure that branch on the repo to the sha that is no longer valid.","commit_id":"b46f449a60f28fcd7b5fa7e5d203f43660b1488b"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"b23a33d30d2cee22092509d1d986367ac39f8591","unresolved":true,"context_lines":[{"line_number":283,"context_line":"        # Create a branch in the upstream github project"},{"line_number":284,"context_line":"        github \u003d self.fake_github.getGithubClient()"},{"line_number":285,"context_line":"        repo \u003d github.repo_from_project(\u0027github/project2\u0027)"},{"line_number":286,"context_line":"        repo._create_branch(\u0027pull-request-branch\u0027)"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"        A \u003d self.fake_gerrit.addFakeChange(\u0027gerrit/project1\u0027, \u0027master\u0027, \u0027A\u0027)"},{"line_number":289,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8496d9_f2e45f74","line":286,"in_reply_to":"2a575ac8_20c5e0ba","updated":"2022-02-18 00:16:32.000000000","message":"This is a good insight, and I\u0027ve used create_branch() and that actually creates the branch.\n\nI had the thought that deleting the branch isn\u0027t enough, because the object could still be there.  So I added a purge_branch that forces cleanup.  But it\u0027s still not being referenced as I thought it would.\n\nI\u0027ve split it into https://review.opendev.org/c/zuul/zuul/+/829842 with related info in the CL; if there\u0027s interest in collaborating we can look at it there but so far I\u0027m lost on how to get the merger into this path.","commit_id":"b46f449a60f28fcd7b5fa7e5d203f43660b1488b"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"8c6818f63b165e881d082a485c565a2f55245ec0","unresolved":true,"context_lines":[{"line_number":283,"context_line":"        # Create a branch in the upstream github project"},{"line_number":284,"context_line":"        github \u003d self.fake_github.getGithubClient()"},{"line_number":285,"context_line":"        repo \u003d github.repo_from_project(\u0027github/project2\u0027)"},{"line_number":286,"context_line":"        repo._create_branch(\u0027pull-request-branch\u0027)"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"        A \u003d self.fake_gerrit.addFakeChange(\u0027gerrit/project1\u0027, \u0027master\u0027, \u0027A\u0027)"},{"line_number":289,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"2a575ac8_20c5e0ba","line":286,"in_reply_to":"35470432_fdd72911","updated":"2022-02-17 17:32:12.000000000","message":"I suspect that ZuulTestCase\u0027s create_branch() and delete_branch() may impart the necessary repository state for this. I\u0027m not sure if that will impact the repo_state value that is passed to the merger though. It may if it depends on the branches actually existing in the repository and not just in the API.","commit_id":"b46f449a60f28fcd7b5fa7e5d203f43660b1488b"}],"zuul/executor/server.py":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"99e05f41feaa0ba70c7ad1acc1e41bfebaeb1e36","unresolved":false,"context_lines":[{"line_number":1412,"context_line":"                # just log something generic and put the traceback in"},{"line_number":1413,"context_line":"                # the logs."},{"line_number":1414,"context_line":"                self.log.exception(e)"},{"line_number":1415,"context_line":"                raise ExecutorError(\"Error merging repo state.\")"},{"line_number":1416,"context_line":""},{"line_number":1417,"context_line":"        # Early abort if abort requested"},{"line_number":1418,"context_line":"        if self.aborted:"}],"source_content_type":"text/x-python","patch_set":2,"id":"d7289e57_c2dcea2e","line":1415,"updated":"2022-02-17 00:54:29.000000000","message":"This could be f\"Error setting repo state for {project[\u0027name\u0027]}\"","commit_id":"c428dfc916076780a598cff12d214ad5483edb06"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"cb8e0ca3129cdf0f50414d9b1d927af982361837","unresolved":false,"context_lines":[{"line_number":1412,"context_line":"                # just log something generic and put the traceback in"},{"line_number":1413,"context_line":"                # the logs."},{"line_number":1414,"context_line":"                self.log.exception(e)"},{"line_number":1415,"context_line":"                raise ExecutorError(\"Error merging repo state.\")"},{"line_number":1416,"context_line":""},{"line_number":1417,"context_line":"        # Early abort if abort requested"},{"line_number":1418,"context_line":"        if self.aborted:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3d21e318_5825c850","line":1415,"in_reply_to":"d7289e57_c2dcea2e","updated":"2022-02-17 00:56:52.000000000","message":"Done","commit_id":"c428dfc916076780a598cff12d214ad5483edb06"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"e8aaaed7c0c2558d0a26dff49787236a28021ccc","unresolved":true,"context_lines":[{"line_number":1411,"context_line":"                # since we\u0027re not 100% sure what is in this traceback,"},{"line_number":1412,"context_line":"                # just log something generic and put the traceback in"},{"line_number":1413,"context_line":"                # the logs."},{"line_number":1414,"context_line":"                self.log.exception(e)"},{"line_number":1415,"context_line":"                raise ExecutorError("},{"line_number":1416,"context_line":"                    f\"Error setting repo state for {project[\u0027name\u0027]}\")"},{"line_number":1417,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"83b49cbc_845daa9f","line":1414,"updated":"2022-02-18 00:29:57.000000000","message":"The log.exception method will log the traceback and the exception. I guess what the comment is trying to say is we don\u0027t let that return to the end user in the code review system?","commit_id":"5d62adc5a401dc29c274bc6a31edad0ce3d23f3c"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"0c3f1de6aa59c4dddf4e5de2046d9275e3543e56","unresolved":true,"context_lines":[{"line_number":1411,"context_line":"                # since we\u0027re not 100% sure what is in this traceback,"},{"line_number":1412,"context_line":"                # just log something generic and put the traceback in"},{"line_number":1413,"context_line":"                # the logs."},{"line_number":1414,"context_line":"                self.log.exception(e)"},{"line_number":1415,"context_line":"                raise ExecutorError("},{"line_number":1416,"context_line":"                    f\"Error setting repo state for {project[\u0027name\u0027]}\")"},{"line_number":1417,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"be6b6c63_c1ca0fef","line":1414,"in_reply_to":"83b49cbc_845daa9f","updated":"2022-02-18 00:36:07.000000000","message":"Yes, I think the concern was that we might have usernames/passwords appearing in connection strings.","commit_id":"5d62adc5a401dc29c274bc6a31edad0ce3d23f3c"}],"zuul/merger/merger.py":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"5629e25f0cea48fe632dff16d02f29053bed807c","unresolved":true,"context_lines":[{"line_number":463,"context_line":"            # github projects use a rebase model for pull requests and"},{"line_number":464,"context_line":"            # then delete the PR branch."},{"line_number":465,"context_line":"            raise MissingObjectException("},{"line_number":466,"context_line":"                \u0027Object %s disappeared for reference %s.  This is likely \u0027"},{"line_number":467,"context_line":"                \u0027due to upstream branch removal.  Consider excluding branches \u0027"},{"line_number":468,"context_line":"                \u0027that may be removed, such as pull-requests.\u0027 %"},{"line_number":469,"context_line":"                (hexsha, repo.git_dir))"}],"source_content_type":"text/x-python","patch_set":3,"id":"eeb7f246_b3dfa194","line":466,"range":{"start_line":466,"start_character":43,"end_line":466,"end_character":52},"updated":"2022-02-17 17:21:17.000000000","message":"Should this be \u0027repo\u0027 ?","commit_id":"b46f449a60f28fcd7b5fa7e5d203f43660b1488b"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"b23a33d30d2cee22092509d1d986367ac39f8591","unresolved":false,"context_lines":[{"line_number":463,"context_line":"            # github projects use a rebase model for pull requests and"},{"line_number":464,"context_line":"            # then delete the PR branch."},{"line_number":465,"context_line":"            raise MissingObjectException("},{"line_number":466,"context_line":"                \u0027Object %s disappeared for reference %s.  This is likely \u0027"},{"line_number":467,"context_line":"                \u0027due to upstream branch removal.  Consider excluding branches \u0027"},{"line_number":468,"context_line":"                \u0027that may be removed, such as pull-requests.\u0027 %"},{"line_number":469,"context_line":"                (hexsha, repo.git_dir))"}],"source_content_type":"text/x-python","patch_set":3,"id":"71cbb2ea_8f95aa18","line":466,"range":{"start_line":466,"start_character":43,"end_line":466,"end_character":52},"in_reply_to":"eeb7f246_b3dfa194","updated":"2022-02-18 00:16:32.000000000","message":"Yep","commit_id":"b46f449a60f28fcd7b5fa7e5d203f43660b1488b"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"5629e25f0cea48fe632dff16d02f29053bed807c","unresolved":true,"context_lines":[{"line_number":467,"context_line":"                \u0027due to upstream branch removal.  Consider excluding branches \u0027"},{"line_number":468,"context_line":"                \u0027that may be removed, such as pull-requests.\u0027 %"},{"line_number":469,"context_line":"                (hexsha, repo.git_dir))"},{"line_number":470,"context_line":"        else:"},{"line_number":471,"context_line":"            git.refs.Reference.create(repo, path, obj, force\u003dTrue)"},{"line_number":472,"context_line":"            return \u0027Created reference %s at %s in %s\u0027 % ("},{"line_number":473,"context_line":"                path, hexsha, repo.git_dir)"}],"source_content_type":"text/x-python","patch_set":3,"id":"843a7322_7bc27988","line":470,"range":{"start_line":470,"start_character":8,"end_line":470,"end_character":13},"updated":"2022-02-17 17:21:17.000000000","message":"This else doesn\u0027t seem necessary as we don\u0027t fall through when the exception is raised.","commit_id":"b46f449a60f28fcd7b5fa7e5d203f43660b1488b"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"b23a33d30d2cee22092509d1d986367ac39f8591","unresolved":false,"context_lines":[{"line_number":467,"context_line":"                \u0027due to upstream branch removal.  Consider excluding branches \u0027"},{"line_number":468,"context_line":"                \u0027that may be removed, such as pull-requests.\u0027 %"},{"line_number":469,"context_line":"                (hexsha, repo.git_dir))"},{"line_number":470,"context_line":"        else:"},{"line_number":471,"context_line":"            git.refs.Reference.create(repo, path, obj, force\u003dTrue)"},{"line_number":472,"context_line":"            return \u0027Created reference %s at %s in %s\u0027 % ("},{"line_number":473,"context_line":"                path, hexsha, repo.git_dir)"}],"source_content_type":"text/x-python","patch_set":3,"id":"af01964b_9e488ce7","line":470,"range":{"start_line":470,"start_character":8,"end_line":470,"end_character":13},"in_reply_to":"843a7322_7bc27988","updated":"2022-02-18 00:16:32.000000000","message":"Done","commit_id":"b46f449a60f28fcd7b5fa7e5d203f43660b1488b"}]}
