Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Save patches dropped by filtering #102

Merged
merged 3 commits into from
Jul 9, 2018
Merged

Save patches dropped by filtering #102

merged 3 commits into from
Jul 9, 2018

Conversation

veruu
Copy link
Contributor

@veruu veruu commented Jul 4, 2018

Dropped patches are always rechecked if no new patch passed the filter
script. Instead, save them as seen so they aren't checked all over again
each time.

Extract retrieving the info tuple and series IDs into separate method
(get_patch_info_from_url), which can be then used in both the original
place (saving tested patches) and when saving the dropped patches.

Fixes #100

Signed-off-by: Veronika Kabatova vkabatov@redhat.com

@coveralls
Copy link

coveralls commented Jul 4, 2018

Pull Request Test Coverage Report for Build 322

  • 10 of 30 (33.33%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.7%) to 57.051%

Changes Missing Coverage Covered Lines Changed/Added Lines %
sktm/db.py 6 7 85.71%
sktm/init.py 1 20 5.0%
Files with Coverage Reduction New Missed Lines %
sktm/init.py 1 32.48%
sktm/db.py 1 97.45%
Totals Coverage Status
Change from base Build 289: -0.7%
Covered Lines: 712
Relevant Lines: 1248

💛 - Coveralls

Copy link
Contributor

@spbnick spbnick left a comment

Choose a reason for hiding this comment

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

OMG, I just read the whole thing with generating the series ID to store in the patches table. Argh.

Can we just rip that out first and then do this change?
It doesn't make sense to just pull out the series_id out of our a** and store it, and nothing is using it anyway.

I.e. remove the series_id column (from new databases), and remove all code adding it (it will just add as empty string to existing tables, I tested that).

Then hopefully the code will be simpler. What do you think?

@spbnick
Copy link
Contributor

spbnick commented Jul 5, 2018

BTW, thanks for pulling this through, the code must have been a pain to figure out. Perhaps we should reduce our further suffering by just removing the series_id storage.

@veruu
Copy link
Contributor Author

veruu commented Jul 5, 2018

@spbnick yeah, that's related to issue #80. I still need to work on that one and it's pretty hard to unwind all the parts (wouldn't be opposed to getting more help), but since this seemed like a higher priority task to fix, I did this first (since the DB one would take a loong time).

Can you add your comment about getting rid of series ID to that issue, so we can track it properly where it belongs, or even submit a pull for that change? If you are too busy to do the change on top of this patch, just copy the comment and I'll enhance this pull next week.

It's not used anywhere and totally useless since for PW1 it's created on
the fly and not representing anything.

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
@veruu veruu force-pushed the db branch 3 times, most recently from 3ce48e6 to 80bb2af Compare July 9, 2018 12:03
@veruu
Copy link
Contributor Author

veruu commented Jul 9, 2018

@spbnick added the series_id removal

sktm/__init__.py Outdated
interface: Interface of the Patchwork project the patch belongs to.
patch_url: URL of the patch to retrieve info tuple for.

Returns: Tuple of the patch info tuple (patch_id, patch_name,
Copy link
Contributor

Choose a reason for hiding this comment

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

This piece got a bit stuck in the past, I assume. Not required for my ACK.

sktm/__init__.py Outdated
"""
match = re.match(r'(.*)/patch/(\d+)$', patch_url)
if not match:
raise Exception('Malfomed patch url: %s' % patch_url)
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo, should be "Malformed". Not required for my ACK.

veruu added 2 commits July 9, 2018 16:58
Dropped patches are always rechecked if no new patch passed the filter
script. Instead, save them as seen so they aren't checked all over again
each time.

Extract retrieving the info tuple into separate method
(get_patch_info_from_url), which can be then used in both the original
place (saving tested patches) and when saving the dropped patches.

Fixes cki-project#100

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
We have real migration scripts now, no need to keep the file.

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
Copy link
Contributor

@spbnick spbnick left a comment

Choose a reason for hiding this comment

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

Thanks a lot, Veronika, it works 😄!

@spbnick
Copy link
Contributor

spbnick commented Jul 9, 2018

Ah, two comments on commit organization, which we can improve in future PRs:

  • "Remove .placeholder file from db_migrations" should have been squashed with "Remove series_id from patch table", so that the directory wouldn't disappear if we revert/merge only the latter.
  • "Save patches dropped by filtering" might have been better done in two commits: one extracting the function, and one adding dropped patch storage, so that if we drop the latter, we could still benefit from improved readability.

@spbnick spbnick merged commit 97d0046 into cki-project:master Jul 9, 2018
@veruu
Copy link
Contributor Author

veruu commented Jul 9, 2018

We already had one migration in place (yeah, the placeholder should have been removed with that one but it wasn't). agree with the second comment and will try to remember it for the future!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants