Skip to content
Snippets Groups Projects
  1. Jun 24, 2024
  2. Jun 06, 2024
    • Jérémy Bobbio (Lunar)'s avatar
      Warn when objects are still buffered during shutdown · a84d9e47
      Jérémy Bobbio (Lunar) authored
      It is fairly easy to overlook calling `storage.flush()` after adding
      some objects just before the end of a process. In a direct
      configuration, everything will be fine but if a buffering proxy is
      configured, this means that the objects still in the buffers are going
      to be lost. Let’s add a warning if this is the case.
      a84d9e47
    • Nicolas Dandrimont's avatar
      postgresql: do not remove shared entries in the `snapshot_branch` table · 751634c9
      Nicolas Dandrimont authored
      When deleting a snapshot, deletion removed the corresponding entries in
      the `snapshot_branch` table. These entries are shared between
      snapshots (e.g. all snapshots with a `HEAD` pointing to `refs/heads/main`
      share the same line in this table), and we don't keep a reverse index to
      efficiently remove orphan lines, so we just skip the removal altogether.
      
      Add a test to ensure that the corruption doesn't happen anymore.
      751634c9
  3. Jun 05, 2024
    • Jérémy Bobbio (Lunar)'s avatar
      Support removal of RawExtrinsicMetadata and ExtID objects · a20f399d
      Jérémy Bobbio (Lunar) authored
      These changes are needed to allow `swh alter remove` to remove
      RawExtrinsicMetadata and ExtID objects from the PostgreSQL and Cassandra
      implementation of the storage.
      
      As RawExtrinsicMetadata objects can be addressed using an
      ExtendendSWHID, they can now be removed using `object_delete()`.
      
      For ExtID, a new method `extid_delete_for_target()` has been added to
      `ObjectDeletionInterface`. It will remove any ExtID object targeting one
      of the object in the a list of SWHID given as an argument.
      
      Address swh-alter!11
      a20f399d
    • Jérémy Bobbio (Lunar)'s avatar
      Fix transaction usage in postgresql.object_delete() · 5d3992ec
      Jérémy Bobbio (Lunar) authored
      The cursor provided by the `@db_transaction` decorator was not
      being passed properly.
      5d3992ec
  4. Jun 04, 2024
    • Nicolas Dandrimont's avatar
      Make the blocking/masking admin configs compatible with the swh db utilities · 5dadcfd4
      Nicolas Dandrimont authored
      To be able to use the `swh db` command line, the configurations need to
      have the following shape:
      
      <toplevel key>:
        cls: postgresql
        db: <postgresql DSN>
      
      The usage of `blocking_db` and `masking_db` instead of plain `db`, and
      lack of overridability in the swh db utilities, made schema migrations
      more annoying than necessary.
      
      The old configuration key still works but raises a Deprecation warning.
      
      The configuration of the proxies themselves is unchanged, as having a
      differently-named key for the proxy-specific database makes sense to
      avoid confusion.
      5dadcfd4
  5. Jun 03, 2024
  6. May 31, 2024
    • vlorentz's avatar
      Introduce an object patching proxy feature in the MaskingProxy · e2700570
      vlorentz authored and David Douard's avatar David Douard committed
      This is an alternative to modifying the `person` table, as that
      technique only worked on the PostgreSQL backend and not with Cassandra,
      as it does not have a `person` table (authors and committers are inlined
      in the revision and release tables).
      
      This does not come with cli tooling to manage the display name table
      entries for now.
      e2700570
  7. May 28, 2024
  8. May 17, 2024
  9. May 15, 2024
    • David Douard's avatar
      Add a blocking event logging facility for the blocking proxy · 5251f367
      David Douard authored
      This add a 'blocking_origin_log' table in the database where each
      filtering event is logged, be it a deny or an expliciy accept event.
      5251f367
    • David Douard's avatar
      Add an origin blocking proxy · 46535389
      David Douard authored
      This proxy prevent registered origins from being visited again. If an
      origin url is matching a blocking rule, then any attempt to add an
      Origin, OriginVisit or OriginVisitStatus object targeting this url will
      be blocked, raising a BlockedOriginException.
      
      This is implemented in a similar fashion than the MaskingProxy, sharing
      the same management logic as this later.
      
      The url matching rules are, given a checked URL:
      - check for an exact match in the blocking rules on:
        1. the given URL
        2. the trimmed URL (if it has a trailing /)
        3. the extension-less URL if it ends with a know suffix (eg. '.git')
      - if no exact match is found, look for the best prefix match on split
        sub-path urls (aka the longest url match in the blocking rules
        for which the URL starts with the match, splitting on '/')
      46535389
  10. May 14, 2024
  11. May 06, 2024
  12. May 03, 2024
  13. May 02, 2024
    • David Douard's avatar
      Move SQL scripts for the masking proxy under swh/storage/proxies/masking · 26c3be97
      David Douard authored
      Make the MaskingProxy uses its own db rather than sharing the main
      storage one with fragile use of flavors to shoehorn it in there.
      
      The migration script for the main storage db requires to recreate the
      db flavor table and (enum) type since this later cannot be altered
      to remove an entry.
      
      On the masking part, we set the db model version to 193 because the
      currently deployed version is actually set to the main storage's db
      version (thus 192).
      26c3be97
  14. Apr 11, 2024
  15. Apr 02, 2024
  16. Mar 29, 2024
    • Nicolas Dandrimont's avatar
      Revert "metrics: use method tag instead of endpoint" · 7ea195ae
      Nicolas Dandrimont authored
      This reverts commit f7588d35.
      
      Prometheus keeps the original endpoint tag as `exported_endpoint`, so we
      can just keep it as such (and avoid losing historical metrics).
      7ea195ae
    • David Douard's avatar
      Apply swh-py-template v0.2.0 · 1ffdb045
      David Douard authored
      1ffdb045
    • Jérémy Bobbio (Lunar)'s avatar
      masking: Add CLI tools to manage the proxy · 785092c5
      Jérémy Bobbio (Lunar) authored and Nicolas Dandrimont's avatar Nicolas Dandrimont committed
      Online help:
      
          Usage: swh storage masking [OPTIONS] COMMAND [ARGS]...
      
            Configure masking on archived objects
      
            These tools require read/write access to the masking database. An entry must
            be added to the configuration file as follow:
      
                    storage:
                      …
      
                    masking_admin:
                      masking_db: "service=swh-masking-admin"
      
          Options:
            -h, --help  Show this message and exit.
      
          Commands:
            clear-request   Remove all masking states for the given request
            history         Get the history for a request
            list-requests   List masking requests
            new-request     Create a new request to mask objects
            object-state    Get the masking state for a set of SWHIDs
            status          Get the masking states defined by a request
            update-objects  Update the state of given objects
      785092c5
  17. Mar 28, 2024
Loading