Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Gokart Feature Discussion: What's read_environ()

Gokart Feature Discussion: What's read_environ()

Keisuke OGAKI

February 10, 2022

More Decks by Keisuke OGAKI

Other Decks in Programming


  1. So? (cfg.ini) [foo] BAR=%(ENV)s [TaskOnKart] [foo] BAR=%(ENV)s ENV=foo [TaskOnKart] ENV=foo

    [foo] BAR=foo ENV=foo [TaskOnKart] ENV=foo basic variable interpolation envvars to default ENV=foo CONFIG=cfg.ini python main.py
  2. Problems Sideeffect • [TaskOnKart] ENV=foo is not intended arguments ◦

    Creating [s3] section triggers errors by inserting ALL envvars from your env to s3client • Although some products use this sideeffect (backward compatibility problem) ◦ COMMON_PARAM=3 python main.py [TaskA] a=1 [TaskB] b=2 TaskA(a=1, common_param=3) TaskB(b=2, common_param=3)
  3. Conclusion Though this breaks backward compatibility, this much less readable.

    So let’s reconstruct this. How much backward compatibility will be broken? • poor: retain current • better: not default, but %(envvar)s works ◦ current PR • best: just use ${envvar}