java-slack-sdk icon indicating copy to clipboard operation
java-slack-sdk copied to clipboard

Add four workflow_* events support

Open seratch opened this issue 5 years ago • 11 comments

The following events will be publicly available on the Platform.

We add them in the same way with https://github.com/slackapi/java-slack-sdk/pull/650 , which means you add new classes in the following packages:

  • https://github.com/slackapi/java-slack-sdk/tree/v1.5.2/slack-api-model/src/main/java/com/slack/api/model/event
  • https://github.com/slackapi/java-slack-sdk/tree/v1.5.2/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler
  • https://github.com/slackapi/java-slack-sdk/tree/v1.5.2/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload

I will be working on this task early next week but if anyone is interested in working on this, I am happy to be a reviewer on it.

Category (place an x in each of the [ ])

  • [ ] bolt (Bolt for Java)
  • [ ] bolt-{sub modules} (Bolt for Java - optional modules)
  • [ ] slack-api-client (Slack API Clients)
  • [x] slack-api-model (Slack API Data Models)
  • [ ] slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • [x] slack-app-backend (The primitive layer of Bolt for Java)

Requirements

Please make sure if this topic is specific to this SDK. For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. :bow:

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to the those rules.

seratch avatar Jan 23 '21 03:01 seratch

Hi, @seratch I would like to resolve this bug, please assign it to me!

ThusithaDJ avatar Jan 24 '21 18:01 ThusithaDJ

Hi @ThusithaDJ, this is great! I have one thing to confirm before assigning you. We are committed to release this change within a few days (yeah, it's a bit tight schedule). Do you have time to make a draft pull request within one or two days? If so, I am happy to ask you to implement this! Otherwise, I will be working on this task. Let me know your thoughts.

seratch avatar Jan 24 '21 23:01 seratch

Hi @seratch, sorry for the late reply. Yes, I think I can do this. I will do the necessary changes withing today (GMT+5:30). So then you can review tomorrow. However, if it's really urgent, I can check some of your other issues while you are working on this. Please let me know your thoughts. Looking forward to contributing to an application that I use regularly.

ThusithaDJ avatar Jan 25 '21 11:01 ThusithaDJ

@ThusithaDJ Thanks for your reply. I will wait for your pull request but don't feel pressured! We're planning to release a new version with this addition by the end of this week at the latest.

seratch avatar Jan 25 '21 11:01 seratch

@seratch thanks a lot for the opportunity. I'll try my best to complete the changes as soon as possible.

ThusithaDJ avatar Jan 25 '21 20:01 ThusithaDJ

Hey @seratch, I would like to know what should be the JSON payload of these events. Is it the same as #650 changes?. And I noticed that there is an existing workflow_event class ( WorkflowStepExecuteEvent). Should I create these Event classes the same as that class or the same as #650?

Also, I faced some tests failure in the slack-api-client module when I executed the ./mvnw clean install command. But I didn't dig deep on that. If you need more details, please let me know.

ThusithaDJ avatar Jan 25 '21 22:01 ThusithaDJ

Should I create these Event classes the same as that class or the same as #650?

Of course, we are going to add new ones. You can subscribe to the new events and verify how the payloads are different. Checking https://github.com/slackapi/bolt-js/pull/768 should be helpful to know the payload structure.

Also, I faced some tests failure in the slack-api-client module when I executed the ./mvnw clean install command. But I didn't dig deep on that. If you need more details, please let me know.

What does the error look like?

seratch avatar Jan 25 '21 22:01 seratch

Thanks a lot. I'll check on that.

image

This was the output.

And here you can find one of the generate tests failure surefire-report. test_with_remote_apis.SimpleExampleTest.txt

ThusithaDJ avatar Jan 25 '21 22:01 ThusithaDJ

Running integration tests under test_with_remote_apis package requires a bit preparation. You need to have proper Slack app and workspace configuration using env variables. Some parts may be a bit outdated but please read this document first.

You don't need to run all the integration tests but I recommend having code to verify if it works in this sample app. We are not planning to add app.workflow* methods for this. Please add app.event listeners like app.event(WorkflowDeletedEvent.class, (req, ctx) -> {}).

seratch avatar Jan 25 '21 22:01 seratch

Some parts may be a bit outdated but please read this document first.

Oh, I'm sorry, it's kind of my bad not reading those guides beforehand. And thanks a lot. I'll follow those steps.

ThusithaDJ avatar Jan 25 '21 22:01 ThusithaDJ

Hey @seratch, I have created a PR with the changes. Will you be able to review it and let me know your feedback https://github.com/slackapi/java-slack-sdk/pull/671

ThusithaDJ avatar Jan 26 '21 22:01 ThusithaDJ