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 a dry run flag to ensure we don't accidentally send out invites when testing #209

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

H-Shay
Copy link
Contributor

@H-Shay H-Shay commented Jan 12, 2024

Adds a flag to seal off sending live emails/invites, making testing less risky.

@H-Shay H-Shay requested a review from a team as a code owner January 12, 2024 23:37
Copy link
Contributor

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

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

I'm a little worried about checking in code that disables the invite logic, if we can figure out a flag instead that would make this more valuable.

src/IRCBridge.ts Show resolved Hide resolved
src/invites.ts Outdated
@@ -80,7 +80,8 @@ export async function resolveIdentifiers(client: ConferenceMatrixClient, people:

export async function invitePersonToRoom(client: ConferenceMatrixClient, resolvedPerson: ResolvedPersonIdentifier, roomId: string): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can slip in a dry-run flag in the config, and just skip this function if so? Worst case, maybe we just override the inviteUser function in ConferenceMatrixClient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A dry run flag is a much better approach - I've added one, let me know what you think.

@H-Shay H-Shay requested a review from Half-Shot January 16, 2024 19:22
Copy link
Contributor

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

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

Looks great. I've suggested we log that we log dry run when dry running a command to prevent confusion (esp if we toggle it on/off).

Feel free to merge when you're happy!

src/invites.ts Outdated Show resolved Hide resolved
src/invites.ts Outdated Show resolved Hide resolved
config/default.yaml Outdated Show resolved Hide resolved
@H-Shay H-Shay merged commit 7189eb1 into main Jan 16, 2024
5 checks passed
@H-Shay H-Shay deleted the shay/safe_4_testing branch January 16, 2024 23:38
@H-Shay
Copy link
Contributor Author

H-Shay commented Jan 16, 2024

Merged #209 into main.

@H-Shay H-Shay changed the title Ensure we don't accidentally send out invites when testing Add a dry run flag to ensure we don't accidentally send out invites when testing Jan 16, 2024
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