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

Delete messages matching the given regex. Fixes #32 #33

Merged
merged 2 commits into from
Oct 1, 2021

Conversation

icy95
Copy link
Contributor

@icy95 icy95 commented Jan 2, 2021

No description provided.

@icy95 icy95 changed the title Delete messages matching the given regex Delete messages matching the given regex. Fixes #32 Jan 2, 2021
@thedaviddias
Copy link

Would love to see this merged. Any ETA? @ibrahimcanyilmaz

Copy link
Contributor

@sadikkuzu sadikkuzu left a comment

Choose a reason for hiding this comment

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

.

@aaronklaassen aaronklaassen merged commit 2a47e0c into unsplash:master Oct 1, 2021
@@ -54,4 +55,12 @@ if check_duplicate_msg == "true"
end
end

if delete_prev_regex_msg != nil
coms.each do |n|
Copy link

Choose a reason for hiding this comment

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

I believe it's possible for coms to be nil here (if check_duplicate_msg is false), making the script error out. Can someone have a look?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. I'll fix it.

Choose a reason for hiding this comment

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

Not sure if this the root but we are seeing an issue when we pass msg="something", check_for_duplicate_msg="false" and delete_prev_regex_msg="nil":

/entrypoint.sh:60:in <main>': undefined method each' for nil:NilClass (NoMethodError)

Copy link
Member

@aaronklaassen aaronklaassen Oct 1, 2021

Choose a reason for hiding this comment

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

@genevieve Oh; because those get passed in as strings - "false", and "nil", not actually false and nil. Which means that they're truthy. Removing the params entirely will give you actual nil/falsey values.

#43

Copy link

@genevieve genevieve Oct 1, 2021

Choose a reason for hiding this comment

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

Ah it's because we use the image in a github action so even though we pass false or nothing, it will quote them before passing them as arguments to the docker command. Thanks, we'll drop them entirely.

Choose a reason for hiding this comment

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

Actually, this is happening for us regardless of whether we rely on the defaults or not because of the way that the github action passes the values to the docker command. We weren't explicitly setting delete_prev_regex_msg and it would pass in "nil".

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.

6 participants