Skip to content
Snippets Groups Projects
  1. Jul 07, 2023
    • David Douard's avatar
      Make `swh db init` command work properly with the --dbname option · 89d48572
      David Douard authored
      This allows to run the command `swh db init --dname DBURI` without
      giving a configuration file while still populating the dbversion table
      in the database.
      
      Note that this may not work for all swh packages, when the postgresql
      backend for the given swh package needs more configuration entries than
      just the psql connection string.
      
      This more or less drops support for "old style" db sql init scripts:
      
      - the `swh db init` will still work for an 'old style' package (in which
        the sql init scripts do create dbversion table and initialize it) but
        will display an error message,
      - the --initial-version option has been dropped, since this made sense
        only for old style packages,
      - the test data 'cli_new' has been renamed as 'cli' (in place of the
        previous "old style" one)
      89d48572
  2. Jun 26, 2023
  3. Jun 20, 2023
  4. Jun 14, 2023
  5. Jun 13, 2023
  6. May 11, 2023
    • vlorentz's avatar
      cli: Prevent rewrapping of code blocks · 984da898
      vlorentz authored
      Before:
      
      ```
      $ swh db init -h
      Usage: swh db init [OPTIONS] MODULE
      
        Initialize a database for the Software Heritage <module>.
      
        The database connection string comes from the configuration file (see option
        ``--config-file`` in ``swh db --help``) in the section named after the
        MODULE argument.
      
        Example::
      
            $ cat conf.yml     storage:       cls: postgresql       db:
            postgresql://user:passwd@pghost:5433/swh-storage       objstorage:
            cls: memory
      
            $ swh db -C conf.yml init storage  # or     $
            SWH_CONFIG_FILENAME=conf.yml swh db init storage
      
        Note that the connection string can also be passed directly using the '--db-
        name' option, but this usage is about to be deprecated.
      ```
      
      After:
      
      ```
      $ swh db init -h
      Usage: swh db init [OPTIONS] MODULE
      
        Initialize a database for the Software Heritage <module>.
      
        The database connection string comes from the configuration file (see option
        ``--config-file`` in ``swh db --help``) in the section named after the
        MODULE argument.
      
        Example::
      
                $ cat conf.yml
                storage:
                  cls: postgresql
                  db: postgresql://user:passwd@pghost:5433/swh-storage
                  objstorage:
                    cls: memory
      
                $ swh db -C conf.yml init storage  # or
                $ SWH_CONFIG_FILENAME=conf.yml swh db init storage
      
        Note that the connection string can also be passed directly using the '--db-
        name' option, but this usage is about to be deprecated.
      ```
      v2.22.2
      984da898
    • vlorentz's avatar
  7. May 10, 2023
    • vlorentz's avatar
      config: Remove confusing magic in path handling · 2663c0a4
      vlorentz authored
      1. When passed a .yaml path (or any path with a non-whitelisted extension),
         don't read .yml instead when the .yaml exists.
         It's an extremely surprising behavior.
      
      2. If the .yaml file does not exist, it will still try alternative extensions
         in order not to break existing deployments which may rely on it, but it
         raises a warning now.
      
      3. When given a non-existing path, show an error log, but keep parsing
         it as an empty config, in order not to break existing deployments.
      v2.22.1
      2663c0a4
  8. May 02, 2023
  9. Apr 20, 2023
  10. Apr 18, 2023
  11. Apr 13, 2023
  12. Mar 27, 2023
  13. Mar 13, 2023
  14. Mar 08, 2023
  15. Feb 21, 2023
  16. Feb 20, 2023
  17. Feb 17, 2023
  18. Feb 02, 2023
  19. Jan 24, 2023
  20. Jan 23, 2023
  21. Dec 21, 2022
  22. Dec 09, 2022
  23. Oct 24, 2022
  24. Oct 18, 2022
  25. Oct 13, 2022
  26. Oct 12, 2022
  27. Oct 05, 2022
  28. Oct 03, 2022
  29. Sep 12, 2022
  30. Aug 23, 2022
    • vlorentz's avatar
      Fix mypy error · 843a010c
      vlorentz authored
      Without the return, 'psycopg2.connect(db_or_conninfo)' is actually reachable
      when calling next() twice on the generator
      843a010c
  31. Aug 19, 2022
  32. Aug 09, 2022
Loading