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

Actually store latest known version cursor #873

Merged

Conversation

nphilipp
Copy link
Member

This is a little embarassing but #863 doesn't really store the latest known cursor because of a bug in check_project_release(). Additionally to fixing this, improve the GitHub tests and migration script and be a little more strict about accepted API responses.

Zlopez
Zlopez previously approved these changes Dec 20, 2019
@codecov-io
Copy link

codecov-io commented Dec 20, 2019

Codecov Report

Merging #873 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #873      +/-   ##
==========================================
+ Coverage   97.32%   97.32%   +<.01%     
==========================================
  Files          61       61              
  Lines        3696     3697       +1     
  Branches      498      499       +1     
==========================================
+ Hits         3597     3598       +1     
  Misses         58       58              
  Partials       41       41
Impacted Files Coverage Δ
anitya/lib/backends/github.py 99.14% <100%> (ø) ⬆️
anitya/db/models.py 100% <100%> (ø) ⬆️
anitya/lib/utilities.py 94.39% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d9036b...f772911. Read the comment docs.

@nphilipp
Copy link
Member Author

Hang on, aside from the news file I need to figure out what the issue with coverage is here.

@nphilipp nphilipp force-pushed the master--github-cursors-electric-boogaloo branch 2 times, most recently from c743991 to cefecea Compare December 20, 2019 19:09
@Zlopez
Copy link
Contributor

Zlopez commented Dec 20, 2019

Could you squash the commits, when you think this is ready for merge?

@nphilipp nphilipp force-pushed the master--github-cursors-electric-boogaloo branch from cefecea to 584e355 Compare December 20, 2019 20:13
@nphilipp
Copy link
Member Author

Could you squash the commits, when you think this is ready for merge?

Of course.

@nphilipp nphilipp force-pushed the master--github-cursors-electric-boogaloo branch from 584e355 to bdfec9f Compare December 20, 2019 20:22
@nphilipp
Copy link
Member Author

And this is it with the commits squashed, except the one fixing an unrelated typo.

@nphilipp nphilipp force-pushed the master--github-cursors-electric-boogaloo branch from bdfec9f to 9b612dc Compare December 20, 2019 20:24
Zlopez
Zlopez previously approved these changes Dec 20, 2019
@lgtm-com
Copy link

lgtm-com bot commented Dec 20, 2019

This pull request introduces 1 alert when merging 9b612dc into 4d9036b - view on LGTM.com

new alerts:

  • 1 for Unused import

Unit tests only help if you test all involved units. ;)

Additionally:
- Rename Project.latest_known_cursor to latest_version_cursor. This
  makes it more obvious that the latest version and cursor belong
  together.
- Improve GitHub JSON tests
  - split up test_parse_json() and reuse test project between them
  - add missing cursor info to response
  - use .assertRaises as a context manager
- Fail if cursor is missing from GitHub API response.
  With the GraphQL API, responses are guaranteed to contain all the
  queried fields. Previously, we worked around it missing because we had
  old mock data from before it was introduced. Since we refreshed the
  mock data, we can be more strict about what to expect as responses.
- Make dropping column work on SQLite with previous migration script.
  SQLite doesn't support dropping columns, so use Alembic's batch
  operation to recreate the table with the column dropped.
  See https://alembic.sqlalchemy.org/en/latest/batch.html for details.
- Rename the news file to refer to the right PR

Fixes: fedora-infra#589

Signed-off-by: Nils Philippsen <[email protected]>
@nphilipp nphilipp force-pushed the master--github-cursors-electric-boogaloo branch from 9b612dc to f772911 Compare December 20, 2019 20:49
@nphilipp
Copy link
Member Author

That's what I get for committing without running flake8 myself, sorry. 😉

@Zlopez
Copy link
Contributor

Zlopez commented Dec 20, 2019

Yeah, it's good to have it in tests

@mergify mergify bot merged commit 299701f into fedora-infra:master Dec 20, 2019
@nphilipp nphilipp deleted the master--github-cursors-electric-boogaloo branch December 20, 2019 22:10
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