Skip to content
This repository was archived by the owner on Oct 22, 2022. It is now read-only.
This repository was archived by the owner on Oct 22, 2022. It is now read-only.

Variables validator #86

Open
Open

Description

@zrzka

Story

Our projects heavily rely on :cljs-lambda :defaults :env. Also, we have production variables set in the :production profile (profiles.clj). Sometimes we forget to ...

  • add env variable to profiles.clj,
  • replace TODO with production value (waiting for CF template changeset to be deployed),
  • set env variable (for example #=(eval (System/getenv "STRIPE_API_KEY_SECRET"))) and dev value is deployed to production,
  • ...

Repetitive tasks, prone to error, ... Boring, no one wants to do them.

Idea

My idea is to enhance cljs-lambda plugin with some validation task. Something like:

  • Are all env keys in project.clj set in profiles.clj?
  • Does profile.clj contain TODO as a value for any key?
  • Do these values differ?

Do you think it's good enhancement for cljs-lambda plugin or we should create new plugin? Honestly, not sure if I can come up with generic validator, with enough parameters, to suit needs for lot of people. Our cases are described above, but there can be lot of other cases. Also not sure if plugin can read all these combinations from project & profile files without merging, etc. Didn't test it yet, just thinking aloud.

Activity

  1. moea commented on May 29, 2017

    @moea
    Member

    If you don't want to handle this at runtime, maybe the most specific thing that feels like it belongs in cljs-lambda would be a task which prints out the effective config map (either for all functions, or for a specific function). You could then have a project-specific script which looks at the output of lein with-profile production cljs-lambda dump-config important-function or, alternatively, ... cljs-lambda deploy :dry-run, which would just log the AWS CLI commands, but I suspect that the first might be a little easier to parse. Would that be helpful at all?

  2. zrzka commented on May 31, 2017

    @zrzka
    ContributorAuthor

    If it prints out effective config, per lambda function, for all functions / selected functions, it would be enough and I can handle it via another script which captures output. I'll create dump-config POC and then we can discuss possible changes. If it will not fit cljs-lambda in some way, I can create another plugin, not an issue.

  3. added a commit that references this issue on Jun 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions