Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Resolves #961]: Hook.stack is not necessarily the stack actually being updated #1057

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gilleswijnker
Copy link

[Resolves #961]: Hook.stack is not necessarily the stack actually being updated.

Please note this request introduces a breaking change for custom Hooks. Hook.stack has been removed. Hook.run now accepts a single parameter stack.

PR Checklist

  • [ X ] Wrote a good commit message & description [see guide below].
  • [ X ] Commit message starts with [Resolve #issue-number].
  • [ X ] Added/Updated unit tests.
  • [ NA ] Added/Updated integration tests (if applicable).
  • [ X ] All unit tests (make test) are passing.
  • [ X ] Used the same coding conventions as the rest of the project.
  • [ X ] The new code passes pre-commit validations (pre-commit run --all-files).
  • [ X ] The PR relates to only one subject with a clear title.
    and description in grammatically correct, complete sentences.

Approver/Reviewer Checklist

  • Before merge squash related commits.

Other Information

Guide to writing a good commit

@ykhalyavin
Copy link
Contributor

@zaro0508 could you please review? In our work we have some hooks where we have to execute certain boto3 calls after the stack A is deployed and we need to pass to our hook X outputs from the stack A (work with TGW) and this PR straightens our workarounds

@zaro0508 zaro0508 requested a review from ngfgrant July 14, 2021 17:06

"""
def __init__(self, *args, **kwargs):
super(CustomHook, self).__init__(*args, **kwargs)

def run(self):
def run(self, stack):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the contribution however I don't think we can break every Sceptre custom hook out in the wild. I would prefer a more general solution that would allow hooks or resolvers to access the stack object.

If this is the only solution then i think it would need to be done with a new interface and then deprecating the old one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack attribute in sceptre.hooks.Hook is not thread-safe
3 participants