Commit graph

958 commits

Author SHA1 Message Date
Antoine R. Dumont (@ardumont)
fbfdf88ea4
nixguix: Add lister
Related to T3781
2022-10-03 18:26:36 +02:00
Antoine Lambert
fa1205c4df Send package artifact checksums to loaders when info is available
In listers collecting artifacts for each package to load, add artifacts
checksums, when that info is available, in parameters sent to loaders
in order to check downloaded artifact integrity.
2022-09-30 18:44:11 +02:00
Franck Bret
6f40d2c1a5 Conda: switch artifacts from dict to list
'artifacts' extra_loader_arguments should be a list
2022-09-30 15:55:53 +02:00
Franck Bret
52ccf49e11 RubyGems: List origins from https://rubygems.org
Related T1777
2022-09-29 14:19:06 +02:00
Antoine Lambert
dabb1a2ae5 Update instructions for running a lister in docker
Prefer to execute lister through a celery task as it also enables to
catch possible issues with task implementation.

Also use docker compose v2 commands.
2022-09-29 11:26:40 +02:00
Antoine Lambert
5426883c49 debian: Remove no longer needed code to get accurate origins count
The base lister class now ensures the count of listed origins will
be accurate.
2022-09-29 11:14:42 +02:00
Antoine Lambert
8d85b2e4e8 pattern: Ensure accurate origin counts returned by run method
Previously, the run method was returning the total count of ListedOrigin
objects sent to scheduler database.

However, some listers can send multiple ListedOrigin objects for a given
origin URL during the listing process, for instance when an origin is
contained in multiple pages (e.g. gogs listing) or when the listing
is gathering multiple versions of an origin spread across multiple
pages (e.g. maven listing).

This changes ensures an accurate count of listed origins by maintaining
a set of origin URLs associated to the sent ListedOrigin objects.
2022-09-29 11:14:08 +02:00
Franck Bret
3928fc9ee9 Nuget: Lister for NuGet the package manager for .NET
Related T1718
2022-09-27 14:56:36 +02:00
Franck Bret
cd596eb2b4 Puppet: Lister for Puppet modules
The puppet lister retrieves origins from from https://forge.puppet.com/modules

Related T4519
2022-09-27 14:44:13 +02:00
Franck Bret
a4aec3894e Cpan: List Perl module origins from cpan.org
Related T2833
2022-09-27 14:29:33 +02:00
Franck Bret
6696a8424a Hackage: List origins from hackage.haskell.org, The Haskell Package Repository
Use http api point to get package names and build origin urls.
2022-09-27 14:22:03 +02:00
Franck Bret
8ff418fbc2 Conda: List origins for Anaconda, the package manager that provides tooling for datascience
Related T4547
2022-09-27 14:17:26 +02:00
Antoine R. Dumont (@ardumont)
fd1a4244a0
cgit/tests: Rename readme.md to readme
With the extension, the readme is included in the swh-docs build and fails. It's not
intended for the documentation build so renaming it keep it out of the doc build loop.

This fixes build [1].

[1] https://jenkins.softwareheritage.org/view/all/job/DDOC/job/dev/2395/
2022-09-26 13:22:10 +02:00
Antoine Lambert
d5c30a3ce3 Update value of User-Agent HTTP request header used by listers
That HTTP header value will now contain the lister name but also a link
to our contact form in order for sysadmins to easily reach us if needed.

The following template is used to generate it:

