DEV Community

Alexey Melezhik
Alexey Melezhik

Posted on • Updated on

Unveiling the Future Features of Sparrow6

Around month ago I announced Sparrow migration to Perl6.

The road's turned to be more longer than I expected, but this worths it.

Beside the fact I now understand Perl6 much better just because I am rewriting pretty big code base from the scratch, that also gave me an opportunity to rethink the entire design and bring some new features on the road.

And here the one. Task states. This is a killer feature of Sparrow6. I can't find anything similar in alike automation systems (chef and ansible).

Now tasks have states that gets returned as a Hash object back to the main scenario so that the state data could be used in further tasks. Let me show an example:


#!perl6

my %state = task-run "keyvault secret", "azure-kv-show", %(
  kv      => "{config<kv>}",
  secret  => [
    "connection-string-dev"
  ]
);

say "checking connection: {%state<connection-string-dev>}";

task-run "check login", "mssql-check-login", %(
  dsn => %state<connection-string-dev>
);

In this scenario two subsequent tasks get called. The first one fetches database connection string with credentials from azure from key vault and dump it to a screen, the initial purpose was just only printing secrets from kay vault, nothing else.

One day I thought I would also like to test if returned connection string is valid, in terms one can use it to connect to database. So I'd like that task return a value like a function. The idea had been in my mind for awhile till I got a chance to see a proper use case for that feature.

Now I can run the second task that checks if the connection string allow to connect to database, executing sqlcmd command with connection string.

The feature allows to return data from one task and use this data as input parameters for other one, enabling "pipeline" tasks.

It was not possible in old Sparrow. Where you just have two subsequent tasks that cannot pass a data from one to other.


Stay tuned. You can find the status of Sparrow6 project in Roadmap.md file.

Oldest comments (0)