Giter VIP home page Giter VIP logo

envarfiles's People

Contributors

zlatko-ms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

envarfiles's Issues

add support for yaml format

Add support for properties defined in a YAML file.

The feature should support :

  • identifying yaml files depending on the file extension ( .yml , .yaml )
  • yaml syntax validation prior to parsing
  • nested keys

Nested Keys

All keys , including nested ones, should be considered as variable names.

For instance :

release:
  version:
    major: 1.0
    minor: 4

should provide the following list of variables to inject :

release.version.major=1.0
release.version.minor=4

YAML Syntax validation

The easiest way of doing this is to exec a simple yq -e , if the return code is 0 then it is a valid yaml format

Notes

If the json parsing is implemented, then the yaml part can be branched on json by converting the yaml file to json using yq :

yq -j file.yaml

add support for json files

Add support for properties defined in a json file.

The feature should support :

  • identifying json files depending on the file extension ( .json )
  • json syntax validation prior to parsing
  • nested keys

Nested Keys

All keys , including nested ones, should be considered as variable names.

For instance :

{ "version" : { "major" : "1.0" , "minor" : "4" } }

should provide the following list of variables to inject :

version.major=1.0
version.minor=4

JSON Syntax validation

The easiest way of doing this is to exec a simple jr -r , if the return code is 0 then it is a valid json format

change default override behavior

Currently the default behaviour is to override existing variable values from file.

Should be changed to :

  • default : no override
  • when override=true : override the values

refactor integration tests

Refactor integration test for better coverage and clarity.

Features to test :

  • import variables from files without override
  • import variables from files with override
  • import variables only from valid files, ignore others
  • import variables from files with comments

Formats on which to test all the features :

  • Plain Text
  • JSON
  • YAML
  • Combined file set containing Plain, JSON and YAML

Running this action from a private enterprise repository

I am trying to run this action from a private repository but I get this message:
Unable to resolve action. Repository not found: zlatko-ms/varfiletoenv
When running the action from a public repository everything works perfectly

Could you provide me any help to solve this problem?. Thanks in advance

fix tag in ITs

Currently the ITs use actions under the previous name, fix this ASAP !!!!

Add a flag for internal logs

Internal logs might be useful when looking for a specific definition issue, however they are not necessary in all cases and can become a burden when looking at large workflow logs.

An input parameter should indicate whenever to produce the internal logs.

Add support for multiple var definition files

Provide a way to read the variables from more then a single file.

A possible usage would be the following :

    - name: Import project variables
      uses: zlatko-ms/varfiletoenv@v1
      with:
        files:
          ./test/projectvars.properties
          ./conf/myvars.config

tools and minor improvements

  • improve workflow rebase tool
  • add internal logs
  • use items when iterating over dict
  • examine slicing build process
  • examine uploading coverage report

Move implementation to a high level language

Shell is nice to start with, but we are not in 1978 any more and the listed enhancements will require more processing logic and therefore tests.

Hence we need to move the implementation to a higher level language in order to provide a sustainable maintenance process and also internal unit tests.

We suggest to move the implementation to python3 and to hold additional enhancement requests until this refactoring is completed.

add support for filter on variables

Add an input paramter to support a selection of variables by their name.

The rationale is to avoid to import a bunch of variables from a (large) file , if you simply need a couple of them.

Possible usage definition :

    - name: Import project variables with overriding
      uses: zlatko-ms/varfiletoenv@v1
      with:
        names: |
             version
             rtag
        paths: ./src/main/resources/tags.txt

would only import the variables version and rtag from the tags.txt file.

Add support for override flag

Add support of a flag to control the overriding of variables from the file.

When the flag is set to true ( default value ), then the file definitions would override any variable within the workflow with same name.

When flag is set to false, then the override would be disabled and variables defined in the workflow files would not be overriden.

A possible usage would be :

    - name: Import project variables
      uses: zlatko-ms/varfiletoenv@v1
      with:
         override: false
         files:
          ./test/projectvars.properties
          ./conf/myvars.config

IT refactoring

Re-organize the ITs in order to provide :

  • integration tests per supported format ( plain, json, yaml .... )
  • integration tests per features : override, logs, separator ....

reduce overall IT execution time

configurable nested var separator

Currently the nested properties are separated via a fixed, underscore symbol.

Implement a parameter to override this character and support some of the Java/JS use cases on properties files

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.