Giter Site home page Giter Site logo

Comments (13)

shenglol avatar shenglol commented on August 27, 2024 1

Another [semi-related] thing I just thought of (which probably also needs manual validation) is that if something can be done in the template, it must be done in the template, not in the script. And trying to avoid having too many scripts/modules that are working around issues in the platform (e.g. replication) - though admittedly I struggle with some of these...

The CI probably cannot help here, since checking if a script is doing something unnecessary requires domain knowledge. IMHO it must be done as part of the module proposal / code review process.

from bicep-registry-modules.

bmoore-msft avatar bmoore-msft commented on August 27, 2024 1

I wonder if we should leave the implementation of idempotency tests to the deployment-script module authors. What we can do is to ask them to provide Boolean outputs in the main.test.bicep file to assert scripts1.output.x == script2.outputs.x (if outputs.x should be idempotent). The CI can check if the outputs are true after deploying the test file.

I like this idea (and second your point about doing this for all RPs not just scripts)... Though I also wonder if we should just leave it to a manual review - given we'd have to for the domain knowledge of the scenario (i.e. is this possible in a template without a script) we could do it for idempotency as well... I think it's at least worth trying manually - see how many we get, how hard the problem is, before we try to automate it...

from bicep-registry-modules.

alex-frankel avatar alex-frankel commented on August 27, 2024

FYI @bmoore-msft

from bicep-registry-modules.

shenglol avatar shenglol commented on August 27, 2024

Good suggestion. I can modify our CI to repeat the deployment step for main.test.bicep.

from bicep-registry-modules.

bmoore-msft avatar bmoore-msft commented on August 27, 2024

The other part of it though will be ensuring the result is the same...

from bicep-registry-modules.

shenglol avatar shenglol commented on August 27, 2024

The other part of it though will be ensuring the result is the same...

Agreed, but I don't if that's possible. What-If seems to be the right tool to use, but the results can be noisy for some RPs...

from bicep-registry-modules.

bmoore-msft avatar bmoore-msft commented on August 27, 2024

I think the goal of idempotency is that you get the same output with the same input... If we can't verify that, then not sure how much value the test will have - probably greater than zero, but doesn't tell you if it's a good script or not.

what-if won't tell you anything about the script part of the deployment script, or rather - what it's doing/changing.

from bicep-registry-modules.

alex-frankel avatar alex-frankel commented on August 27, 2024

We should be able to compare the results of script.properties.outputs on run one and run two, right? Brian, do you think that covers it?

from bicep-registry-modules.

bmoore-msft avatar bmoore-msft commented on August 27, 2024

that will certainly help - but what if the script just does stuff - and/or has no outputs? I think #62 just copied images. Granted that one is pretty easy to "check" but still has to be done manually...

I think all of the things we can do have some merit - just need to be aware of the cost/benefit and how much it can really tell us.

Another [semi-related] thing I just thought of (which probably also needs manual validation) is that if something can be done in the template, it must be done in the template, not in the script. And trying to avoid having too many scripts/modules that are working around issues in the platform (e.g. replication) - though admittedly I struggle with some of these...

from bicep-registry-modules.

shenglol avatar shenglol commented on August 27, 2024

I thought we were talking about all resource types in general. If it is for deployment scripts only, comparing the outputs of the script requires the module author to export the script outputs as template level outputs of the test Bicep file. It also doesn't work if the outputs depend on some dynamic values (like timestamps).

from bicep-registry-modules.

shenglol avatar shenglol commented on August 27, 2024

Brian also raised a good point...

from bicep-registry-modules.

shenglol avatar shenglol commented on August 27, 2024

I wonder if we should leave the implementation of idempotency tests to the deployment-script module authors. What we can do is to ask them to provide Boolean outputs in the main.test.bicep file to assert scripts1.output.x == script2.outputs.x (if outputs.x should be idempotent). The CI can check if the outputs are true after deploying the test file.

from bicep-registry-modules.

ChrisSidebotham avatar ChrisSidebotham commented on August 27, 2024

Dear @bmoore-msft , Azure Verified Modules (AVM) will become the single Microsoft standard for Bicep modules. Transitioning to AVM, requests for new features or bug fixes will need to be submitted against the appropriate AVM module via AVM Module Issues.

For bugs or new features with existing modules in the /modules directory of this repository, we encourage you to first try the AVM equivalent module if available and if the module is lacking any features, you can file an AVM Module Issue. If the module is not available yet, you can file a new AVM Module Proposal.

See this informational notice for more details on the upcoming changes.

Thank you for your understanding!

from bicep-registry-modules.

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.