Skip to content

Conversation

@Kami
Copy link
Member

@Kami Kami commented Jan 31, 2019

Just a quick hack which also includes information about new forum posts.

Before we can merge this, the whole pack will need a bit of re-thinking and refactor since right now it's designed for Github only use case.

I propose changing to a single rule and "post_daily_summary_rule" action combines data from the following actions:

  • Issues and PR stats for StackStorm and StackStorm-Exchange org
  • New forum posts
  • Anything else we might add later on

screenshot from 2019-01-31 15-31-20

@Kami Kami requested a review from bigmstone January 31, 2019 13:10
Kami added 5 commits January 31, 2019 16:48
data from multiple sources and renders it as a Slack message.

Also update Github issue and pr retrieval code so it's also more
efficient (we only retrieve issues once, filtering is performed server
side, etc).
@Kami Kami changed the title [WIP] Include information about new forum posts in a daily support summary report Include information about new forum posts in a daily support summary report Jan 31, 2019
@Kami
Copy link
Member Author

Kami commented Jan 31, 2019

Alright, I totally refactored the main action as per my comment above.

We now have one main action which is responsible to retrieve daily summary and statistics from various sources and then render it via Jinja template to be used as a Slack message.

In addition to that, I made many other changes and improvements:

  • We now only retrieve issues and PRs once. PRs are a type of issue, so there is no need to PRs separately. It affects API quota and it's slower.
  • Instead of performing time based filtering client side, we not perform it server side utilizing since query parameter. That's a lot more efficient and faster.
  • Message template is not stored in a file. It's much easier to manipulate it then compared to manipulating it inside a rule.

Even though everything is faster and more efficient now, I think it would probably still be a good idea to use some kind of per Github user / organization repo whitelist. Both organizations we query have tons of repos so it still results in a lot of API calls ( * <number of Github users we query info for).

I still plan to do some more refactoring and improvements, but that's a start which will enable us to more easily add data from other places / sources.

screenshot from 2019-01-31 17-02-22

@Kami
Copy link
Member Author

Kami commented Feb 4, 2019

Alright, I'm done with the refactoring and this PR is now ready to review.

I made everything more generic and composable. We now have 4 actions:

  1. get_github_issues - action which retrieves new github issues for a particular Github user / org.
  2. get_forum_posts - action which retrieves new forum posts.
  3. assemble_message - action which takes in data from previous actions and assembles Slack message by rendering a Jinja template.
  4. retrieve_data_and_send_daily_stats_to_slack (yes, it's mouthful) - workflow which ties all the pieces together and sends stats to Slack.

With those changes in place, it should also be relatively easy to add any addition / new info it (need to add new action which retrieves new data and update assemble_message, workflow and the Jinja template file).

Copy link
Contributor

@bigmstone bigmstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Make sure to bump pack version.

@Kami
Copy link
Member Author

Kami commented Feb 5, 2019

I need to apply some workaround until this PR is deployed to cicd - StackStorm/st2#4531.

Will revert those once that PR is deployed to cicd.

@Kami Kami merged commit 6206646 into master Feb 5, 2019
@Kami Kami deleted the add_forum_info branch February 5, 2019 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants