)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7aa4b1e71a57fdc2100b2b23df976a7fac11a54b","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Anish Kachinthaya \u003cakachinthaya@nvidia.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2024-02-06 05:02:43 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"added parsing container level grace period through config and container level grace period in expirer, as well as tests"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I4f243cd0d4be0033e0967d451dc299e7b07266f0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"84cb6e95_25ad343c","line":7,"updated":"2024-02-06 17:20:23.000000000","message":"commit message subject lines should be \u003c50 chars, followed by a blank line then the body of the message","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"60ee871684a86ea8efc5dd926f5bb016b19c42fd","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Anish Kachinthaya \u003cakachinthaya@nvidia.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2024-02-06 05:02:43 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"added parsing container level grace period through config and container level grace period in expirer, as well as tests"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I4f243cd0d4be0033e0967d451dc299e7b07266f0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fe069434_34406f4a","line":7,"in_reply_to":"84cb6e95_25ad343c","updated":"2024-02-07 22:27:52.000000000","message":"Done","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Anish Kachinthaya \u003cakachinthaya@nvidia.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2024-02-07 22:18:15 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"add container level grace period"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"through config and container level grace period in expirer"},{"line_number":10,"context_line":"test for bad config"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"877cb5a3_41d74c67","line":7,"updated":"2024-02-08 13:01:27.000000000","message":"nit: prefix the subject with \u0027expirer: \u0027","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Anish Kachinthaya \u003cakachinthaya@nvidia.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2024-02-07 22:18:15 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"add container level grace period"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"through config and container level grace period in expirer"},{"line_number":10,"context_line":"test for bad config"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"a72b3ed8_faf178dc","line":7,"in_reply_to":"877cb5a3_41d74c67","updated":"2024-02-08 21:08:15.000000000","message":"Done","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":7,"context_line":"add container level grace period"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"through config and container level grace period in expirer"},{"line_number":10,"context_line":"test for bad config"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I4f243cd0d4be0033e0967d451dc299e7b07266f0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"135a296d_336f2f9c","line":10,"updated":"2024-02-08 13:01:27.000000000","message":"I\u0027m struggling to parse this paragraph - is it two \"bullet\" points? Perhaps you could expand the text a little.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":7,"context_line":"add container level grace period"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"through config and container level grace period in expirer"},{"line_number":10,"context_line":"test for bad config"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I4f243cd0d4be0033e0967d451dc299e7b07266f0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"a246022a_d855d841","line":10,"in_reply_to":"135a296d_336f2f9c","updated":"2024-02-08 21:08:15.000000000","message":"This was combined from some previous commits, fixed it up.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7aa4b1e71a57fdc2100b2b23df976a7fac11a54b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0dd1b819_9d90db2f","updated":"2024-02-06 17:20:23.000000000","message":"@Anish congrats on pushing your first patchset 😊\n\nMy comments so far are trivial based on just a quick scan.","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"5e762ac6d0c477c387c665f1716ead985acbb663","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"afa1edc2_04403846","updated":"2024-02-06 22:44:20.000000000","message":"i think we can do better on mal-formed config values:\n\n908206: test for bad config | https://review.opendev.org/c/openstack/swift/+/908206\n\ni.e. explode early and loudly (rather than silently doing the wrong thing)\n\n^ what do you think?\n\nmaybe more significantly, i tested it functionally and it works exactly like you\u0027d expect - kudos!\n\nI had some files set to expire at different times in different containers:\n\nexpire_AUTH_test_0 20\nexpire_AUTH_test/lots-of-files-2_0 10\nexpire_AUTH_test/lots-of-files_0 10\nexpire_AUTH_test_1 10\nexpire_AUTH_test/lots-of-files-2_1 10\nexpire_AUTH_test_2 10\nexpire_AUTH_test/lots-of-files-2_2 10\n\nI added some grace to my expirer:\n\n[object-expirer]\ngrace_period_AUTH_test \u003d 120.0\ngrace_period_AUTH_test/lots-of-files \u003d 604800\n\n... and ran it\n\nexpire_AUTH_test_0 10\nexpire_AUTH_test/lots-of-files_0 10\nexpire_AUTH_test_1 10\nexpire_AUTH_test/lots-of-files-2_1 10\nexpire_AUTH_test_2 10\nexpire_AUTH_test/lots-of-files-2_2 10\n\nthe lots-of-files-2 objects set to expire *today* (i.e. _0) got cleaned up (after their short account scoped grace period); but the lots-of-files objects live on under grace!\n\nplease address the zuul errors and give the commit message another whirl\n\nhttps://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_Git_commit_message_structure","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"831eba2f8f79f9a9888aac1682e7bfe5e04cd472","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0c8627d4_ab884006","updated":"2024-02-06 17:18:50.000000000","message":"tests, docs, code looks sound - this is great work!\n\nmaybe update the commit message:\n\nhttps://github.com/NVIDIA/swift/blob/master/REVIEW_GUIDELINES.rst#commit-messages\n\nI need to check it out and do some playing with it.","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"47e9e651_0543fe35","updated":"2024-02-08 13:01:27.000000000","message":"This is great!\n\n-1 because:\n\n- there\u0027s some bad conf values that are not caught (and since we\u0027re inviting ops to type more complex config keys we should do better at catching mistakes)\n\n- there\u0027s a bogus test assertion in an assertRaises\n\nThe rest is minor/nits","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"60ee871684a86ea8efc5dd926f5bb016b19c42fd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"8e8b6f42_d3fbf364","updated":"2024-02-07 22:27:52.000000000","message":"Updated code based on comments, fixing for pep8 and adding additional error check.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"a1007fe0_c3e6c6b0","updated":"2024-02-08 21:08:15.000000000","message":"Updated as per comments!","commit_id":"0f2121f6e29369cb741c3298ff789cc5a4e0c8bd"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"1ab934e7a55e2c93292bbc788783975ead633240","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"b89b6c4e_e6f53048","updated":"2024-02-09 18:41:31.000000000","message":"nice work @Anish","commit_id":"fa8f0ada6b9c20535cd0a7b3e5e0f0798801d2f6"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"bbfbad7aeb5938737fa824704b06053ce84a2c93","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"ca26fb64_136ba796","updated":"2024-02-09 20:33:26.000000000","message":"recheck","commit_id":"fa8f0ada6b9c20535cd0a7b3e5e0f0798801d2f6"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"579948c490acc33ce68b27ad551f30369332552d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"705de67a_e4c6060f","updated":"2024-02-09 20:36:16.000000000","message":"some of the other cleanups might be nice too; but this looks great","commit_id":"fa8f0ada6b9c20535cd0a7b3e5e0f0798801d2f6"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"f81a2f801f4819fc002bb1312b9fceca457b4724","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"1c425672_5dbc5327","updated":"2024-02-10 05:16:02.000000000","message":"updated!","commit_id":"ff244a7db50ce476bc577905b36bf5beeadedbc6"}],"etc/object-expirer.conf-sample":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7aa4b1e71a57fdc2100b2b23df976a7fac11a54b","unresolved":true,"context_lines":[{"line_number":84,"context_line":"# option names prefixed with grace_period_\u003cACCT\u003e/\u003cCNTR\u003e, e.g."},{"line_number":85,"context_line":"# grace_period_AUTH_test/test \u003d 300.0"},{"line_number":86,"context_line":"# grace_period_AUTH_test/test2 \u003d 600.0"},{"line_number":87,"context_line":"# N.B. By default no grace_period is configured for any accounts or containers."},{"line_number":88,"context_line":"#"},{"line_number":89,"context_line":"# recon_cache_path \u003d /var/cache/swift"},{"line_number":90,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"adbcee49_fdbb7e19","line":87,"updated":"2024-02-06 17:20:23.000000000","message":"I\u0027m not sure it is a strict convention but I usually expect the example key\u003dval to be the final line of the comment \"paragraph\" (i.e. move the N.B. up a couple of lines)","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"60ee871684a86ea8efc5dd926f5bb016b19c42fd","unresolved":false,"context_lines":[{"line_number":84,"context_line":"# option names prefixed with grace_period_\u003cACCT\u003e/\u003cCNTR\u003e, e.g."},{"line_number":85,"context_line":"# grace_period_AUTH_test/test \u003d 300.0"},{"line_number":86,"context_line":"# grace_period_AUTH_test/test2 \u003d 600.0"},{"line_number":87,"context_line":"# N.B. By default no grace_period is configured for any accounts or containers."},{"line_number":88,"context_line":"#"},{"line_number":89,"context_line":"# recon_cache_path \u003d /var/cache/swift"},{"line_number":90,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"2611a30a_78a21122","line":87,"in_reply_to":"adbcee49_fdbb7e19","updated":"2024-02-07 22:27:52.000000000","message":"Done","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":77,"context_line":"# After the grace_period has passed objects will be expired as normal."},{"line_number":78,"context_line":"# You may configure this grace_period in seconds with dynamic config"},{"line_number":79,"context_line":"# option names prefixed with grace_period_\u003cACCT\u003e for per-account grace periods"},{"line_number":80,"context_line":"# and grace_period_\u003cACCT\u003e/\u003cCNTR\u003e for per-container grace periods."},{"line_number":81,"context_line":"# N.B. By default no grace_period is configured for any accounts or containers."},{"line_number":82,"context_line":"# grace_period_AUTH_test \u003d 300.0"},{"line_number":83,"context_line":"# grace_period_AUTH_test2 \u003d 86400.0"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"57a26b68_95db5519","line":80,"updated":"2024-02-08 13:01:27.000000000","message":"Presumably a per-container setting overrides a per-account setting for the same account? And a per-container setting does not require a per-account setting for the same account?\n\nUpdate: I answered this for myself with this extra test https://review.opendev.org/c/openstack/swift/+/907762/comment/537b1fa0_1f275c0f/","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":77,"context_line":"# After the grace_period has passed objects will be expired as normal."},{"line_number":78,"context_line":"# You may configure this grace_period in seconds with dynamic config"},{"line_number":79,"context_line":"# option names prefixed with grace_period_\u003cACCT\u003e for per-account grace periods"},{"line_number":80,"context_line":"# and grace_period_\u003cACCT\u003e/\u003cCNTR\u003e for per-container grace periods."},{"line_number":81,"context_line":"# N.B. By default no grace_period is configured for any accounts or containers."},{"line_number":82,"context_line":"# grace_period_AUTH_test \u003d 300.0"},{"line_number":83,"context_line":"# grace_period_AUTH_test2 \u003d 86400.0"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"791ca8ab_8ad61a05","line":80,"in_reply_to":"57a26b68_95db5519","updated":"2024-02-08 21:08:15.000000000","message":"Added a clarification for this","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"1ab934e7a55e2c93292bbc788783975ead633240","unresolved":true,"context_lines":[{"line_number":79,"context_line":"# option names prefixed with grace_period_\u003cACCT\u003e for per-account grace periods"},{"line_number":80,"context_line":"# and grace_period_\u003cACCT\u003e/\u003cCNTR\u003e for per-container grace periods."},{"line_number":81,"context_line":"# A per-container grace period does not require a per-account grace period"},{"line_number":82,"context_line":"# but overrides the per-account grace period for the same account if it exists."},{"line_number":83,"context_line":"# N.B. By default no grace_period is configured for any accounts or containers."},{"line_number":84,"context_line":"# grace_period_AUTH_test \u003d 300.0"},{"line_number":85,"context_line":"# grace_period_AUTH_test2 \u003d 86400.0"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"076326a9_b19b9935","line":82,"updated":"2024-02-09 18:41:31.000000000","message":"nice","commit_id":"c819c50798c9e784c59aa0de5362d94bfd19bebf"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"f81a2f801f4819fc002bb1312b9fceca457b4724","unresolved":false,"context_lines":[{"line_number":79,"context_line":"# option names prefixed with grace_period_\u003cACCT\u003e for per-account grace periods"},{"line_number":80,"context_line":"# and grace_period_\u003cACCT\u003e/\u003cCNTR\u003e for per-container grace periods."},{"line_number":81,"context_line":"# A per-container grace period does not require a per-account grace period"},{"line_number":82,"context_line":"# but overrides the per-account grace period for the same account if it exists."},{"line_number":83,"context_line":"# N.B. By default no grace_period is configured for any accounts or containers."},{"line_number":84,"context_line":"# grace_period_AUTH_test \u003d 300.0"},{"line_number":85,"context_line":"# grace_period_AUTH_test2 \u003d 86400.0"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"963f87b7_6ee36d54","line":82,"in_reply_to":"076326a9_b19b9935","updated":"2024-02-10 05:16:02.000000000","message":"Acknowledged","commit_id":"c819c50798c9e784c59aa0de5362d94bfd19bebf"}],"swift/obj/expirer.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"831eba2f8f79f9a9888aac1682e7bfe5e04cd472","unresolved":true,"context_lines":[{"line_number":118,"context_line":"            if not conf_key.startswith(grace_period_prefix):"},{"line_number":119,"context_line":"                continue"},{"line_number":120,"context_line":"            grace_period_key \u003d conf_key[len(grace_period_prefix):]"},{"line_number":121,"context_line":"            grace_period_key_split \u003d grace_period_key.split(\"/\")"},{"line_number":122,"context_line":"            if len(grace_period_key_split) \u003d\u003d 2:"},{"line_number":123,"context_line":"                account, container \u003d grace_period_key_split"},{"line_number":124,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7cbb8e97_660606f1","line":121,"updated":"2024-02-06 17:18:50.000000000","message":"maybe more than one \u0027/\u0027 in config name should raise an error (we don\u0027t support \"prefixed\" grace_period)","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"60ee871684a86ea8efc5dd926f5bb016b19c42fd","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            if not conf_key.startswith(grace_period_prefix):"},{"line_number":119,"context_line":"                continue"},{"line_number":120,"context_line":"            grace_period_key \u003d conf_key[len(grace_period_prefix):]"},{"line_number":121,"context_line":"            grace_period_key_split \u003d grace_period_key.split(\"/\")"},{"line_number":122,"context_line":"            if len(grace_period_key_split) \u003d\u003d 2:"},{"line_number":123,"context_line":"                account, container \u003d grace_period_key_split"},{"line_number":124,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f8d3c7e_33d66cee","line":121,"in_reply_to":"7cbb8e97_660606f1","updated":"2024-02-07 22:27:52.000000000","message":"Done","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"831eba2f8f79f9a9888aac1682e7bfe5e04cd472","unresolved":true,"context_lines":[{"line_number":288,"context_line":"            try:"},{"line_number":289,"context_line":"                return self.acct_grace_periods[(target_account, None)]"},{"line_number":290,"context_line":"            except KeyError:"},{"line_number":291,"context_line":"                return 0.0"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def iter_task_to_expire(self, task_account_container_list,"},{"line_number":294,"context_line":"                            my_index, divisor):"}],"source_content_type":"text/x-python","patch_set":1,"id":"e2d24dbb_f10fd71a","line":291,"updated":"2024-02-06 17:18:50.000000000","message":"this looks like the right order of precedence; I think i saw some tests for this too - KUDOS","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"60ee871684a86ea8efc5dd926f5bb016b19c42fd","unresolved":false,"context_lines":[{"line_number":288,"context_line":"            try:"},{"line_number":289,"context_line":"                return self.acct_grace_periods[(target_account, None)]"},{"line_number":290,"context_line":"            except KeyError:"},{"line_number":291,"context_line":"                return 0.0"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def iter_task_to_expire(self, task_account_container_list,"},{"line_number":294,"context_line":"                            my_index, divisor):"}],"source_content_type":"text/x-python","patch_set":1,"id":"215a5d3e_2dfdb9ed","line":291,"in_reply_to":"e2d24dbb_f10fd71a","updated":"2024-02-07 22:27:52.000000000","message":"Acknowledged","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7aa4b1e71a57fdc2100b2b23df976a7fac11a54b","unresolved":true,"context_lines":[{"line_number":311,"context_line":"                    self.logger.exception(\u0027Unexcepted error handling task %r\u0027 %"},{"line_number":312,"context_line":"                                          task_object)"},{"line_number":313,"context_line":"                    continue"},{"line_number":314,"context_line":"                grace_period \u003d self.get_grace_period(target_account, target_container)"},{"line_number":315,"context_line":"                cutoff \u003d time() - grace_period"},{"line_number":316,"context_line":"                if delete_timestamp \u003e Timestamp(cutoff):"},{"line_number":317,"context_line":"                    if grace_period:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5dc4a181_ff0045b6","line":314,"updated":"2024-02-06 17:20:23.000000000","message":"pep8 will ding you for over-length line 😞","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"60ee871684a86ea8efc5dd926f5bb016b19c42fd","unresolved":false,"context_lines":[{"line_number":311,"context_line":"                    self.logger.exception(\u0027Unexcepted error handling task %r\u0027 %"},{"line_number":312,"context_line":"                                          task_object)"},{"line_number":313,"context_line":"                    continue"},{"line_number":314,"context_line":"                grace_period \u003d self.get_grace_period(target_account, target_container)"},{"line_number":315,"context_line":"                cutoff \u003d time() - grace_period"},{"line_number":316,"context_line":"                if delete_timestamp \u003e Timestamp(cutoff):"},{"line_number":317,"context_line":"                    if grace_period:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9224a818_e36f9f37","line":314,"in_reply_to":"5dc4a181_ff0045b6","updated":"2024-02-07 22:27:52.000000000","message":"Done","commit_id":"5cc1216dd273737ab7c8a08c68d8b44bb639b9e3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":112,"context_line":"        # marker will be retried before it is abandoned.  It is not coupled"},{"line_number":113,"context_line":"        # with the tombstone reclaim age in the consistency engine."},{"line_number":114,"context_line":"        self.reclaim_age \u003d int(conf.get(\u0027reclaim_age\u0027, 604800))"},{"line_number":115,"context_line":"        self.acct_grace_periods \u003d {}"},{"line_number":116,"context_line":"        for conf_key in conf:"},{"line_number":117,"context_line":"            grace_period_prefix \u003d \"grace_period_\""},{"line_number":118,"context_line":"            if not conf_key.startswith(grace_period_prefix):"}],"source_content_type":"text/x-python","patch_set":2,"id":"b863f10c_6f9decbc","line":115,"range":{"start_line":115,"start_character":13,"end_line":115,"end_character":31},"updated":"2024-02-08 13:01:27.000000000","message":"this could be renamed to just \"grace_periods\" since it is no longer specifically per-account.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        # marker will be retried before it is abandoned.  It is not coupled"},{"line_number":113,"context_line":"        # with the tombstone reclaim age in the consistency engine."},{"line_number":114,"context_line":"        self.reclaim_age \u003d int(conf.get(\u0027reclaim_age\u0027, 604800))"},{"line_number":115,"context_line":"        self.acct_grace_periods \u003d {}"},{"line_number":116,"context_line":"        for conf_key in conf:"},{"line_number":117,"context_line":"            grace_period_prefix \u003d \"grace_period_\""},{"line_number":118,"context_line":"            if not conf_key.startswith(grace_period_prefix):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9da71fd2_2d18affa","line":115,"range":{"start_line":115,"start_character":13,"end_line":115,"end_character":31},"in_reply_to":"b863f10c_6f9decbc","updated":"2024-02-08 21:08:15.000000000","message":"Good point, updated","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":118,"context_line":"            if not conf_key.startswith(grace_period_prefix):"},{"line_number":119,"context_line":"                continue"},{"line_number":120,"context_line":"            grace_period_key \u003d conf_key[len(grace_period_prefix):]"},{"line_number":121,"context_line":"            grace_period_key_split \u003d grace_period_key.split(\"/\")"},{"line_number":122,"context_line":"            if len(grace_period_key_split) \u003d\u003d 2:"},{"line_number":123,"context_line":"                account, container \u003d grace_period_key_split"},{"line_number":124,"context_line":"            elif len(grace_period_key_split) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":2,"id":"41c8f815_07df8f67","line":121,"updated":"2024-02-08 13:01:27.000000000","message":"nit: \n\n(we use \u0027nit\u0027 to indicate that the comment is not a blocker, what you have is ok, but you might consider a change)\n\nThere is a split_path function in swift/common/utils.py that might be useful. It returns a variable length list of the parts e.g. [\u0027a\u0027] or [\u0027a\u0027, \u0027c\u0027].\n\nso you could have:\n\n```\ntry:\n    key \u003d tuple(split_path(conf_key[len(grace_period_prefix):], 1, 2))\nexcept ValueError:\n    # etc...\n...\nself.acct_grace_periods[key] \u003d gp\n```","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            if not conf_key.startswith(grace_period_prefix):"},{"line_number":119,"context_line":"                continue"},{"line_number":120,"context_line":"            grace_period_key \u003d conf_key[len(grace_period_prefix):]"},{"line_number":121,"context_line":"            grace_period_key_split \u003d grace_period_key.split(\"/\")"},{"line_number":122,"context_line":"            if len(grace_period_key_split) \u003d\u003d 2:"},{"line_number":123,"context_line":"                account, container \u003d grace_period_key_split"},{"line_number":124,"context_line":"            elif len(grace_period_key_split) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":2,"id":"159dd008_c4bdb1f3","line":121,"in_reply_to":"41c8f815_07df8f67","updated":"2024-02-08 21:08:15.000000000","message":"Ended up using this function since it made the code a little cleaner.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":127,"context_line":"                raise ValueError("},{"line_number":128,"context_line":"                    \u0027%s \u0027"},{"line_number":129,"context_line":"                    \u0027should be in the form grace_period_\u003caccount\u003e/\u003ccontainer\u003e \u0027"},{"line_number":130,"context_line":"                    \u0027(only one \"/\" is allowed)\u0027 % conf_key)"},{"line_number":131,"context_line":"            gp \u003d None"},{"line_number":132,"context_line":"            try:"},{"line_number":133,"context_line":"                gp \u003d float(conf.get(conf_key))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3b2d9b05_39ade62b","line":130,"range":{"start_line":130,"start_character":22,"end_line":130,"end_character":46},"updated":"2024-02-08 13:01:27.000000000","message":"what if \u0027/\u0027 is at the start or end of the string?\n\nIMHO \"should be in the form grace_period_\u003caccount\u003e/\u003ccontainer\u003e\" is already great and you could drop \"(only one \"/\" is allowed)\".\n\nBut we should consider how the leading/trailing \u0027/\u0027 cases are handled:\n\n```\n\u0027/a\u0027.split(\u0027/\u0027)\n[\u0027\u0027, \u0027a\u0027]\n\u0027a/\u0027.split(\u0027/\u0027)\n[\u0027a\u0027, \u0027\u0027]\n```\n\n...oops!\n\n\nYou might want to do a grace_period_key.strip(\u0027/\u0027) or rstrip(\u0027/\u0027) - and also decide how tolerant you want to be to leading or trailing \u0027/\u0027s. I can\u0027t imagine an SRE deliberately typing `grace_period_/AUTH_test/test` but I can perhaps imagine `grace_period_AUTH_test/test/`.\n\nTo be completely intolerant (probably what I\u0027d choose to do) you could do something like:\n\nif key.strip(\u0027/\u0027) !\u003d key:\n    raise ValueError()\nkey \u003d tuple(split_path(\u0027/\u0027 + key, 1, 2)))\n\nUsing split_path alone seems to be (maybe too) tolerant of trailing \u0027/\u0027\n\n```\nkey \u003d \u0027a\u0027; print(u.split_path(\u0027/\u0027 + key.rstrip(\u0027/\u0027),1,2))\n[\u0027a\u0027, None]\nkey \u003d \u0027a/\u0027; print(u.split_path(\u0027/\u0027 + key.rstrip(\u0027/\u0027),1,2))\n[\u0027a\u0027, None]\nkey \u003d \u0027a//\u0027; print(u.split_path(\u0027/\u0027 + key.rstrip(\u0027/\u0027),1,2))\n[\u0027a\u0027, None]\nkey \u003d \u0027a///\u0027; print(u.split_path(\u0027/\u0027 + key.rstrip(\u0027/\u0027),1,2))\n[\u0027a\u0027, None]\nkey \u003d \u0027a/c\u0027; print(u.split_path(\u0027/\u0027 + key.rstrip(\u0027/\u0027),1,2))\n[\u0027a\u0027, \u0027c\u0027]\nkey \u003d \u0027a/c/\u0027; print(u.split_path(\u0027/\u0027 + key.rstrip(\u0027/\u0027),1,2))\n[\u0027a\u0027, \u0027c\u0027]\n\nkey \u003d \u0027/a\u0027; print(u.split_path(\u0027/\u0027 + key.rstrip(\u0027/\u0027),1,2))\nTraceback (most recent call last):\n  File \"/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py\", line 364, in runcode\n    coro \u003d func()\n  File \"\u003cinput\u003e\", line 1, in \u003cmodule\u003e\n  File \"/Users/acoles/0dev/openstack/swift/swift/common/utils/__init__.py\", line 1184, in split_path\n    raise ValueError(\u0027Invalid path: %s\u0027 % quote(path))\nValueError: Invalid path: //a\n\n```","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                raise ValueError("},{"line_number":128,"context_line":"                    \u0027%s \u0027"},{"line_number":129,"context_line":"                    \u0027should be in the form grace_period_\u003caccount\u003e/\u003ccontainer\u003e \u0027"},{"line_number":130,"context_line":"                    \u0027(only one \"/\" is allowed)\u0027 % conf_key)"},{"line_number":131,"context_line":"            gp \u003d None"},{"line_number":132,"context_line":"            try:"},{"line_number":133,"context_line":"                gp \u003d float(conf.get(conf_key))"}],"source_content_type":"text/x-python","patch_set":2,"id":"dad5c527_bf96abfe","line":130,"range":{"start_line":130,"start_character":22,"end_line":130,"end_character":46},"in_reply_to":"3b2d9b05_39ade62b","updated":"2024-02-08 21:08:15.000000000","message":"Sounds good. I ended up using split_path since it requires less code and throws an error if the path is invalid. I added an assertion to check for leading or trailing \u0027/\u0027s so that I could catch both of these scenarios with one error.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":137,"context_line":"                raise ValueError("},{"line_number":138,"context_line":"                    \u0027%s must be a float \u0027"},{"line_number":139,"context_line":"                    \u0027greater than or equal to 0\u0027 % conf_key)"},{"line_number":140,"context_line":"            self.acct_grace_periods[(account, container)] \u003d gp"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def read_conf_for_queue_access(self, swift):"},{"line_number":143,"context_line":"        if self.conf.get(\u0027auto_create_account_prefix\u0027):"}],"source_content_type":"text/x-python","patch_set":2,"id":"29178665_46fd9452","line":140,"updated":"2024-02-08 13:01:27.000000000","message":"Might be worth breaking this ~25 lines out to a helper method following the pattern read_conf_for_queue_access i.e. read_conf_for_grace_periods.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                raise ValueError("},{"line_number":138,"context_line":"                    \u0027%s must be a float \u0027"},{"line_number":139,"context_line":"                    \u0027greater than or equal to 0\u0027 % conf_key)"},{"line_number":140,"context_line":"            self.acct_grace_periods[(account, container)] \u003d gp"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def read_conf_for_queue_access(self, swift):"},{"line_number":143,"context_line":"        if self.conf.get(\u0027auto_create_account_prefix\u0027):"}],"source_content_type":"text/x-python","patch_set":2,"id":"032b2bea_44c06f20","line":140,"in_reply_to":"29178665_46fd9452","updated":"2024-02-08 21:08:15.000000000","message":"Agreed, that would be much cleaner. Made the change.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"1ab934e7a55e2c93292bbc788783975ead633240","unresolved":true,"context_lines":[{"line_number":116,"context_line":"        self.read_conf_for_grace_periods()"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def read_conf_for_grace_periods(self):"},{"line_number":119,"context_line":"        self.grace_periods \u003d {}"},{"line_number":120,"context_line":"        for conf_key in self.conf:"},{"line_number":121,"context_line":"            grace_period_prefix \u003d \"grace_period_\""},{"line_number":122,"context_line":"            if not conf_key.startswith(grace_period_prefix):"}],"source_content_type":"text/x-python","patch_set":4,"id":"08047d3e_9a24af53","line":119,"updated":"2024-02-09 18:41:31.000000000","message":"nit: \n\nmy IDE complains ``Instance attribute grace_periods defined outside __init__`` ... and it does similar in ``read_conf_for_queue_access`` and many other places in the repo, so you\u0027re not doing anything unusual, but in this case it would be possible to return a grace_periods dict and have the caller set it in ``__init__``\n\n```\nself.grace_periods \u003d read_conf_for_grace_periods()\n```\n\nThat makes it more explicit what attributes the object has and what the effect of read_conf_for_grace_periods() is on the object\u0027s state.","commit_id":"c819c50798c9e784c59aa0de5362d94bfd19bebf"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"f81a2f801f4819fc002bb1312b9fceca457b4724","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        self.read_conf_for_grace_periods()"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def read_conf_for_grace_periods(self):"},{"line_number":119,"context_line":"        self.grace_periods \u003d {}"},{"line_number":120,"context_line":"        for conf_key in self.conf:"},{"line_number":121,"context_line":"            grace_period_prefix \u003d \"grace_period_\""},{"line_number":122,"context_line":"            if not conf_key.startswith(grace_period_prefix):"}],"source_content_type":"text/x-python","patch_set":4,"id":"c8f7e22d_505bb8f6","line":119,"in_reply_to":"08047d3e_9a24af53","updated":"2024-02-10 05:16:02.000000000","message":"Gotcha, this makes sense -- just updated.","commit_id":"c819c50798c9e784c59aa0de5362d94bfd19bebf"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"579948c490acc33ce68b27ad551f30369332552d","unresolved":true,"context_lines":[{"line_number":116,"context_line":"        self.read_conf_for_grace_periods()"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def read_conf_for_grace_periods(self):"},{"line_number":119,"context_line":"        self.grace_periods \u003d {}"},{"line_number":120,"context_line":"        for conf_key in self.conf:"},{"line_number":121,"context_line":"            grace_period_prefix \u003d \"grace_period_\""},{"line_number":122,"context_line":"            if not conf_key.startswith(grace_period_prefix):"}],"source_content_type":"text/x-python","patch_set":4,"id":"f1ab7d64_7752abaf","line":119,"in_reply_to":"08047d3e_9a24af53","updated":"2024-02-09 20:36:16.000000000","message":"self.grace_period \u003d read_conf_for_grace_periods(self.conf)\n\nwould be ideal - i want to re-use this function in a an out of tree tool that doesn\u0027t need an instance of ObjectExpirer","commit_id":"c819c50798c9e784c59aa0de5362d94bfd19bebf"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"1ab934e7a55e2c93292bbc788783975ead633240","unresolved":true,"context_lines":[{"line_number":140,"context_line":"                    \u0027should be in the form grace_period_\u003caccount\u003e \u0027"},{"line_number":141,"context_line":"                    \u0027or grace_period_\u003caccount\u003e/\u003ccontainer\u003e \u0027"},{"line_number":142,"context_line":"                    \u0027(at most one \"/\" is allowed)\u0027 % conf_key)"},{"line_number":143,"context_line":"            account, container \u003d grace_period_key_split"},{"line_number":144,"context_line":"            gp \u003d None"},{"line_number":145,"context_line":"            try:"},{"line_number":146,"context_line":"                gp \u003d float(self.conf.get(conf_key))"}],"source_content_type":"text/x-python","patch_set":4,"id":"a4ce54ca_6219a1e8","line":143,"updated":"2024-02-09 18:41:31.000000000","message":"nit: \n\nit\u0027s not necessary to unpack the tuple, you could have \n```self.grace_periods[grace_period_key_split] \u003d gp```\n\nThat said, my preference would be to write \n\n```\naccount, container \u003d split_path(...\n```\n\nat line 134 and not use grace_period_key_split","commit_id":"c819c50798c9e784c59aa0de5362d94bfd19bebf"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"f81a2f801f4819fc002bb1312b9fceca457b4724","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                    \u0027should be in the form grace_period_\u003caccount\u003e \u0027"},{"line_number":141,"context_line":"                    \u0027or grace_period_\u003caccount\u003e/\u003ccontainer\u003e \u0027"},{"line_number":142,"context_line":"                    \u0027(at most one \"/\" is allowed)\u0027 % conf_key)"},{"line_number":143,"context_line":"            account, container \u003d grace_period_key_split"},{"line_number":144,"context_line":"            gp \u003d None"},{"line_number":145,"context_line":"            try:"},{"line_number":146,"context_line":"                gp \u003d float(self.conf.get(conf_key))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1b03d280_521efdf5","line":143,"in_reply_to":"a4ce54ca_6219a1e8","updated":"2024-02-10 05:16:02.000000000","message":"I agree, would also prefer that for readability.","commit_id":"c819c50798c9e784c59aa0de5362d94bfd19bebf"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"1ab934e7a55e2c93292bbc788783975ead633240","unresolved":true,"context_lines":[{"line_number":306,"context_line":"            try:"},{"line_number":307,"context_line":"                return self.grace_periods[(target_account, None)]"},{"line_number":308,"context_line":"            except KeyError:"},{"line_number":309,"context_line":"                return 0.0"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"    def iter_task_to_expire(self, task_account_container_list,"},{"line_number":312,"context_line":"                            my_index, divisor):"}],"source_content_type":"text/x-python","patch_set":4,"id":"0727824b_4c2ad21f","line":309,"updated":"2024-02-09 18:41:31.000000000","message":"nit:\n\nnot even a nit really, just an alternative:\n\n```\nreturn self.grace_periods.get((target_account, target_container),\n                              self.grace_periods.get((target_account,None),\n                               0.0))\n                              ```","commit_id":"c819c50798c9e784c59aa0de5362d94bfd19bebf"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"f81a2f801f4819fc002bb1312b9fceca457b4724","unresolved":false,"context_lines":[{"line_number":306,"context_line":"            try:"},{"line_number":307,"context_line":"                return self.grace_periods[(target_account, None)]"},{"line_number":308,"context_line":"            except KeyError:"},{"line_number":309,"context_line":"                return 0.0"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"    def iter_task_to_expire(self, task_account_container_list,"},{"line_number":312,"context_line":"                            my_index, divisor):"}],"source_content_type":"text/x-python","patch_set":4,"id":"331019f9_9ac748d3","line":309,"in_reply_to":"0727824b_4c2ad21f","updated":"2024-02-10 05:16:02.000000000","message":"like how clean this is, agreed","commit_id":"c819c50798c9e784c59aa0de5362d94bfd19bebf"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"1ab934e7a55e2c93292bbc788783975ead633240","unresolved":true,"context_lines":[{"line_number":134,"context_line":"                grace_period_key_split \u003d split_path("},{"line_number":135,"context_line":"                    \u0027/\u0027 + grace_period_key, 1, 2"},{"line_number":136,"context_line":"                )"},{"line_number":137,"context_line":"            except (AssertionError, ValueError):"},{"line_number":138,"context_line":"                raise ValueError("},{"line_number":139,"context_line":"                    \u0027%s \u0027"},{"line_number":140,"context_line":"                    \u0027should be in the form grace_period_\u003caccount\u003e \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"de4e777d_ed9fd6e8","line":137,"range":{"start_line":137,"start_character":20,"end_line":137,"end_character":34},"updated":"2024-02-09 18:41:31.000000000","message":"I\u0027m not sure split_path raises an AssertionError","commit_id":"fa8f0ada6b9c20535cd0a7b3e5e0f0798801d2f6"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"f81a2f801f4819fc002bb1312b9fceca457b4724","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                grace_period_key_split \u003d split_path("},{"line_number":135,"context_line":"                    \u0027/\u0027 + grace_period_key, 1, 2"},{"line_number":136,"context_line":"                )"},{"line_number":137,"context_line":"            except (AssertionError, ValueError):"},{"line_number":138,"context_line":"                raise ValueError("},{"line_number":139,"context_line":"                    \u0027%s \u0027"},{"line_number":140,"context_line":"                    \u0027should be in the form grace_period_\u003caccount\u003e \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"255648b9_164ab9c6","line":137,"range":{"start_line":137,"start_character":20,"end_line":137,"end_character":34},"in_reply_to":"de4e777d_ed9fd6e8","updated":"2024-02-10 05:16:02.000000000","message":"You\u0027re right -- added that for some old code that I changed, don\u0027t need it!","commit_id":"fa8f0ada6b9c20535cd0a7b3e5e0f0798801d2f6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"1ab934e7a55e2c93292bbc788783975ead633240","unresolved":true,"context_lines":[{"line_number":150,"context_line":"                raise ValueError("},{"line_number":151,"context_line":"                    \u0027%s must be a float \u0027"},{"line_number":152,"context_line":"                    \u0027greater than or equal to 0\u0027 % conf_key)"},{"line_number":153,"context_line":"            self.grace_periods[(account, container)] \u003d gp"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def read_conf_for_queue_access(self, swift):"},{"line_number":156,"context_line":"        if self.conf.get(\u0027auto_create_account_prefix\u0027):"}],"source_content_type":"text/x-python","patch_set":5,"id":"d683068a_34960c38","line":153,"updated":"2024-02-09 18:41:31.000000000","message":"ok, good: if I regress by setting container to None here I see tests fail\n```\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d 3 failed, 43 passed in 2.44s \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\n```","commit_id":"fa8f0ada6b9c20535cd0a7b3e5e0f0798801d2f6"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"f81a2f801f4819fc002bb1312b9fceca457b4724","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                raise ValueError("},{"line_number":151,"context_line":"                    \u0027%s must be a float \u0027"},{"line_number":152,"context_line":"                    \u0027greater than or equal to 0\u0027 % conf_key)"},{"line_number":153,"context_line":"            self.grace_periods[(account, container)] \u003d gp"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def read_conf_for_queue_access(self, swift):"},{"line_number":156,"context_line":"        if self.conf.get(\u0027auto_create_account_prefix\u0027):"}],"source_content_type":"text/x-python","patch_set":5,"id":"de478ef5_ce4eed65","line":153,"in_reply_to":"d683068a_34960c38","updated":"2024-02-10 05:16:02.000000000","message":"Acknowledged","commit_id":"fa8f0ada6b9c20535cd0a7b3e5e0f0798801d2f6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"1ab934e7a55e2c93292bbc788783975ead633240","unresolved":true,"context_lines":[{"line_number":330,"context_line":"                                          task_object)"},{"line_number":331,"context_line":"                    continue"},{"line_number":332,"context_line":"                grace_period \u003d self.get_grace_period(target_account,"},{"line_number":333,"context_line":"                                                     target_container)"},{"line_number":334,"context_line":"                cutoff \u003d time() - grace_period"},{"line_number":335,"context_line":"                if delete_timestamp \u003e Timestamp(cutoff):"},{"line_number":336,"context_line":"                    if grace_period:"}],"source_content_type":"text/x-python","patch_set":5,"id":"662a96c0_41323e8b","line":333,"updated":"2024-02-09 18:41:31.000000000","message":"ok, good: if I regress by setting target_container to None I see this test fail\n```\nFAILED [ 69%]\ntest/unit/obj/test_expirer.py:936 (TestObjectExpirer.test_iter_task_to_expire_with_grace)\n\n```","commit_id":"fa8f0ada6b9c20535cd0a7b3e5e0f0798801d2f6"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"f81a2f801f4819fc002bb1312b9fceca457b4724","unresolved":false,"context_lines":[{"line_number":330,"context_line":"                                          task_object)"},{"line_number":331,"context_line":"                    continue"},{"line_number":332,"context_line":"                grace_period \u003d self.get_grace_period(target_account,"},{"line_number":333,"context_line":"                                                     target_container)"},{"line_number":334,"context_line":"                cutoff \u003d time() - grace_period"},{"line_number":335,"context_line":"                if delete_timestamp \u003e Timestamp(cutoff):"},{"line_number":336,"context_line":"                    if grace_period:"}],"source_content_type":"text/x-python","patch_set":5,"id":"aaaf7658_6b4d6866","line":333,"in_reply_to":"662a96c0_41323e8b","updated":"2024-02-10 05:16:02.000000000","message":"Acknowledged","commit_id":"fa8f0ada6b9c20535cd0a7b3e5e0f0798801d2f6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"55ba52b0e51d93f719399e203254f00ec1cdc9ee","unresolved":true,"context_lines":[{"line_number":99,"context_line":"        if not gp or gp \u003c 0:"},{"line_number":100,"context_line":"            raise ValueError("},{"line_number":101,"context_line":"                \u0027%s must be a float \u0027"},{"line_number":102,"context_line":"                \u0027greater than or equal to 0\u0027 % conf_key)"},{"line_number":103,"context_line":"        grace_periods[(account, container)] \u003d gp"},{"line_number":104,"context_line":"    return grace_periods"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7bc74fb9_0a345650","line":102,"range":{"start_line":102,"start_character":33,"end_line":102,"end_character":43},"updated":"2024-02-13 12:42:54.000000000","message":"existing bug: ``if not gp`` means that grace period cannot be equal to 0\n\n```\n[acoles@demo-node0 ~]$ cat /etc/swift/object-expirer.conf.d/10_expiry_delay.conf\n[object-expirer]\ngrace_period_AUTH_dev \u003d 0.0\ngrace_period_AUTH_dev/test_grace_period \u003d 600.0\n\n[acoles@demo-node0 ~]$ sudo /opt/ss/bin/swift-object-expirer /etc/swift/object-expirer.conf.d -v -o\nobject-expirer: Starting 17707\nTraceback (most recent call last):\n  File \"/opt/ss/bin/swift-object-expirer\", line 33, in \u003cmodule\u003e\n    run_daemon(ObjectExpirer, conf_file, **options)\n  File \"/opt/ss/lib/python2.7/site-packages/swift/common/daemon.py\", line 330, in run_daemon\n    d \u003d klass(conf)\n  File \"/opt/ss/lib/python2.7/site-packages/swift/obj/expirer.py\", line 161, in __init__\n    self.grace_periods \u003d read_conf_for_grace_periods(conf)\n  File \"/opt/ss/lib/python2.7/site-packages/swift/obj/expirer.py\", line 104, in read_conf_for_grace_periods\n    \u0027greater than or equal to 0\u0027 % conf_key)\nValueError: grace_period_AUTH_dev must be a float greater than or equal to 0\n```","commit_id":"ff244a7db50ce476bc577905b36bf5beeadedbc6"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"ab23763cb856da22eb7490726ae58582f12a2d35","unresolved":true,"context_lines":[{"line_number":99,"context_line":"        if not gp or gp \u003c 0:"},{"line_number":100,"context_line":"            raise ValueError("},{"line_number":101,"context_line":"                \u0027%s must be a float \u0027"},{"line_number":102,"context_line":"                \u0027greater than or equal to 0\u0027 % conf_key)"},{"line_number":103,"context_line":"        grace_periods[(account, container)] \u003d gp"},{"line_number":104,"context_line":"    return grace_periods"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9b9f5c02_ed9de5c6","line":102,"range":{"start_line":102,"start_character":33,"end_line":102,"end_character":43},"in_reply_to":"7bc74fb9_0a345650","updated":"2024-02-14 05:39:58.000000000","message":"ACK -- updated to check if it is none instead","commit_id":"ff244a7db50ce476bc577905b36bf5beeadedbc6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"21bbec9e33199cbb1f025396acb3214334d8e9e0","unresolved":true,"context_lines":[{"line_number":99,"context_line":"        if not gp or gp \u003c 0:"},{"line_number":100,"context_line":"            raise ValueError("},{"line_number":101,"context_line":"                \u0027%s must be a float \u0027"},{"line_number":102,"context_line":"                \u0027greater than or equal to 0\u0027 % conf_key)"},{"line_number":103,"context_line":"        grace_periods[(account, container)] \u003d gp"},{"line_number":104,"context_line":"    return grace_periods"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ee1f2b52_993e8f42","line":102,"range":{"start_line":102,"start_character":33,"end_line":102,"end_character":43},"in_reply_to":"9b9f5c02_ed9de5c6","updated":"2024-02-14 11:01:33.000000000","message":"Thanks Anish - could you add a unit test scenario to cover 0.","commit_id":"ff244a7db50ce476bc577905b36bf5beeadedbc6"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"e1aef6de8e893621c047f56f5470a2c013b29621","unresolved":true,"context_lines":[{"line_number":99,"context_line":"        if not gp or gp \u003c 0:"},{"line_number":100,"context_line":"            raise ValueError("},{"line_number":101,"context_line":"                \u0027%s must be a float \u0027"},{"line_number":102,"context_line":"                \u0027greater than or equal to 0\u0027 % conf_key)"},{"line_number":103,"context_line":"        grace_periods[(account, container)] \u003d gp"},{"line_number":104,"context_line":"    return grace_periods"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"f3e1f7af_b8623efe","line":102,"range":{"start_line":102,"start_character":33,"end_line":102,"end_character":43},"in_reply_to":"ee1f2b52_993e8f42","updated":"2024-02-14 17:17:58.000000000","message":"Sounds good, just added!","commit_id":"ff244a7db50ce476bc577905b36bf5beeadedbc6"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"7c26a07c1987baf8959fdcd8b28593304394b9ab","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if not gp or gp \u003c 0:"},{"line_number":100,"context_line":"            raise ValueError("},{"line_number":101,"context_line":"                \u0027%s must be a float \u0027"},{"line_number":102,"context_line":"                \u0027greater than or equal to 0\u0027 % conf_key)"},{"line_number":103,"context_line":"        grace_periods[(account, container)] \u003d gp"},{"line_number":104,"context_line":"    return grace_periods"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"2f1cb0df_62bcc05c","line":102,"range":{"start_line":102,"start_character":33,"end_line":102,"end_character":43},"in_reply_to":"f3e1f7af_b8623efe","updated":"2024-02-15 18:48:24.000000000","message":"Done","commit_id":"ff244a7db50ce476bc577905b36bf5beeadedbc6"}],"test/unit/obj/test_expirer.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":295,"context_line":"            x.get_process_values(vals)"},{"line_number":296,"context_line":"        self.assertEqual(str(ctx.exception), expected_msg)"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def test_per_container_grace_period_with_slash(self):"},{"line_number":299,"context_line":"        conf \u003d {"},{"line_number":300,"context_line":"            \u0027grace_period_A_U_TH_foo_bar/my-container_name/with/slash\u0027: 60400,"},{"line_number":301,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"daca1c63_9ea585dd","line":298,"updated":"2024-02-08 13:01:27.000000000","message":"nit: naming this test `test_init_per_container_grace_period_with_slash` would help locate it along with other constructor tests","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":295,"context_line":"            x.get_process_values(vals)"},{"line_number":296,"context_line":"        self.assertEqual(str(ctx.exception), expected_msg)"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def test_per_container_grace_period_with_slash(self):"},{"line_number":299,"context_line":"        conf \u003d {"},{"line_number":300,"context_line":"            \u0027grace_period_A_U_TH_foo_bar/my-container_name/with/slash\u0027: 60400,"},{"line_number":301,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"96367ed6_099ad8ac","line":298,"in_reply_to":"daca1c63_9ea585dd","updated":"2024-02-08 21:08:15.000000000","message":"Acknowledged","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":302,"context_line":"        with self.assertRaises(ValueError) as ctx:"},{"line_number":303,"context_line":"            x \u003d expirer.ObjectExpirer(conf, swift\u003dself.fake_swift)"},{"line_number":304,"context_line":"            # XXX this doesn\u0027t look like what ops wanted"},{"line_number":305,"context_line":"            self.assertEqual(x.acct_grace_periods, {"},{"line_number":306,"context_line":"                (\u0027A_U_TH_foo_bar/my-container_name/with/slash\u0027, None): 60400,"},{"line_number":307,"context_line":"            })"},{"line_number":308,"context_line":"        self.assertEqual("},{"line_number":309,"context_line":"            \u0027grace_period_A_U_TH_foo_bar/my-container_name/with/slash \u0027"},{"line_number":310,"context_line":"            \u0027should be in the form grace_period_\u003caccount\u003e/\u003ccontainer\u003e \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"7b8183e5_5c454b41","line":307,"range":{"start_line":305,"start_character":12,"end_line":307,"end_character":14},"updated":"2024-02-08 13:01:27.000000000","message":"this is never executed (assuming the test passes):\n \n `expirer.ObjectExpirer(conf, swift\u003dself.fake_swift)` raises a ValueError so line 305 is not reached, the assertRaises context manager catches the ValueError.\n \n If you dedent line 305 you\u0027ll see that the test fails (in fact, \u0027x\u0027 does not exist).","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        with self.assertRaises(ValueError) as ctx:"},{"line_number":303,"context_line":"            x \u003d expirer.ObjectExpirer(conf, swift\u003dself.fake_swift)"},{"line_number":304,"context_line":"            # XXX this doesn\u0027t look like what ops wanted"},{"line_number":305,"context_line":"            self.assertEqual(x.acct_grace_periods, {"},{"line_number":306,"context_line":"                (\u0027A_U_TH_foo_bar/my-container_name/with/slash\u0027, None): 60400,"},{"line_number":307,"context_line":"            })"},{"line_number":308,"context_line":"        self.assertEqual("},{"line_number":309,"context_line":"            \u0027grace_period_A_U_TH_foo_bar/my-container_name/with/slash \u0027"},{"line_number":310,"context_line":"            \u0027should be in the form grace_period_\u003caccount\u003e/\u003ccontainer\u003e \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"50c39f2f_828d04eb","line":307,"range":{"start_line":305,"start_character":12,"end_line":307,"end_character":14},"in_reply_to":"7b8183e5_5c454b41","updated":"2024-02-08 21:08:15.000000000","message":"Got it, it seems this line is not necessary for what we\u0027re checking because it should not even be registered in grace_periods. Removed the line.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6d8abc78c1a36799cce25f9bbd9e65c81436dd93","unresolved":true,"context_lines":[{"line_number":353,"context_line":"            (\u0027a\u0027, \u0027test\u0027): 1.0,"},{"line_number":354,"context_line":"            (\u0027b\u0027, None): 259200.0,"},{"line_number":355,"context_line":"            (\u0027AUTH_aBC\u0027, \u0027test2\u0027): 999,"},{"line_number":356,"context_line":"            (u\u0027AUTH_aBáC\u0027, \u0027tést\u0027): 555,"},{"line_number":357,"context_line":"        })"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        # negative tests"}],"source_content_type":"text/x-python","patch_set":2,"id":"d019a433_e25686f3","line":356,"range":{"start_line":356,"start_character":26,"end_line":356,"end_character":33},"updated":"2024-02-08 13:31:17.000000000","message":"the py27 test failure is due to this not being declared unicode `u\u0027tést\u0027`\n\nSadly we still test against py2.7. You can run the tests in your vsaio using vtox -e py27.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            (\u0027a\u0027, \u0027test\u0027): 1.0,"},{"line_number":354,"context_line":"            (\u0027b\u0027, None): 259200.0,"},{"line_number":355,"context_line":"            (\u0027AUTH_aBC\u0027, \u0027test2\u0027): 999,"},{"line_number":356,"context_line":"            (u\u0027AUTH_aBáC\u0027, \u0027tést\u0027): 555,"},{"line_number":357,"context_line":"        })"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        # negative tests"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fd7416e_2a56d3f4","line":356,"range":{"start_line":356,"start_character":26,"end_line":356,"end_character":33},"in_reply_to":"d019a433_e25686f3","updated":"2024-02-08 21:08:15.000000000","message":"Updated to include unicode declaration.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":354,"context_line":"            (\u0027b\u0027, None): 259200.0,"},{"line_number":355,"context_line":"            (\u0027AUTH_aBC\u0027, \u0027test2\u0027): 999,"},{"line_number":356,"context_line":"            (u\u0027AUTH_aBáC\u0027, \u0027tést\u0027): 555,"},{"line_number":357,"context_line":"        })"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        # negative tests"},{"line_number":360,"context_line":"        conf \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4227a1_574b7ee9","line":357,"updated":"2024-02-08 13:01:27.000000000","message":"as per discussion in expirer.py, there\u0027s some bad cases that are not being caught:\n\n```\ndiff --git a/test/unit/obj/test_expirer.py b/test/unit/obj/test_expirer.py\nindex c12b4763c..7a9fda36a 100644\n--- a/test/unit/obj/test_expirer.py\n+++ b/test/unit/obj/test_expirer.py\n@@ -347,9 +347,13 @@ class TestObjectExpirer(TestCase):\n             \u0027grace_period_b\u0027: \u0027259200.0\u0027,\n             \u0027grace_period_AUTH_aBC/test2\u0027: 999,\n             u\u0027grace_period_AUTH_aBáC/tést\u0027: 555,\n+            \u0027grace_period_/a\u0027: \u0027123.4\u0027,\n+            \u0027grace_period_a/\u0027: \u0027789.0\u0027\n         }\n         x \u003d expirer.ObjectExpirer(conf, swift\u003dself.fake_swift)\n         self.assertEqual(x.acct_grace_periods, {\n+            (\u0027\u0027, \u0027a\u0027): 123.4,\n+            (\u0027a\u0027, \u0027\u0027): 789.0,\n             (\u0027a\u0027, \u0027test\u0027): 1.0,\n             (\u0027b\u0027, None): 259200.0,\n             (\u0027AUTH_aBC\u0027, \u0027test2\u0027): 999,\n             ```\n             \nAlso, \"grace_period_\" is accepted 😞","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":354,"context_line":"            (\u0027b\u0027, None): 259200.0,"},{"line_number":355,"context_line":"            (\u0027AUTH_aBC\u0027, \u0027test2\u0027): 999,"},{"line_number":356,"context_line":"            (u\u0027AUTH_aBáC\u0027, \u0027tést\u0027): 555,"},{"line_number":357,"context_line":"        })"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        # negative tests"},{"line_number":360,"context_line":"        conf \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"4759abcc_07f90500","line":357,"in_reply_to":"da4227a1_574b7ee9","updated":"2024-02-08 21:08:15.000000000","message":"Added a test for leading and trailing slashes, as well as invalid parsing (\"grace_period_\").","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":356,"context_line":"            (u\u0027AUTH_aBáC\u0027, \u0027tést\u0027): 555,"},{"line_number":357,"context_line":"        })"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        # negative tests"},{"line_number":360,"context_line":"        conf \u003d {"},{"line_number":361,"context_line":"            \u0027grace_period_a\u0027: -1.0,"},{"line_number":362,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"e8158b36_e18078b8","line":359,"updated":"2024-02-08 13:01:27.000000000","message":"nit: maybe we could have a separate test_init_invalid_grace_period starting here - the original test is getting quite long","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":356,"context_line":"            (u\u0027AUTH_aBáC\u0027, \u0027tést\u0027): 555,"},{"line_number":357,"context_line":"        })"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        # negative tests"},{"line_number":360,"context_line":"        conf \u003d {"},{"line_number":361,"context_line":"            \u0027grace_period_a\u0027: -1.0,"},{"line_number":362,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"3dcdc873_bdb4b4cd","line":359,"in_reply_to":"e8158b36_e18078b8","updated":"2024-02-08 21:08:15.000000000","message":"Acknowledged","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":407,"context_line":"        self.assertEqual("},{"line_number":408,"context_line":"            \u0027grace_period_a/b must be a float greater than or equal to 0\u0027,"},{"line_number":409,"context_line":"            str(ctx.exception))"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"    def test_init_concurrency_too_small(self):"},{"line_number":412,"context_line":"        conf \u003d {"},{"line_number":413,"context_line":"            \u0027concurrency\u0027: 0,"}],"source_content_type":"text/x-python","patch_set":2,"id":"537b1fa0_1f275c0f","line":410,"updated":"2024-02-08 13:01:27.000000000","message":"I was surprised that there was not already a test_get_grace_period to directly test that method. Maybe we could add:\n\n```\ndiff --git a/test/unit/obj/test_expirer.py b/test/unit/obj/test_expirer.py\nindex c12b4763c..287187ccb 100644\n--- a/test/unit/obj/test_expirer.py\n+++ b/test/unit/obj/test_expirer.py\n@@ -408,6 +408,23 @@ class TestObjectExpirer(TestCase):\n             \u0027grace_period_a/b must be a float greater than or equal to 0\u0027,\n             str(ctx.exception))\n\n+    def test_get_grace_period(self):\n+        conf \u003d {\n+            \u0027grace_period_a\u0027: 1.0,\n+            \u0027grace_period_a/test\u0027: 2.0,\n+            \u0027grace_period_b\u0027: \u0027259200.0\u0027,\n+            \u0027grace_period_c/test\u0027: \u00273.0\u0027\n+        }\n+\n+        x \u003d expirer.ObjectExpirer(conf, swift\u003dself.fake_swift)\n+        self.assertEqual(1.0, x.get_grace_period(\u0027a\u0027, \u0027not-test\u0027))\n+        self.assertEqual(2.0, x.get_grace_period(\u0027a\u0027, \u0027test\u0027))\n+        self.assertEqual(259200.0, x.get_grace_period(\u0027b\u0027, None))\n+        self.assertEqual(259200.0, x.get_grace_period(\u0027b\u0027, \u0027test\u0027))\n+        self.assertEqual(3.0, x.get_grace_period(\u0027c\u0027, \u0027test\u0027))\n+        self.assertEqual(0.0, x.get_grace_period(\u0027c\u0027, \u0027not-test\u0027))\n+        self.assertEqual(0.0, x.get_grace_period(\u0027no-conf\u0027, \u0027test\u0027))\n+\n     def test_init_concurrency_too_small(self):\n         conf \u003d {\n             \u0027concurrency\u0027: 0,\n```","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":407,"context_line":"        self.assertEqual("},{"line_number":408,"context_line":"            \u0027grace_period_a/b must be a float greater than or equal to 0\u0027,"},{"line_number":409,"context_line":"            str(ctx.exception))"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"    def test_init_concurrency_too_small(self):"},{"line_number":412,"context_line":"        conf \u003d {"},{"line_number":413,"context_line":"            \u0027concurrency\u0027: 0,"}],"source_content_type":"text/x-python","patch_set":2,"id":"05eaf0bb_9fc35ecc","line":410,"in_reply_to":"537b1fa0_1f275c0f","updated":"2024-02-08 21:08:15.000000000","message":"Done","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"98e719ecee14620c5a81d820405554ca5b9b1bed","unresolved":true,"context_lines":[{"line_number":971,"context_line":"        ]"},{"line_number":972,"context_line":"        observed \u003d list(x.iter_task_to_expire("},{"line_number":973,"context_line":"            task_account_container_list, 0, 1))"},{"line_number":974,"context_line":"        self.assertEqual(expected, observed)"},{"line_number":975,"context_line":""},{"line_number":976,"context_line":"    def test_run_once_unicode_problem(self):"},{"line_number":977,"context_line":"        requests \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"1eef3d40_58452553","line":974,"updated":"2024-02-08 13:01:27.000000000","message":"it would be good to have a scenario that inverts the relative grace period of the account and container i.e. the container grace_period is longer so that a1/c2/o1 is NOT expired","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"},{"author":{"_account_id":36763,"name":"Anish Kachinthaya","display_name":"Anish","email":"akachinthaya@nvidia.com","username":"akachinthaya"},"change_message_id":"25ed1bd5584f09b46f0ee575d7e581dae0845c8f","unresolved":false,"context_lines":[{"line_number":971,"context_line":"        ]"},{"line_number":972,"context_line":"        observed \u003d list(x.iter_task_to_expire("},{"line_number":973,"context_line":"            task_account_container_list, 0, 1))"},{"line_number":974,"context_line":"        self.assertEqual(expected, observed)"},{"line_number":975,"context_line":""},{"line_number":976,"context_line":"    def test_run_once_unicode_problem(self):"},{"line_number":977,"context_line":"        requests \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"d72b8ca9_891785aa","line":974,"in_reply_to":"1eef3d40_58452553","updated":"2024-02-08 21:08:15.000000000","message":"Good point, added a test for this.","commit_id":"cac22ab590530d24fedc0fb5ad7efe4e213360fa"}]}
