Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UseGalaxy Help Forum to Matrix channel Bot #4603

Merged
merged 8 commits into from
Dec 20, 2023
Merged

Conversation

mtekman
Copy link
Collaborator

@mtekman mtekman commented Dec 19, 2023

This is a Matrix bot written in Bash to fetch posts from https://help.usegalaxy.org that match certain tags, filter for less than N replies and post a nicely formatted table to a Matrix room of your choice.

Inspired by a great idea from @pavanvidem and @nomadscientist , and inspired further by @hexylena's Ruby bot.

I'm not sure if I'm adding it to the right location in the file system, or how/where to deploy it (other than running it from my own account on my own system), but here goes.

  This is a Matrix bot written in Bash to fetch posts from
  help.usegalaxy.org that match certain tags, filter for less than N
  replies and post to a Matrix room of your choice a nicely formatted
  table.

  Inspired by a great idea from @pavanvidem and some code from
  @hexylena's Ruby bot.
Copy link
Member

@hexylena hexylena left a comment

Choose a reason for hiding this comment

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

in bash! hilarious :)

I feel like it's a serialisation issue waiting to happen, but it's also not the worst if it fails for some reason. (and we'll just ping you to fix it after all). But otherwise this is pretty clean bash, I don't have any major issues with it. You could consider adding jq into the pipeline to help build the json, but that's about as painful as rewriting it in python/perl/ruby/any language with a proper json library/hash implementation.

I'm not sure if I'm adding it to the right location in the file system, or how/where to deploy it (other than running it from my own account on my own system), but here goes.

Yes this is the correct location! The deployment is via a github action, could you please copy .github/workflows/matrix.yml into something for your script?

@mtekman
Copy link
Collaborator Author

mtekman commented Dec 20, 2023

Yeah I was planning on shoving that final json through jq, but it kept turning my \" into " which annoyed me, so I left it out.

Still, I should at least test to see if it's a valid JSON and bail if not

@hexylena
Copy link
Member

Ping me when ya add the action (based on .github/workflows/matrix.yml is fine) and I'll merge it :)

@mtekman
Copy link
Collaborator Author

mtekman commented Dec 20, 2023

@hexylena ping! Though is there any way to check if the MATRIX_ACCESS_TOKEN=${MATRIX_ACCESS_TOKEN} line is needed? I guess it's already in the env and won't need to be re-set?

Also, I guess I need to add the GTN bot account to the room

@hexylena
Copy link
Member

MATRIX_ACCESS_TOKEN=${MATRIX_ACCESS_TOKEN}

should be redundant/nop, but yea MATRIX_ACCESS_TOKEN is the value set in github actino's config.

Also, I guess I need to add the GTN bot account to the room

yeah it's probably easier that way. I can log into the bot account and accept it, I haven't figured out how to manage that interaction yet (if you figure it out tho that'd be ace)

@mtekman
Copy link
Collaborator Author

mtekman commented Dec 20, 2023

Okay I'll remove the MATRIX_ACCESS_TOKEN in a later PR once I know the bot's working

I can log into the bot account and accept it, I haven't figured out how to manage that interaction yet (if you figure it out tho that'd be ace)

I just sent an invite if that helps

@hexylena
Copy link
Member

Accepted

hexylena
hexylena previously approved these changes Dec 20, 2023
Copy link
Member

@hexylena hexylena left a comment

Choose a reason for hiding this comment

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

Very cool. If this works I think it might be interesting for the admins too, we don't see those posts until @jennaj mentions them to us in the matrix channel

Co-authored-by: Helena <hexylena@galaxians.org>
@hexylena hexylena merged commit 3cb7dcc into main Dec 20, 2023
1 check passed
@hexylena hexylena deleted the matrixbot-galaxyhelp branch December 20, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants