feat(#590): add "Testing Version" column to todo lists#675
Open
m1rm wants to merge 1 commit into
Open
Conversation
…ude new fixtures for todolist dev(archlinux#590): add missing fixtures for todo lists cleanup ci/cd: fix ruff
c632ea0 to
970c545
Compare
Member
christian-heusel
left a comment
There was a problem hiding this comment.
Thanks a lot for working on this! 🤗 🚀 I have two small questions and will defer to the project maintainers for the overall verdict! 😄
| # now build a lookup dict to attach to the correct package | ||
| lookup = {(p.pkgname, p.arch): p for p in testing_pkgs} | ||
|
|
||
| annotated = [] |
Member
There was a problem hiding this comment.
This seems to be unused, why is it there? 🤔
I see that it's also part of the logic in attach_staging(), but maybe you have some context of it now that you worked on attach_testing().
Comment on lines
+60
to
+75
| def attach_testing(packages, list_id): | ||
| '''Look for any testing version of the packages provided and attach them | ||
| to the 'testing' attribute on each package if found.''' | ||
| pkgnames = TodolistPackage.objects.filter( | ||
| todolist_id=list_id).values('pkgname') | ||
| testing_pkgs = Package.objects.normal().filter(repo__testing=True, | ||
| pkgname__in=pkgnames) | ||
| # now build a lookup dict to attach to the correct package | ||
| lookup = {(p.pkgname, p.arch): p for p in testing_pkgs} | ||
|
|
||
| annotated = [] | ||
| for package in packages: | ||
| in_testing = lookup.get((package.pkgname, package.arch), None) | ||
| package.testing = in_testing | ||
|
|
||
| return annotated |
Member
There was a problem hiding this comment.
Would it be an option to refactor attach_staging() to use a parameter to keep the overall code more DRY?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the column "Testing Version" to /todos/:a_list containing the version of the package in the Testing Repo, if present.
Additionally, fixtures and tests are added.
Closes #590