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

fix: don't upsert empty tags as valid value #1025

Merged
merged 4 commits into from
Sep 27, 2023

Conversation

rdimitrov
Copy link
Member

Fixes an issue of pushing an empty string as valid (causing len(tags) !=0) in case there was only one tag previously and we removed it upon update.

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
@JAORMX
Copy link
Contributor

JAORMX commented Sep 26, 2023

Should we add a quick test for this? https://github.com/stacklok/mediator/blob/main/internal/controlplane/handlers_githubwebhooks_test.go shows some examples of mocking the database.

evankanderson
evankanderson previously approved these changes Sep 26, 2023
internal/controlplane/handlers_githubwebhooks.go Outdated Show resolved Hide resolved
@evankanderson
Copy link
Member

And +1 on adding a test of some sort.

Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com>
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
@rdimitrov
Copy link
Member Author

Should we add a quick test for this? https://github.com/stacklok/mediator/blob/main/internal/controlplane/handlers_githubwebhooks_test.go shows some examples of mocking the database.

I'm up for that but let's park it for later 👍 I remember we've talked about this previously when I started creating tests for this exact context and we've decided to leave it for when we refactor the codebase to not be so finicky to mock.

Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com>
Copy link
Contributor

@JAORMX JAORMX left a comment

Choose a reason for hiding this comment

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

I now recall the conversation of it not being trivial to realistically test and us agreeing on doing so via smoke tests instead. I'll hurry thay work up

@rdimitrov rdimitrov merged commit 1f28744 into mindersec:main Sep 27, 2023
12 checks passed
@rdimitrov rdimitrov deleted the fix-empty-tags-upsert branch September 27, 2023 07:30
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