Add incremental mode support based on a 'last_commit' state, used to get
new package versions from git diff range of commits.
Related T4104
Differential D8101
crates.lister: Implement incremental mode franckbret on Jul 8 2022, 12:54 PM. Authored by
Details
Add incremental mode support based on a 'last_commit' state, used to get Related T4104
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes Comment Actions Make usage of dulwich for to replace some previous subprocess git commands. Comment Actions Build has FAILED Patch application report for D8101 (id=29382)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit e88a360a8b419a1dbc9bdac9f424420de89c1561 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. Link to build: https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/553/
Comment Actions @vlorentz I've replaced the vast majority of python subprocess call to git with dulwich api. By the way and as you can see in current code I did not found a suitable way to get something like "git log -p" output. When experimenting with it I've successfully retrieved a diff using dulwich.patch.write_tree_diff method, but the problem was that I was not able to get related commits ids... Without commit ids I can not set an accurate last_update... Do you have any ideas on how to accomplish something similar with Dulwich? Also CI is now broken on mypy step, what can I do to fix? 15:33:26 mypy run-test: commands[0] | mypy swh 15:33:38 swh/lister/crates/lister.py:15: error: Cannot find implementation or library stub for module named "dulwich" 15:33:38 swh/lister/crates/lister.py:16: error: Cannot find implementation or library stub for module named "dulwich.repo" Comment Actions
most likely this [1] would help you ;) [1] https://forge.softwareheritage.org/source/swh-loader-git/browse/master/mypy.ini$11-12 Comment Actions I don't think you need to compute text diffs at all, you can look at both files' content directly, parse each line, and compare them one-to-one (or put them in set objects and use .symmetric_difference() if you don't care about order)
Copy this from swh-loader-git/mypy.ini: [mypy-dulwich.*] ignore_missing_imports = True
Comment Actions Build has FAILED Patch application report for D8101 (id=29393)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit 7a36677dbffb4e81cebfe2efb07c8b4478074795 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. Link to build: https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/555/
Comment Actions Build is green Patch application report for D8101 (id=29399)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit 05a711c131f0b944e45751866894cda749c11c07 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/556/ for more details.
Comment Actions Change the way we list origins in incremental mode It now returns all versions of a package when we detect a new version. Comment Actions Build is green Patch application report for D8101 (id=29414)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit 00577233f35c475eccc4c246232647263b5d2cf4 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/557/ for more details. Comment Actions Build is green Patch application report for D8101 (id=29418)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit 285df1a9996b1c5d3ae2a06524ab80f5bfb8f567 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/558/ for more details.
Comment Actions Add 'yanked' to artifacts data 'yanked' is a flag used to determine if a package version has been unreleased Comment Actions Build is green Patch application report for D8101 (id=29419)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit fd842ccb74be33887fffe9a96f35109001076ba0 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/559/ for more details. Comment Actions Don't forget these: (and this diff's title too, to be consistent with the commit title) That's not the right place; this format is meant to describe tarballs: https://docs.softwareheritage.org/devel/swh-storage/extrinsic-metadata-specification.html#original-artifacts-json
Comment Actions Some changes and a new test Remove dead code Comment Actions Build is green Patch application report for D8101 (id=29422)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit b2a868f4061fb5194c9898ccb1b489d0fd19d579 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/560/ for more details. Comment Actions Build is green Patch application report for D8101 (id=29424)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit 4d9b91b9f199a3283a0aee8d255eb8cdb1bcde20 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/561/ for more details.
Comment Actions Build is green Patch application report for D8101 (id=29440)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit 64b3a8fd6a0e50b52f1e10f5f60753ccc78198df Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/562/ for more details. Comment Actions Build is green Patch application report for D8101 (id=29442)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit 50f7fd9687333bdafd3f7e510aded5d1f81afd86 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 Crates lister implements incremental mode Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/563/ for more details. Comment Actions Move 'yanked' information from 'artifacts' to 'metadata'' Comment Actions Build is green Patch application report for D8101 (id=29493)Rebasing onto 1bf11aa26d... Current branch diff-target is up to date. Changes applied before testcommit b90176e55c988509dcd4bf50215dfb3eef67dd14 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 crates: Implement incremental listing Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/567/ for more details. Comment Actions lgtm couple of suggestions inline.
Comment Actions (I've dropped val from reviewers since they are in vacation and you attended most if not all of their request changes.) Comment Actions Thanks. I'm not a huge fan of the name, 'metadata' is already an overloaded term. What about crates_metadata, to make it clear this is a format specific to this lister? Comment Actions Fix some typos
Comment Actions Build is green Patch application report for D8101 (id=29578)Rebasing onto d34a6232a6... First, rewinding head to replay your work on top of it... Applying: crates.lister: Implement incremental mode: Changes applied before testcommit 51e4c9d804d886446682f3b6c6c168abef7affc7 Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 crates.lister: Implement incremental mode: Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/571/ for more details. Comment Actions Build is green Patch application report for D8101 (id=29586)Rebasing onto d34a6232a6... Current branch diff-target is up to date. Changes applied before testcommit a6f796b26867a078f44825a82ca71942f12eed7b Author: Franck Bret <franck.bret@octobus.net> Date: Fri Jul 8 12:46:11 2022 +0200 crates.lister: Implement incremental mode: Add incremental mode support based on a 'last_commit' state, used to get new package versions from git diff range of commits. See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/572/ for more details. |