Giter VIP home page Giter VIP logo

Comments (4)

theseanything avatar theseanything commented on May 13, 2024

@jamesroutley thinking to rename to boto_parameter or boto_argument or call_argument something like that and moving the function to template class

from sceptre.

jamesroutley avatar jamesroutley commented on May 13, 2024

I think the reason we're having difficulty with this function name is because the function itself isn't very good.

The function does the following:

  • Decide whether the cfn template should be uploaded to S3
  • If it should, upload it to S3 and return a dictionary containing a key-value pair which happens to correspond to a keyword argument to a Boto3 function call (!)
  • If not, return the a dictionary containing a key-pair ...

The function does different things (either returns the template location or the template itself), and returns a value which is highly coupled to the context of the function's invoker.

The reason that this function exists is that this logic happens multiple times in Stack() (when creating, launching, validating and creating a change set). We are caught between two 'bad' practices: including a badly defined, tightly coupled function, or having repeated code.

There are a couple of things we could do:

  1. Leave the code as is, but give it a better name
  2. Remove the function and re-add the repeated code
  3. Rearchitect it in some way to solve the underlying problem

I think we should go for 1. or 2. for now, and maybe have a look at 3. when we're looking at the 2.0 stuff. @seanrankine thoughts on this so far?

from sceptre.

theseanything avatar theseanything commented on May 13, 2024

I don't think the function is necessarily bad - don't see any issue with it functionality. Its main goal to create the keyword argument for boto calls depending on how to handle the template body. Its just badly named.

Overall I was looking at moving validate_template to the template class as well, which also needs this function. So was going to move this function to template class as well.

I'll put in a PR and you can see what you think.

from sceptre.

b-t-g avatar b-t-g commented on May 13, 2024

Closed by #209.

from sceptre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.