"Software Heritage <lister_name> lister v<swh-lister version>
 (+https://www.softwareheritage.org/contact)"
2022-09-26 10:48:40 +02:00
Antoine Lambert
db6ce12e9e Refactor and deduplicate HTTP requests code in listers
Numerous listers were using the same page_request method or equivalent
in their implementation so prefer to deduplicate that code by adding
an http_request method in base lister class: swh.lister.pattern.Lister.

That method simply wraps a call to requests.Session.request and logs
some useful info for debugging and error reporting, also an HTTPError
will be raised if a request ends up with an error.

All listers using that new method now benefit of requests retry when
an HTTP error occurs thanks to the use of the http_retry decorator.
2022-09-26 10:48:40 +02:00
Antoine Lambert
9c55acd286 Use generic HTTP retry policy by default and rename dedicated decorator
Instead of retrying HTTP requests only for 429 status code by default,
prefer to use the generic retry policy enabling to also retry for status
codes >= 500 but also on ConnectionError exceptions.

Rename throttling_retry decorator to http_retry to reflect this change.
2022-09-26 10:48:40 +02:00
Vincent SELLIER
9b3e565cf7
cgit: Ensure the clone url is searched on the right tab
For some forges, the default tab for a repository detail is not the
summary tab so the clone urls are not detected and the repository
is ignored

Related to T4544
2022-09-20 17:01:49 +02:00
KShivendu
bd35d54398 gogs: Skip pages with error 500
This also affects the gitea lister
2022-09-20 19:05:20 +05:30
Antoine Lambert
fa65f270ed golang: Update lister name
Align with other lister names by turning it to lowercase.
2022-09-19 13:17:40 +02:00
Antoine Lambert
f1a1b30fd1 arch: Set log level to debug for URL requests 2022-09-13 12:09:13 +02:00
Antoine Lambert
a55f171ed5 arch: Use tempfile module to create temporary directory
It ensures created temporary directories will be removed once they
are no longer needed.
2022-09-13 12:08:02 +02:00
Antoine R. Dumont (@ardumont)
67211adb60
pubdev.lister: Decrease verbosity
This matches other lister verbosity.

Related to T4517
2022-09-09 12:31:43 +02:00
Antoine Lambert
c819cc237d pubdev: Update User-Agent request header value
Use a value that matches good practice recommended by pub.dev REST API doc.

https://github.com/dart-lang/pub/blob/master/doc/repository-spec-v2.md
2022-09-07 12:15:34 +02:00
Antoine Lambert
44560c2383 pubdev: Retrieve last publication date for each listed package
In order to get a last_update for each ListedOrigin sent to scheduler
database, send an extra HTTP request for each listed package to the
/api/packages/<package_name> endpoint of pub.dev API.

A pub.dev developer inform us that endpoint is heavily used and cached
so there is no particular issues to query that endpoint for each package
in a row periodically.
2022-09-02 16:50:12 +02:00
Antoine Lambert
49b79b0759 pubdev: Modify origin URL for listed packages
Use https://pub.dev/packages/<package_name> instead of
https://pub.dev/api/packages/<package_name>
2022-09-02 16:48:29 +02:00
Antoine Lambert
b6c69e5075 aur: Create also a git origin for each listed package repository
It will enable to archive the history of the PKGBUILD file associated
to the AUR package.
2022-09-02 15:58:05 +02:00
Antoine Lambert
d76fbb3447 aur: Modify origin URL for listed packages
Use https://aur.archlinux.org/packages/<package_name> instead
of https://aur.archlinux.org/<package_name>.git
2022-09-02 15:57:57 +02:00
Antoine Lambert
92baa2b45c aur: Store packages index in memory instead of disk
Simplify code for downloading packages index as gzip and deflate
transfer-encodings are automatically decoded by requests, also
do not stream response for a couple of megabytes and store
HTTP responses in memory.

Also add more debug logs to track lister execution.
2022-09-02 15:48:20 +02:00
Antoine Lambert
7638f2028b golang/tests: Fix black formatting 2022-09-01 11:47:35 +02:00
Raphaël Gomès
c6ce862d32 Add incremental function to Golang Lister 2022-08-30 14:32:18 +02:00
Raphaël Gomès
60405e78ae Add non-incremental Golang modules lister
This uses https://index.golang.org. An associated loader will be sent in
the near future, as well as an incremental version of this lister.

[1] https://go.dev/ref/mod#goproxy-protocol
2022-08-30 14:32:02 +02:00
Franck Bret
0acf5b0f4f Arch: Add throttling retry for scrapping and resources download 2022-08-30 09:50:29 +02:00
Franck Bret
b7b11887a0 Bower: Set VISIT_TYPE as 'git'
Origins url for Bower are git repositories. Set the VISIT_type as 'git'.
No need for a specific 'Bower' package loader.
2022-08-29 17:15:09 +02:00
Franck Bret
ceae8c42b5 Bower: List origins from registry.bower.io 2022-08-29 15:55:00 +02:00
Franck Bret
5410b6e3f3 Pub.dev lister for Dart and Flutter packages
Stateless lister for https://pub.dev based on http api to list package names
2022-08-26 10:24:08 +02:00
Valentin Lorentz
ce72969de5 aur: Simplify pathlib logic 2022-08-25 09:41:50 +02:00
Valentin Lorentz
766fbbcc91 arch: Un-nest long method 2022-08-25 09:41:44 +02:00
Valentin Lorentz
b7ec6cb120 tests: Simplify origin comparison and improve pytest diff on failure
By using a single equality instead of checking len() then zip()
to check one by one, pytest can find the common/missing elements
and print them nicely when the two lists are unequal.
2022-08-24 17:21:24 +02:00
Valentin Lorentz
4b511b4181 arch: Use lazy interpolation in logging statements 2022-08-23 13:43:07 +02:00
Valentin Lorentz
31c44330e8 gogs: Lower unnecessarily verbose logging statement 2022-08-23 13:40:19 +02:00
Valentin Lorentz
17a219ece0 gitea: Inherit from Gogs lister
This removes code and adds support for incremental pagination.

While both are essentially the same lister now, it still makes sense to
keep the Gitea lister separate, in order to:

1. display them in different categories on https://archive.softwareheritage.org/
2. support possible divergence of APIs in the future
2022-08-23 13:38:32 +02:00
Valentin Lorentz
dde7865ac4 arch: Fix broken ref 2022-08-19 19:07:55 +02:00
Franck Bret
7dd412e553 arch: Extra_loader_arguments consistency + documentation
Split extraloader_arguments artifacts to artifacts and arch_metadata
Add lister documentation at module level

Related T4233
2022-08-19 15:43:58 +02:00
Valentin Lorentz
3ab90cc0cd aur: Fix broken ref 2022-08-19 14:14:37 +02:00
Franck Bret
97b353bf0b Arch User Repository (AUR) lister
Add 'aur' module to swh-lister with data fixtures and tests.
For now, origin url are package vcs (Git) url.
2022-08-19 12:43:15 +02:00
KShivendu
6a53a6ad06 feat: Make the Gogs lister incremental 2022-08-17 15:01:32 +05:30
Antoine Lambert
cee6bcb514 maven: Use BeautifulSoup instead of xmltodict for parsing pom files
xmltodict cannot parse POM files with multi-byte encoding so prefer to
use the XML parser of BeautifulSoup based on lxml instead.

Also drop xmltodict requirement as it is no longer used in swh-lister
codebase.
2022-08-09 11:11:45 +02:00
Valentin Lorentz
d51bce0a1c crates: Fix broken ref 2022-08-08 20:43:54 +02:00
Franck Bret
751c3df1b7 crates: Add a developer documentation at module level
Mainly move documentation content from docs/user to crates module
(See D8199 for details)

Related T4104
2022-08-08 14:48:45 +02:00
Franck Bret
a6f796b268 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.
2022-08-05 13:41:57 +02:00