{"action":"closed","issue":{"url":"https://api.github.com/repos/pyinvoke/invoke/issues/535","repository_url":"https://api.github.com/repos/pyinvoke/invoke","labels_url":"https://api.github.com/repos/pyinvoke/invoke/issues/535/labels{/name}","comments_url":"https://api.github.com/repos/pyinvoke/invoke/issues/535/comments","events_url":"https://api.github.com/repos/pyinvoke/invoke/issues/535/events","html_url":"https://github.com/pyinvoke/invoke/issues/535","id":328820403,"node_id":"MDU6SXNzdWUzMjg4MjA0MDM=","number":535,"title":"Mutation of config-attached object does not survive task lifecycle","user":{"login":"NathanRichard","id":1778774,"node_id":"MDQ6VXNlcjE3Nzg3NzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1778774?v=4","gravatar_id":"","url":"https://api.github.com/users/NathanRichard","html_url":"https://github.com/NathanRichard","followers_url":"https://api.github.com/users/NathanRichard/followers","following_url":"https://api.github.com/users/NathanRichard/following{/other_user}","gists_url":"https://api.github.com/users/NathanRichard/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanRichard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanRichard/subscriptions","organizations_url":"https://api.github.com/users/NathanRichard/orgs","repos_url":"https://api.github.com/users/NathanRichard/repos","events_url":"https://api.github.com/users/NathanRichard/events{/privacy}","received_events_url":"https://api.github.com/users/NathanRichard/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-03T11:22:57Z","updated_at":"2018-06-21T19:57:30Z","closed_at":"2018-06-21T19:57:30Z","author_association":"NONE","body":"Hello,\r\nI am new to pyinvoke so maybe I am missing something trivial, but I did not find anything in the doc regarding this issue and I find it very counter-intuitive.\r\n\r\nAs I understand the Invoke API, one of the goal of Context.config is to manage state of the execution and pass it between tasks.\r\n\r\nHowever when I run the following code:\r\n\r\n```\r\n#!/usr/bin/env python3\r\n\r\nfrom invoke import Collection\r\nfrom invoke import task\r\nclass struct:\r\n\tdef __init__(self):\r\n\t\tself.state = 1\r\n\r\n\tdef mutate(self):\r\n\t\tself.state = 2\r\n\r\n@task\r\ndef initStep(ctx):\r\n\tctx.val = struct()\r\n\tprint(\"initStep \", ctx.val.state)\r\n\r\n@task(initStep)\r\ndef mutStep(ctx):\r\n\tctx.val.mutate()\r\n\tprint(\"mutStep \", ctx.val.state)\r\n\r\n@task(initStep, mutStep)\r\ndef clientStep(ctx):\r\n\tprint(\"clientStep \", ctx.val.state)\r\n\r\n```\r\nI got the following output:\r\n\r\n```\r\n$ inv clientStep \r\ninitStep  1\r\nmutStep  2\r\ndisplayStep  1\r\n```\r\n\r\nWhile I expected:\r\n\r\n```\r\ninitStep  1\r\nmutStep  2\r\ndisplayStep  2\r\n```\r\n\r\nCould you please advise if it is intended or a bug ?\r\n\r\nBest regards,\r\nNathan"}}
{"actor":{"display_login":"bitprophet"}}