Git Product home page Git Product logo

Comments (4)

scottrigby avatar scottrigby commented on July 28, 2024

Hi thanks for your feedback. I'm hearing a few questions:

  1. How can I get this to work?
  2. Why did you choose the pattern you did for this action?

Assuming that's right:

  1. How:

    • Action inputs are specified in action.yml, and documented in the README
    • There are a number of public helm repos using @helm/chart-testing-action, following this example. This is just to say it does work
    • Chart testing configuration for this action should be done by specifying a config file. You can see a working example in the helm/charts-repo-actions-demo Lint and Test Charts workflow
    • In your example above, you'll also want to specify the action ref (see using versioned actions). Again see how this is done in the helm/charts-repo-actions-demo workflows
  2. Why:

    • We chose the JavaScript option option for @helm/chart-testing-action because – while some ct commands can be run independently (like lint) – some ct commands (install, lint-and-install) require a working Kubernetes cluster
    • Note: we encourage using @helm/kind-action, as it was built for this purpose)
    • Because this action must interact with a cluster, it must be able to interact with the functional k8s cluster through a KUBECONFIG. When we built this action there wasn't a clear path on how to do that using the Dockerfile option
    • There may be another reason I'm forgetting. If so, @unguiculus may remember
    • I'm not sure how plausible it could be to refactor this action to use the Dockerfile option. But even if it were, given that we're very close to a full stable release, what would be the advantages?

from chart-testing-action.

qvistgaard avatar qvistgaard commented on July 28, 2024

Hi @scottrigby

Thanks for getting back to me regarding my rant :-)

I will give it another try to see if I can get it to work.

As to your question. You will be able to get all the features you need. The entire workspace is mounted directly inside the docker container. therefore the kubeconf and ct.conf will be available.
Further more you will be able to get rid of the complexity of the current call path going through js and shell scripts (including all the docker container management that is being done). it should possible to get all logs as well

If you like i would be more then happy to make a pull request to show how it can be implemented.

from chart-testing-action.

unguiculus avatar unguiculus commented on July 28, 2024

You can either use JavaScript or a Docker. Unfortunately, there's no other choice. As @scottrigby pointed out, the only way for us is JavaScript because we need to create Kubernetes clusters for testing using kind. Docker actions have a number of limitations which don't allow that.

We use as little JavaScript as possible just calling a shell script which can be indepenently run and tested. Most actions out there are based on GitHub's action starters which require an NPM build. IMHO this is a pain to develop and test because it requires running an NPM build and committing build artifacts.

The whole logic is in a shell script which IMHO should be easier to understand than a lot of JavaScript code that needs to be compiled and that calls out to the shell instead.

The script ct.sh is to be seen as an independent shell script that can be run and tested in isolation and is just called by the GitHub action. As such, it has a set of parameters that the script has to parse.

The script main.sh is only there to parse action inputs so they can be passed to ct.sh. One could certainly merge the scripts but then ct.sh would incorporate GH action logic which I rather have decoupled and the script would be harder to test in isolation.

The script main.js is the entrypoint and pretty much the minimal amount of JavaScript need to call main.sh. It can be used as is. It does not use any dependencies and, thus, does not require an NPM build.

from chart-testing-action.

unguiculus avatar unguiculus commented on July 28, 2024

Closing this now. Feel free to open a new issue if you still have questions.

from chart-testing-action.

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.