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

Refactor/google workspace service #388

Merged
merged 11 commits into from
Feb 1, 2024
Merged

Conversation

gcharest
Copy link
Contributor

Summary | Résumé

  • Setting up the google service resource as a reusable standalone function
  • Configuring with new service account creds

@gcharest gcharest requested a review from a team January 31, 2024 22:02
@gcharest gcharest self-assigned this Jan 31, 2024
Copy link

github-actions bot commented Jan 31, 2024

GitHub Action status on cfb7fec generated by comment-failure-action

Lint, format and test code

job url
null https://github.com/cds-snc/sre-bot/actions/runs/7732937156/job/21083983489

Build containers CI

No jobs failed 👍

"cwd": "${workspaceFolder}/app"
}
]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean to commit the debugger configuration file? It might be intended, so I just want to make sure in case it was not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should be made available so that we can use it in the Codespaces without fiddling around

Copy link
Contributor

@sylviamclaughlin sylviamclaughlin Feb 1, 2024

Choose a reason for hiding this comment

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

Sounds good! Thank you for answering!

)
.execute()
)
return results.get("files", [])
Copy link
Contributor

Choose a reason for hiding this comment

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

I take it that you will add all the other functions to do with the google drive such as writing to an excel file or a google document, later on right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that will need to be porte over once the service is properly configured

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, this is for testing purposes so maybe I should make it available only when the dev- prefix is used

@@ -47,6 +47,8 @@ def sre_command(ack, command, logger, respond, client, body):
webhook_helper.handle_webhook_command(args, client, body, respond)
case "version":
respond(f"SRE Bot version: {os.environ.get('GIT_SHA', 'unknown')}")
case "google-service":
google_service.google_service_command(client, body)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just so that I understand this, the google_service_command lists the available folders correct (ie runs list-folders)? I assume that this is just for testing and will be removed at a later point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's also for development purposes so we could make it available only when the dev- prefix is called

@@ -26,6 +26,10 @@ def main(bot):
APP_TOKEN = os.environ.get("APP_TOKEN")
PREFIX = os.environ.get("PREFIX", "")

# Register Google Service command
bot.command(f"/{PREFIX}google-service")(google_service.google_service_command)
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, I assume this is in place just for testing, correcting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly!

@gcharest gcharest merged commit 754d476 into main Feb 1, 2024
4 checks passed
@gcharest gcharest deleted the refactor/GoogleWorkspaceService branch February 1, 2024 13:37
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.

2 participants