diff --git a/cypress/e2e/origin-save.cy.js b/cypress/e2e/origin-save.cy.js index 23f9e75494bc5075c44f66433e3339aada9554b6..390c3070cc63888ee89c43bd3f29b3410a17203a 100644 --- a/cypress/e2e/origin-save.cy.js +++ b/cypress/e2e/origin-save.cy.js @@ -22,8 +22,8 @@ const saveCodeMsg = { 'csrfError': 'CSRF Failed: Referrer checking failed - no Referrer.' }; -const anonymousVisitTypes = ['bzr', 'cvs', 'git', 'hg', 'svn']; -const allVisitTypes = ['archives', 'bzr', 'cvs', 'git', 'hg', 'svn']; +const anonymousVisitTypes = ['bzr', 'cvs', 'git', 'hg', 'svn', 'tarball']; +const allVisitTypes = ['archives', 'bzr', 'cvs', 'git', 'hg', 'svn', 'tarball']; function makeOriginSaveRequest(originType, originUrl) { cy.get('#swh-input-origin-url') diff --git a/swh/web/conftest.py b/swh/web/conftest.py index a56556e5d067b50e2381428de4f6e71bf59b1110..4c9fc2b6a3995b94165904493cc711020ed90816 100644 --- a/swh/web/conftest.py +++ b/swh/web/conftest.py @@ -1219,6 +1219,22 @@ def swh_scheduler(config_updater): ) ) + # create load-bzr task type + swh_scheduler.create_task_type( + TaskType( + type="load-tarball-directory", + description="Load a tarball into the archive", + backend_name="swh.loader.core.tasks.LoadTarballDirectory", + default_interval=timedelta(days=64), + min_interval=timedelta(hours=12), + max_interval=timedelta(days=64), + backoff_factor=2.0, + max_queue_length=None, + num_retries=7, + retry_delay=timedelta(hours=2), + ) + ) + # add method to add load-archive-files task type during tests def add_load_archive_task_type(): swh_scheduler.create_task_type( diff --git a/swh/web/save_code_now/origin_save.py b/swh/web/save_code_now/origin_save.py index b9f5daa9ec2d7ac5329d78312bd6d537eb01e175..f0169b520d6ac0c949f7ae189b968463aa19074b 100644 --- a/swh/web/save_code_now/origin_save.py +++ b/swh/web/save_code_now/origin_save.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2024 The Software Heritage developers +# Copyright (C) 2018-2025 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU Affero General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -126,6 +126,7 @@ _visit_type_task = { "svn": "load-svn", "cvs": "load-cvs", "bzr": "load-bzr", + "tarball": "load-tarball-directory", } @@ -527,6 +528,8 @@ def create_save_origin_request( } ) task_kwargs = dict(**task_kwargs, artifacts=artifacts, snapshot_append=True) + elif visit_type == "tarball": + task_kwargs["checksums"] = {} sor = None # get list of previously submitted save requests (most recent first) current_sors = list( diff --git a/swh/web/save_code_now/templates/origin-save-help.html b/swh/web/save_code_now/templates/origin-save-help.html index de85263290c6edd94275d598af52670197c96ba5..8133f483885e8224f1f863ea9b102a8e0b2117de 100644 --- a/swh/web/save_code_now/templates/origin-save-help.html +++ b/swh/web/save_code_now/templates/origin-save-help.html @@ -1,7 +1,7 @@ {% extends "./origin-save.html" %} {% comment %} -Copyright (C) 2018-2023 The Software Heritage developers +Copyright (C) 2018-2025 The Software Heritage developers See the AUTHORS file at the top-level directory of this distribution License: GNU Affero General Public License version 3, or any later version See top-level LICENSE file for more information @@ -12,7 +12,7 @@ See top-level LICENSE file for more information <p style="margin-top: 1rem;">A "Save code now" request takes the following parameters:</p> <ul> <li> - <b>Origin type:</b> the type of version control system the software origin is using. + <b>Origin type:</b> the type of software origin. Currently, the supported types are: <ul> <li> @@ -34,12 +34,19 @@ See top-level LICENSE file for more information <code>bzr</code>, for origins using <a href="https://bazaar.canonical.com/en/">Bazaar</a> </li> {% endif %} + {% if "tarball" in visit_types %} + <li> + <code>tarball</code>, for tarball origins + </li> + {% endif %} </ul> </li> <li> - <b>Origin url:</b> the url of the remote repository for the software origin. + <b>Origin URL:</b> the URL of the remote repository for the software origin + {% if "tarball" in visit_types %}or the URL for downloading a tarball{% endif %} + . <br /> - In order to avoid saving errors from Software Heritage, you should provide the clone/checkout url + In order to avoid saving errors from Software Heritage, you should provide the clone/checkout URL as given by the provider hosting the software origin. <br /> It can easily be found in the @@ -58,7 +65,7 @@ See top-level LICENSE file for more information load its content into the archive as soon as possible </li> <li> - <b>rejected:</b> the provided origin url is blacklisted and no visit will be scheduled + <b>rejected:</b> the provided origin URL is blacklisted and no visit will be scheduled </li> <li> put in <b>pending</b> state: a manual review will then be performed in order to determine if the