From 1cd9ccb8d3e7ca4b1f381b31df5fbf6e8e2f2a15 Mon Sep 17 00:00:00 2001 From: Venu <40973863+vkumbha@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:47:32 +0530 Subject: [PATCH 1/3] Fix --arg typo and remove requirements section in README. Closes #13 (#15) --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 439af00..ba4b997 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,6 @@ Slack pipeline library for [Flowpipe](https://flowpipe.io), enabling seamless in ## Getting started -### Requirements - -Docker daemon must be installed and running. Please see [Install Docker Engine](https://docs.docker.com/engine/install/) for more information. - ### Installation Download and install Flowpipe (https://flowpipe.io/downloads). Or use Brew: @@ -100,7 +96,7 @@ flowpipe pipeline list Run a pipeline: ```shell -flowpipe pipeline run post_message -arg channel=test -arg text="Hello World" +flowpipe pipeline run post_message --arg channel=test --arg text="Hello World" ``` To use a specific `credential`, specify the `cred` pipeline argument: From 02ad4f560a40dbadecd2954637e8d3505337d13c Mon Sep 17 00:00:00 2001 From: Jon Udell Date: Wed, 7 Feb 2024 03:34:50 -0800 Subject: [PATCH 2/3] Fix test_post_message and add get_channel_id pipeline (#17) --- pipelines/channel/get_channel_id.fp | 23 +++++++++++++++++++++++ pipelines/chat/tests/test_post_message.fp | 15 +++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 pipelines/channel/get_channel_id.fp diff --git a/pipelines/channel/get_channel_id.fp b/pipelines/channel/get_channel_id.fp new file mode 100644 index 0000000..9322f51 --- /dev/null +++ b/pipelines/channel/get_channel_id.fp @@ -0,0 +1,23 @@ +pipeline "get_channel_id" { + title = "Get Channel ID" + description = "Get the ID from the channel name." + + param "cred" { + type = string + description = local.cred_param_description + default = "default" + } + + param "channel_name" { + type = string + description = "Name of the channel." + } + + step "pipeline" "list_channels" { + pipeline = pipeline.list_channels + } + + output "channel_id" { + value = [for channel in step.pipeline.list_channels.output.channels : channel.id if channel.name == param.channel_name][0] + } +} diff --git a/pipelines/chat/tests/test_post_message.fp b/pipelines/chat/tests/test_post_message.fp index ace4841..7fbf6e2 100644 --- a/pipelines/chat/tests/test_post_message.fp +++ b/pipelines/chat/tests/test_post_message.fp @@ -1,4 +1,4 @@ -// usage: flowpipe pipeline run test_post_message --pipeline-arg message="Hello World" +// usage: flowpipe pipeline run test_post_message --arg text="Hello from test_post_message" --arg channel="random" pipeline "test_post_message" { title = "Test Post Message" description = "Test the post_message pipeline." @@ -9,7 +9,7 @@ pipeline "test_post_message" { default = "default" } - param "message" { + param "text" { type = string default = "Hello World from test_post_message pipeline." description = "The formatted text of the message to be published." @@ -25,7 +25,14 @@ pipeline "test_post_message" { args = { cred = param.cred channel = param.channel - message = param.message + text = param.text + } + } + + step "pipeline" "get_channel_id" { + pipeline = pipeline.get_channel_id + args = { + channel_name = param.channel } } @@ -34,7 +41,7 @@ pipeline "test_post_message" { pipeline = pipeline.delete_message args = { cred = param.cred - channel = param.channel + channel = step.pipeline.get_channel_id.output.channel_id ts = step.pipeline.post_message.output.message.ts } } From a614539004bbb5ede5dd7d5816f0b94640da6944 Mon Sep 17 00:00:00 2001 From: souravTurbot <78197905+bigdatasourav@users.noreply.github.com> Date: Wed, 7 Feb 2024 17:23:45 +0530 Subject: [PATCH 3/3] Add changelog for v0.2.0 (#19) Co-authored-by: Ved misra <47312748+misraved@users.noreply.github.com> --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6468f1f..ba7583f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## v0.2.0 [2024-02-07] + +_What's new?_ + +- Added pipeline `get_channel_id`. ([#17](https://github.com/turbot/flowpipe-mod-slack/pull/17)). + +_Bug fixes_ + +- Fixed the input parameters of the `test_post_message` pipeline. ([#17](https://github.com/turbot/flowpipe-mod-slack/pull/17)) + ## v0.1.0 [2023-12-14] _What's new?_