Giter VIP home page Giter VIP logo

fbl's People

Contributors

dependabot[bot] avatar greenkeeper[bot] avatar mergify[bot] avatar snyk-bot avatar vlad-tkachenko avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lgtm-migrator

fbl's Issues

Tarball referenced by URL sometimes gets not fully loaded.

fbl https://github.com/FireBlinkLTD/fbl-plugin-template/archive/latest.tar.gz
 -> Downloading tarball from remote URL: https://github.com/FireBlinkLTD/fbl-plugin-template/archive/latest.tar.gz
 -> Extracting tarball at path: /var/folders/l2/jyv1k6js0yj3j__ppkc5zd04c_7vc6/T/tmp-8201Wzn5XIWbYJ1H.tar.gz
zlib: unexpected end of file

By comparing file size actual is 4kb while expected - 5kb.

Add support of global plugin registry

Need to give option for user to store his/her default list of plugins inside the user's homedir config file at path $HOME/.fbl/config

Config should be presented with a YAML formatted content:

plugins:
 - fbl-test-plugin

secrets:
 shhhh: true

context:
 defaultValue: 'no'

Action Handler: JS Function

Add new action handler that is capable on running any js function and has access to context and snapshot.

fn(): |-
   context.ctx.something = context.ctx.test > 0;

"dry run" processing

It might be handy to try the flow before applying the changes. Though some 3rd party plugins/actions may not support this. So update metadata to have supportsDryRunExecution boolean field. So that only action that support it will clearly state that.

Also add --dry-run command line option to dry run the flow. If any of the actions inside the flow doesn't support it - exceptions should be throws before validation and flow stopped.

Investigate failed CircleCI build

Upon releasing 0.3.0 CircleCI build failed with:

1) CliTestSuite
       testCustomTemplateDelimiters:

      AssertionError [ERR_ASSERTION]: { ct: 'yes', '.': { custom_ct: 'file1' }, test_1: 1, test_2: 2 } deepStrictEqual { test_1: 1, test_2: 2 }
      + expected - actual

       {
      -  ".": {
      -    "custom_ct": "file1"
      -  }
      -  "ct": "yes"
         "test_1": 1
         "test_2": 2
       }
      
      at CliTestSuite.<anonymous> (test/unit/cliTestSuite.ts:809:16)

However, at first sight it looks weird as "testCustomTemplateDelimiters" test doesn't operate with "custom_ct" field names inside it.

https://circleci.com/gh/FireBlinkLTD/fbl/231

"Repeat" Action Handler

Sometimes it may be useful to repeat some actions multiple times, but manually duplicating it's configuration inside the sequence/parallel action handler might be a pain.

Consider creating new "repeat" action that accepts following options:

# number of times to repeat action
times: 5

# some action to repeat
# iteration index should also be available for EJS template of the action
# index should always start with 0
action:
  dummy: 'Index: <%- index %>'

# Whether to run all actions in parallel or in a sequence, default value: false
async: true

Flow reference to index.yml

If flow references to directory CLI and attachment action handler should use index.yml as a pipeline entry point.

Custom reporter generators

There should be 2 embedded report generators: JSON and YAML, all others should be added via plugins.

So plugin interface needs to be updated to support report generators registration.

Improve plugin interface

Currently interface contains only one method that returns action handlers to register. Additionally plugin should return:

  • name (required)
  • description (human readable)
  • fbl version it guarantees to work
  • tags

New Action Handler: Exec Shell Command

Add new action handler to invoke shell commands.

cmd:
  executable: string # path or name of executable
  args?: string[] # arguments passed to executable
  options?:
    stdout?: boolean # whether or not include stdout in the result
    stderr?: boolean # whether or not include stderr in the result
    code?: boolean # whether or not include stderr in the result
  context?:
   ctx?: string # path inside "ctx" to assign the result 
   secrets?: string # path inside "secrets" to assign the result 

Action meta information.

Allow to specify any kind of meta information with action step. Reserve $ as a prefix.

E.g.:

version: 1.0.0
pipeline:
  $description: |-
    Detailed information about "ctx" action
  ctx: 
    '.':
      inline:
        option: value

Reference flow from remote tarball.

Both fbl CLI and attachment action handler should support flow reference from URL to download tarball:

fbl http://someservice.com/sample_0.1.3.tar.gz

Tarball support.

Need to support a way to package flows into tarballs. Both CLI and Attachment action handlers should support it.

Flow Requirements

Add ability to specify flow dependencies on fbl version and its plugins. Including native applications.

CLI Reporting

Add ability to register reporting records that should be printed to console at the end of execution.

Keeping an eye on intermediate logs might not be the best option for user, but looking into well formatted report in the end - is a nice option.

Also action handler "report" should be created. Suggested format:

report:
  title: string
  # if status matches one of 3 default ones - output will be colored in GREEN, RED or YELLOW
  status: SUCCESS | FAIL | SKIPPED | else
  # will not be part of the printed table, but may be used programmatically for future needs 
  payload: any 

Cache remote and extracted tarball paths.

Currently if remote or flow inside the local tarball will be requested multiple times it will be re-downloaded / extracted as many times as it mentioned in the flow.

"Build Time" EJS template rendering

We need to introduce build time EJS template processing, e.g. process entire yaml file upon load. Non-standard delimiter should be used for that. Proposal: $

So, the file may look like:

version: 1.0.0
pipeline:
  '--':
    <$ ctx.something.forEach(s => { $>
    - ctx:
        test_<$- s $>: 
          inline: <%- secrets.test_<$- s $> %>
    <$ }) $>

Also, both "build time" and "run time" delimiters should be customizable via CLI parameters.

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.