development.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. Hacking on DAK
  2. ==============
  3. Pre-requisites:
  4. - Debian (stable) host
  5. - A non-root user
  6. - git (to clone this repository)
  7. Initial Setup
  8. -------------
  9. Grab a copy of the repository::
  10. dev@dakdev:~$ git clone https://salsa.debian.org/ftp-team/dak.git
  11. Install additional dependencies::
  12. cd dak
  13. sudo apt build-dep -y .
  14. Generate some test packages::
  15. make -C ~/dak/tests/fixtures/packages
  16. DAK Subshell
  17. ------------
  18. **NOTE:** Make sure the hostname is configured correctly (/etc/hosts is sufficient).
  19. Working with a development version of DAK is best done from a testing subshell.
  20. To start the shell::
  21. ~/dak/integration-tests/interactive-shell
  22. # Do not use ~/ within this shell
  23. This will create a temporary directory and database to work from.
  24. Once loaded, we need to load some commands::
  25. cd ~/dak
  26. . integration-tests/common
  27. . integration-tests/dinstall
  28. The database can now be poked at using psql::
  29. psql -c 'select * from suite;'
  30. To populate the database, such that it mimics the Debian archive::
  31. setup_debian_like_archive
  32. In order to import any test packages, the test key must also be imported::
  33. import-fixture-signing-key
  34. Useful reference: ``integration-tests/tests/0001-basic``
  35. Workflow
  36. --------
  37. When a package is uploaded, it's dropped into a shared directory. A cron job
  38. will periodically process this data with the ``upload_changes`` command. For
  39. development and testing, the previously built packages can be used::
  40. upload_changes tests/fixtures/packages/*.changes
  41. This will create symlinks in the temporary upload location pointing at the
  42. packages that were previously generated.
  43. With packages uploaded (symlinked, copied, etc.), they can now be processed::
  44. process_uploads
  45. If DAK determines there is a problem with the package, then it will be
  46. automatically REJECTed with an email sent to the maintainer. If an ACCEPTed
  47. package has binaries that are not currently in the archive, DAK will move the
  48. package into the NEW queue for manual review.
  49. To manually process these NEW uploaded packages::
  50. dak process-new
  51. Tests
  52. -----
  53. The full test suite can be run using ``integration-tests/run-tests``. This
  54. should not be done from within an existing subshell; one will be created.
  55. New tests should be written within subshells, as a "unit" separator and should
  56. include a comment.
  57. Common Problems
  58. ---------------
  59. Hostname::
  60. dev@dakdev:~$ ~/dak/integration-tests/interactive-shell
  61. [...]
  62. Ver Cluster Port Status Owner Data directory Log file
  63. 11 regress 5433 online dev /tmp/pg_virtualenv.hIxN2u/data/11/[...]-regress.log
  64. hostname: Name or service not known
  65. hostname: Name or service not known
  66. psql: FATAL: database "projectb" does not exist
  67. hostname: Name or service not known
  68. Creating components
  69. Verify the system hostname is present in ``/etc/hosts``.
  70. No project::
  71. psql: FATAL: database "projectb" does not exist
  72. Exit the subshell, refer to ``Hostname``, open a new subshell.
  73. Packages not processed::
  74. dev@dakdev:/home/dev/dak$ upload_changes tests/fixtures/packages/*.changes
  75. [...]
  76. dev@dakdev:/home/dev/dak$ process_uploads
  77. dev@dakdev:/home/dev/dak$
  78. Make sure the appropriate signing key was imported.