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

Revision.tag field is not trimmed before insert #242

Closed
quasilyte opened this issue Apr 5, 2018 · 0 comments
Closed

Revision.tag field is not trimmed before insert #242

quasilyte opened this issue Apr 5, 2018 · 0 comments

Comments

@quasilyte
Copy link
Contributor

quasilyte commented Apr 5, 2018

Seems like release tags are not truncated before insertion.
This is a trouble for git integration as it inserts tags with a trailing newline:

SELECT tag FROM codespeed_revision WHERE tag like 'go1.7%';
-- =>
-- "go1.7
-- "
-- "go1.7.1
-- "
-- "go1.7.2
-- "
-- "go1.7.3
-- "
-- "go1.7.4
-- "
-- "go1.7.5
-- "
-- "go1.7.6
-- "

So, query like this will return nothing:

SELECT tag FROM codespeed_revision WHERE tag = 'go1.7';
-- =>
-- No results

But this query will find desired row:

SELECT tag FROM codespeed_revision WHERE tag = E'go1.7\n';
-- =>
-- "go1.7
-- "

This may have several workarounds, but it's still better to store trimmed tags.
Leading and trailing whitespace should not be significant here.

Or maybe git log parser could trim tag string, this way, no changes to models are required (if we are sure that there are no similar issues with other VSC).

-  'tag': tag
+  'tag': tag.strip()

For extra context: I'm using postgresql for Codespeed database.

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

No branches or pull requests

1 participant